Skip to content

Commit c98ca61

Browse files
install udpte
1 parent 9114383 commit c98ca61

34 files changed

Lines changed: 8388 additions & 643 deletions

cmd/auth.go

Lines changed: 699 additions & 0 deletions
Large diffs are not rendered by default.

cmd/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var configCmd = &cobra.Command{
1212

1313
func init() {
1414
rootCmd.AddCommand(configCmd)
15-
15+
1616
configCmd.AddCommand(configProfileCmd)
1717
configCmd.AddCommand(configScopeCmd)
1818
configCmd.AddCommand(configToolCmd)
@@ -30,9 +30,9 @@ var configProfileCreateCmd = &cobra.Command{
3030
RunE: func(cmd *cobra.Command, args []string) error {
3131
name := args[0]
3232
description, _ := cmd.Flags().GetString("description")
33-
33+
3434
log.Info("Creating profile", "name", name, "description", description)
35-
35+
3636
return nil
3737
},
3838
}
@@ -57,9 +57,9 @@ var configScopeAddCmd = &cobra.Command{
5757
Args: cobra.ExactArgs(1),
5858
RunE: func(cmd *cobra.Command, args []string) error {
5959
pattern := args[0]
60-
60+
6161
log.Info("Adding to scope", "pattern", pattern)
62-
62+
6363
return nil
6464
},
6565
}
@@ -81,9 +81,9 @@ var configToolCmd = &cobra.Command{
8181
func init() {
8282
configProfileCmd.AddCommand(configProfileCreateCmd)
8383
configProfileCmd.AddCommand(configProfileListCmd)
84-
84+
8585
configScopeCmd.AddCommand(configScopeAddCmd)
8686
configScopeCmd.AddCommand(configScopeListCmd)
87-
87+
8888
configProfileCreateCmd.Flags().String("description", "", "Profile description")
89-
}
89+
}

cmd/deploy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var deployCmd = &cobra.Command{
1212

1313
func init() {
1414
rootCmd.AddCommand(deployCmd)
15-
15+
1616
deployCmd.AddCommand(deployCreateCmd)
1717
deployCmd.AddCommand(deployScaleCmd)
1818
deployCmd.AddCommand(deployStatusCmd)
@@ -25,9 +25,9 @@ var deployCreateCmd = &cobra.Command{
2525
RunE: func(cmd *cobra.Command, args []string) error {
2626
workers, _ := cmd.Flags().GetInt("workers")
2727
datacenter, _ := cmd.Flags().GetString("datacenter")
28-
28+
2929
log.Info("Deploying to Nomad", "workers", workers, "datacenter", datacenter)
30-
30+
3131
return nil
3232
},
3333
}
@@ -63,4 +63,4 @@ var deployStopCmd = &cobra.Command{
6363
func init() {
6464
deployCreateCmd.Flags().Int("workers", 3, "Number of workers to deploy")
6565
deployCreateCmd.Flags().String("datacenter", "dc1", "Nomad datacenter")
66-
}
66+
}

cmd/results.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var resultsCmd = &cobra.Command{
1212

1313
func init() {
1414
rootCmd.AddCommand(resultsCmd)
15-
15+
1616
resultsCmd.AddCommand(resultsListCmd)
1717
resultsCmd.AddCommand(resultsGetCmd)
1818
resultsCmd.AddCommand(resultsExportCmd)
@@ -26,9 +26,9 @@ var resultsListCmd = &cobra.Command{
2626
target, _ := cmd.Flags().GetString("target")
2727
severity, _ := cmd.Flags().GetString("severity")
2828
limit, _ := cmd.Flags().GetInt("limit")
29-
29+
3030
log.Info("Listing results", "target", target, "severity", severity, "limit", limit)
31-
31+
3232
return nil
3333
},
3434
}
@@ -39,9 +39,9 @@ var resultsGetCmd = &cobra.Command{
3939
Args: cobra.ExactArgs(1),
4040
RunE: func(cmd *cobra.Command, args []string) error {
4141
scanID := args[0]
42-
42+
4343
log.Info("Getting scan results", "scanID", scanID)
44-
44+
4545
return nil
4646
},
4747
}
@@ -54,9 +54,9 @@ var resultsExportCmd = &cobra.Command{
5454
scanID := args[0]
5555
format, _ := cmd.Flags().GetString("format")
5656
output, _ := cmd.Flags().GetString("output")
57-
57+
5858
log.Info("Exporting results", "scanID", scanID, "format", format, "output", output)
59-
59+
6060
return nil
6161
},
6262
}
@@ -66,9 +66,9 @@ var resultsSummaryCmd = &cobra.Command{
6666
Short: "Get summary of all scan results",
6767
RunE: func(cmd *cobra.Command, args []string) error {
6868
days, _ := cmd.Flags().GetInt("days")
69-
69+
7070
log.Info("Getting results summary", "days", days)
71-
71+
7272
return nil
7373
},
7474
}
@@ -77,9 +77,9 @@ func init() {
7777
resultsListCmd.Flags().String("target", "", "Filter by target")
7878
resultsListCmd.Flags().String("severity", "", "Filter by severity (critical, high, medium, low, info)")
7979
resultsListCmd.Flags().Int("limit", 50, "Maximum number of results")
80-
80+
8181
resultsExportCmd.Flags().String("format", "json", "Export format (json, csv, html)")
8282
resultsExportCmd.Flags().String("output", "", "Output file (default: stdout)")
83-
83+
8484
resultsSummaryCmd.Flags().Int("days", 7, "Number of days to include in summary")
85-
}
85+
}

cmd/schedule.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var scheduleCmd = &cobra.Command{
1212

1313
func init() {
1414
rootCmd.AddCommand(scheduleCmd)
15-
15+
1616
scheduleCmd.AddCommand(scheduleCreateCmd)
1717
scheduleCmd.AddCommand(scheduleListCmd)
1818
scheduleCmd.AddCommand(scheduleDeleteCmd)
@@ -27,9 +27,9 @@ var scheduleCreateCmd = &cobra.Command{
2727
cron, _ := cmd.Flags().GetString("cron")
2828
scanType, _ := cmd.Flags().GetString("type")
2929
profile, _ := cmd.Flags().GetString("profile")
30-
30+
3131
log.Info("Creating schedule", "target", target, "cron", cron, "type", scanType, "profile", profile)
32-
32+
3333
return nil
3434
},
3535
}
@@ -49,9 +49,9 @@ var scheduleDeleteCmd = &cobra.Command{
4949
Args: cobra.ExactArgs(1),
5050
RunE: func(cmd *cobra.Command, args []string) error {
5151
scheduleID := args[0]
52-
52+
5353
log.Info("Deleting schedule", "scheduleID", scheduleID)
54-
54+
5555
return nil
5656
},
5757
}
@@ -60,4 +60,4 @@ func init() {
6060
scheduleCreateCmd.Flags().String("cron", "0 0 * * *", "Cron expression for schedule")
6161
scheduleCreateCmd.Flags().String("type", "full", "Scan type")
6262
scheduleCreateCmd.Flags().String("profile", "default", "Scan profile to use")
63-
}
63+
}

install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SHELLS_BUILD_PATH="$SHELLS_SRC_DIR/$SHELLS_BINARY_NAME"
3939
INSTALL_PATH="/usr/local/bin/$SHELLS_BINARY_NAME"
4040

4141
# Go installation settings
42-
GO_VERSION="1.21.0"
42+
GO_VERSION="1.24.5"
4343
GO_INSTALL_DIR="/usr/local"
4444

4545
# --- Directories ---
@@ -89,12 +89,12 @@ install_go() {
8989
current_version=$(go version | awk '{print $3}' | sed 's/go//')
9090
log INFO " Detected Go version: $current_version"
9191

92-
# Simple version comparison - check if current version is at least the required version
93-
if printf '%s\n%s\n' "$GO_VERSION" "$current_version" | sort -V | head -n1 | grep -q "^$GO_VERSION$"; then
94-
log INFO " Go is already up-to-date (version $current_version >= $GO_VERSION)"
95-
else
92+
# Force installation if version is less than 1.24
93+
if [[ "$current_version" < "1.24" ]]; then
9694
log INFO " Go version is older (wanted: $GO_VERSION, found: $current_version)"
9795
need_go_install=true
96+
else
97+
log INFO " Go is already up-to-date (version $current_version >= $GO_VERSION)"
9898
fi
9999
fi
100100

internal/config/config.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type Config struct {
1515
}
1616

1717
type LoggerConfig struct {
18-
Level string `mapstructure:"level"`
19-
Format string `mapstructure:"format"`
18+
Level string `mapstructure:"level"`
19+
Format string `mapstructure:"format"`
2020
OutputPaths []string `mapstructure:"output_paths"`
2121
}
2222

@@ -46,18 +46,18 @@ type WorkerConfig struct {
4646
}
4747

4848
type TelemetryConfig struct {
49-
Enabled bool `mapstructure:"enabled"`
50-
ServiceName string `mapstructure:"service_name"`
51-
ExporterType string `mapstructure:"exporter_type"`
52-
Endpoint string `mapstructure:"endpoint"`
49+
Enabled bool `mapstructure:"enabled"`
50+
ServiceName string `mapstructure:"service_name"`
51+
ExporterType string `mapstructure:"exporter_type"`
52+
Endpoint string `mapstructure:"endpoint"`
5353
SampleRate float64 `mapstructure:"sample_rate"`
5454
}
5555

5656
type SecurityConfig struct {
57-
RateLimit RateLimitConfig `mapstructure:"rate_limit"`
58-
ScopeFile string `mapstructure:"scope_file"`
59-
APIKey string `mapstructure:"api_key"`
60-
EnableAuth bool `mapstructure:"enable_auth"`
57+
RateLimit RateLimitConfig `mapstructure:"rate_limit"`
58+
ScopeFile string `mapstructure:"scope_file"`
59+
APIKey string `mapstructure:"api_key"`
60+
EnableAuth bool `mapstructure:"enable_auth"`
6161
}
6262

6363
type RateLimitConfig struct {
@@ -84,9 +84,9 @@ type NmapConfig struct {
8484
}
8585

8686
type SSLConfig struct {
87-
Timeout time.Duration `mapstructure:"timeout"`
88-
FollowRedirects bool `mapstructure:"follow_redirects"`
89-
CheckRevocation bool `mapstructure:"check_revocation"`
87+
Timeout time.Duration `mapstructure:"timeout"`
88+
FollowRedirects bool `mapstructure:"follow_redirects"`
89+
CheckRevocation bool `mapstructure:"check_revocation"`
9090
}
9191

9292
type ZAPConfig struct {
@@ -144,43 +144,43 @@ func (c *Config) Validate() error {
144144
if c.Logger.Level == "" {
145145
c.Logger.Level = "info"
146146
}
147-
147+
148148
if c.Logger.Format == "" {
149149
c.Logger.Format = "json"
150150
}
151-
151+
152152
if c.Database.Driver == "" {
153153
c.Database.Driver = "sqlite3"
154154
}
155-
155+
156156
if c.Redis.Addr == "" {
157157
c.Redis.Addr = "localhost:6379"
158158
}
159-
159+
160160
if c.Worker.Count < 1 {
161161
c.Worker.Count = 1
162162
}
163-
163+
164164
if c.Worker.QueuePollInterval == 0 {
165165
c.Worker.QueuePollInterval = 5 * time.Second
166166
}
167-
167+
168168
if c.Security.RateLimit.RequestsPerSecond == 0 {
169169
c.Security.RateLimit.RequestsPerSecond = 10
170170
}
171-
171+
172172
if c.Telemetry.ServiceName == "" {
173173
c.Telemetry.ServiceName = "shells"
174174
}
175-
175+
176176
return nil
177177
}
178178

179179
func DefaultConfig() *Config {
180180
return &Config{
181181
Logger: LoggerConfig{
182-
Level: "info",
183-
Format: "json",
182+
Level: "info",
183+
Format: "json",
184184
OutputPaths: []string{"stdout"},
185185
},
186186
Database: DatabaseConfig{
@@ -263,4 +263,4 @@ func DefaultConfig() *Config {
263263
},
264264
},
265265
}
266-
}
266+
}

0 commit comments

Comments
 (0)