config

package
v0.1.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBurpMCPURL    = "http://127.0.0.1:9876/"
	DefaultBurpProxyAddr = "127.0.0.1:8080"
	DefaultMCPPort       = 9119
	DefaultProxyPort     = 8080

	// DefaultSidecarPort is the loopback TCP port used for the sidecar IPC
	// socket on Windows, which lacks reliable Unix domain socket support.
	DefaultSidecarPort = 9229

	// DefaultSidecarHeartbeatIntervalSecs and DefaultSidecarHeartbeatTimeoutSecs
	// are the default sidecar heartbeat timings in seconds.
	DefaultSidecarHeartbeatIntervalSecs = 10
	DefaultSidecarHeartbeatTimeoutSecs  = 30

	// DefaultExcludeExtensions is the default RE2 alternation for file
	// extensions that should be excluded from proxy capture.
	DefaultExcludeExtensions = "gif|jpg|jpeg|png|ico|webp|woff|woff2|ttf|eot"
)

Variables

View Source
var Version = "dev"

Version is injected at build time via ldflags or from go install; defaults to "dev".

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns ~/.sectool/config.json.

func DefaultSidecarSocket added in v0.1.18

func DefaultSidecarSocket() string

DefaultSidecarSocket returns the default sidecar IPC address: a Unix domain socket at ~/.sectool/sidecar.sock.

func UserAgent

func UserAgent() string

Types

type Config

type Config struct {
	Version             string         `json:"version"`
	MCPPort             int            `json:"mcp_port"`
	ProxyPort           int            `json:"proxy_port"`
	BurpRequired        *bool          `json:"burp_required"`
	MaxBodyBytes        int            `json:"max_body_bytes"` // limits request/response body sizes
	IncludeSubdomains   *bool          `json:"include_subdomains"`
	AllowedDomains      []string       `json:"allowed_domains"`
	ExcludeDomains      []string       `json:"exclude_domains"`
	InteractshServerURL string         `json:"interactsh_server_url"` // empty = use default public servers
	InteractshAuthToken string         `json:"interactsh_auth_token"` // optional, for protected servers; INTERACTSH_TOKEN env var used as fallback
	Proxy               ProxyConfig    `json:"proxy"`
	Crawler             CrawlerConfig  `json:"crawler"`
	Sidecars            SidecarsConfig `json:"sidecars"`
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default values.

func LoadOrCreatePath

func LoadOrCreatePath(path string) (*Config, error)

LoadOrCreatePath loads config from path, creating with defaults if missing. When the on-disk version differs from the running binary version, any missing fields are filled from defaults and the file is re-saved so that new configuration options are persisted for future runs.

func (*Config) IsDomainAllowed

func (c *Config) IsDomainAllowed(hostname string) (bool, string)

IsDomainAllowed checks whether a hostname is permitted by the domain scoping configuration. Returns true if allowed, or false with a reason string.

func (*Config) Save

func (c *Config) Save(path string) error

Save writes config to path atomically, creating parent directory if needed.

type CrawlerConfig

type CrawlerConfig struct {
	DisallowedPaths []string `json:"disallowed_paths"`
	DelayMS         int      `json:"delay_ms"`
	Parallelism     int      `json:"parallelism"`
	MaxDepth        int      `json:"max_depth"`
	MaxRequests     int      `json:"max_requests"`
	ExtractForms    *bool    `json:"extract_forms"`
	SubmitForms     *bool    `json:"submit_forms"`
	Recon           *bool    `json:"recon"`
}

type ProxyConfig

type ProxyConfig struct {
	DialTimeoutSecs  int `json:"dial_timeout_secs"`
	ReadTimeoutSecs  int `json:"read_timeout_secs"`
	WriteTimeoutSecs int `json:"write_timeout_secs"`

	// RE2 alternation of extensions to exclude from capture
	ExcludeExtensions *string `json:"exclude_extensions"`
}

type SidecarsConfig added in v0.1.18

type SidecarsConfig struct {
	// Enabled gates the listener, created only under the native proxy backend.
	Enabled               *bool  `json:"enabled"`
	Socket                string `json:"sidecar_socket"` // local IPC socket for protocol sidecars (UDS path or host:port)
	HeartbeatIntervalSecs int    `json:"heartbeat_interval_secs"`
	HeartbeatTimeoutSecs  int    `json:"heartbeat_timeout_secs"`
}

SidecarsConfig holds declarative settings for out-of-process protocol sidecars. Sidecars are operator-launched (attached) and dial Socket; sectool does not spawn them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL