Documentation
¶
Overview ¶
Package cli provides command-line interface commands for the Scanorama network scanner. This file implements the API server command for running a standalone API server without the full daemon functionality.
Package cli provides CLI authentication helpers for making API calls. This file implements HTTP client functionality with API key authentication for CLI commands that interact with the Scanorama API server.
Package cli provides command-line interface commands for the Scanorama network scanner. This file implements API key management commands for creating, listing, updating, and deleting API keys used for API server authentication.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This file implements the groups subcommand with full CRUD and member management.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This file contains shell completion helper functions for the networks subcommands.
Package cli provides command-line interface commands for the Scanorama network scanner. This file contains the command run functions for the networks subcommands.
Package cli provides command-line interface commands for the Scanorama network scanner. This file contains database query and display helper functions for the networks subcommands.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This package implements the Cobra-based CLI structure with commands for scanning, discovery, host management, scheduling, and daemon operations.
Package cli provides command-line interface commands for the Scanorama network scanner. This file implements the server command with lifecycle management.
Package cli provides command-line interface commands for the Scanorama network scanner. This file implements settings management commands for reading and updating server configuration via the admin API.
Package cli provides command-line interface commands for the Scanorama network scanner. This file implements the smart-scan subcommand group for adaptive scanning operations.
Index ¶
- Constants
- func Execute()
- func GetVersion() string
- func SetVersion(v, c, bt string)
- func WithAPIClient(operation string, fn func(*APIClient) error) error
- type APIClient
- func (c *APIClient) Delete(endpoint string) (*APIResponse, error)
- func (c *APIClient) DeleteWithBody(endpoint string, payload interface{}) (*APIResponse, error)
- func (c *APIClient) Get(endpoint string) (*APIResponse, error)
- func (c *APIClient) GetServerInfo() (map[string]interface{}, error)
- func (c *APIClient) Post(endpoint string, payload interface{}) (*APIResponse, error)
- func (c *APIClient) Put(endpoint string, payload interface{}) (*APIResponse, error)
- func (c *APIClient) TestConnection() error
- type APIError
- type APIResponse
- type DatabaseOperation
- type DiscoveryJob
- type Host
- type HostFilters
- type ProfileRecommendation
- type ScanJob
- type ScanStage
- type ScheduledJob
- type Setting
- type SuggestionGroup
- type SuggestionSummary
Constants ¶
const ( StatusBadRequest = 400 StatusForbidden = 403 StatusNotFound = 404 StatusTooManyRequests = 429 StatusInternalServerError = 500 )
HTTP status code constants
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetVersion ¶ added in v0.17.0
func GetVersion() string
GetVersion returns the formatted version string (exported for testing).
func SetVersion ¶
func SetVersion(v, c, bt string)
SetVersion sets the version information (called from main).
Types ¶
type APIClient ¶ added in v0.10.0
type APIClient struct {
// contains filtered or unexported fields
}
APIClient provides authenticated HTTP client functionality for CLI commands
func NewAPIClient ¶ added in v0.10.0
NewAPIClient creates a new API client with authentication
func (*APIClient) Delete ¶ added in v0.10.0
func (c *APIClient) Delete(endpoint string) (*APIResponse, error)
Delete performs a DELETE request
func (*APIClient) DeleteWithBody ¶ added in v0.25.0
func (c *APIClient) DeleteWithBody(endpoint string, payload interface{}) (*APIResponse, error)
DeleteWithBody performs a DELETE request with a JSON payload. Some APIs require a request body on DELETE (e.g. bulk-remove operations).
func (*APIClient) Get ¶ added in v0.10.0
func (c *APIClient) Get(endpoint string) (*APIResponse, error)
Get performs a GET request to the specified endpoint
func (*APIClient) GetServerInfo ¶ added in v0.10.0
GetServerInfo retrieves server information (requires authentication)
func (*APIClient) Post ¶ added in v0.10.0
func (c *APIClient) Post(endpoint string, payload interface{}) (*APIResponse, error)
Post performs a POST request with JSON payload
func (*APIClient) Put ¶ added in v0.10.0
func (c *APIClient) Put(endpoint string, payload interface{}) (*APIResponse, error)
Put performs a PUT request with JSON payload
func (*APIClient) TestConnection ¶ added in v0.10.0
TestConnection tests the API connection and authentication
type APIError ¶ added in v0.10.0
type APIError struct {
StatusCode int
Message string
RequestID string
Response *APIResponse
}
APIError represents an API error response
type APIResponse ¶ added in v0.10.0
type APIResponse struct {
Data interface{} `json:"data,omitempty"`
Error string `json:"error,omitempty"`
Message string `json:"message,omitempty"`
RequestID string `json:"request_id,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
}
APIResponse represents a standard API response structure
type DatabaseOperation ¶
DatabaseOperation represents a function that operates on a database connection.
type DiscoveryJob ¶
DiscoveryJob represents a discovery job configuration.
type Host ¶
type Host struct {
IP string
Status string
OSFamily string
OSName string
LastSeen time.Time
FirstSeen time.Time
IsIgnored bool
OpenPorts int
TotalScans int
DiscoveryMethod string
}
Host represents a discovered host.
type HostFilters ¶
type HostFilters struct {
Status string
OSFamily string
LastSeenDur time.Duration
ShowIgnored bool
}
HostFilters represents the filters for querying hosts.
type ProfileRecommendation ¶ added in v0.25.0
type ProfileRecommendation struct {
OSFamily string `json:"os_family"`
HostCount int `json:"host_count"`
ProfileID string `json:"profile_id"`
ProfileName string `json:"profile_name"`
Action string `json:"action"`
}
ProfileRecommendation is one element of the GET /smart-scan/profile-recommendations array.
type ScanJob ¶
type ScanJob struct {
Name string
CronExpr string
Targets string
LiveHosts bool
Ports string
ScanType string
Profile string
Timeout int
OSFamily string
}
ScanJob represents a scan job configuration.
type ScanStage ¶ added in v0.25.0
type ScanStage struct {
Stage string `json:"stage"`
ScanType string `json:"scan_type"`
Ports string `json:"ports"`
OSDetection bool `json:"os_detection"`
ProfileID *string `json:"profile_id,omitempty"`
Reason string `json:"reason"`
}
ScanStage is the response shape for GET /smart-scan/hosts/{id}/stage.
type ScheduledJob ¶
type ScheduledJob struct {
ID string
Name string
JobType string
CronExpr string
IsActive bool
CreatedAt time.Time
LastRun *time.Time
NextRun time.Time
RunCount int
Config map[string]interface{}
}
ScheduledJob represents a scheduled job.
type Setting ¶ added in v0.25.0
type Setting struct {
Key string `json:"key"`
Value string `json:"value"`
Description string `json:"description"`
Type string `json:"type"`
UpdatedAt string `json:"updated_at"`
}
Setting represents a single server configuration entry returned by the API.
type SuggestionGroup ¶ added in v0.25.0
type SuggestionGroup struct {
Count int `json:"count"`
Description string `json:"description"`
Action string `json:"action"`
}
SuggestionGroup describes a category of smart-scan suggestions.
type SuggestionSummary ¶ added in v0.25.0
type SuggestionSummary struct {
NoOSInfo SuggestionGroup `json:"no_os_info"`
NoPorts SuggestionGroup `json:"no_ports"`
NoServices SuggestionGroup `json:"no_services"`
Stale SuggestionGroup `json:"stale"`
WellKnown SuggestionGroup `json:"well_known"`
TotalHosts int `json:"total_hosts"`
GeneratedAt string `json:"generated_at"`
}
SuggestionSummary is the response shape for GET /smart-scan/suggestions.