diff --git a/cmd/api/src/config/config.go b/cmd/api/src/config/config.go index f99523d0ae..bd7a99ac37 100644 --- a/cmd/api/src/config/config.go +++ b/cmd/api/src/config/config.go @@ -139,32 +139,33 @@ type DefaultAdminConfiguration struct { } type Configuration struct { - Version int `json:"version"` - BindAddress string `json:"bind_addr"` - NetTimeoutSeconds int `json:"net_timeout_seconds"` - SlowQueryThreshold int64 `json:"slow_query_threshold"` - MaxGraphQueryCacheSize int `json:"max_graphdb_cache_size"` - MaxAPICacheSize int `json:"max_api_cache_size"` - MetricsPort string `json:"metrics_port"` - RootURL serde.URL `json:"root_url"` - WorkDir string `json:"work_dir"` - LogLevel string `json:"log_level"` - LogPath string `json:"log_path"` - TLS TLSConfiguration `json:"tls"` - GraphDriver string `json:"graph_driver"` - Database DatabaseConfiguration `json:"database"` - Neo4J DatabaseConfiguration `json:"neo4j"` - Crypto CryptoConfiguration `json:"crypto"` - SAML SAMLConfiguration `json:"saml"` - SpecterAuth SpecterAuthConfiguration `json:"specter_auth"` - DefaultAdmin DefaultAdminConfiguration `json:"default_admin"` - CollectorsBasePath string `json:"collectors_base_path"` - DatapipeInterval int `json:"datapipe_interval"` - EnableAPILogging bool `json:"enable_api_logging"` - DisableAnalysis bool `json:"disable_analysis"` - DisableCypherQC bool `json:"disable_cypher_qc"` - DisableMigrations bool `json:"disable_migrations"` - TraversalMemoryLimit uint16 `json:"traversal_memory_limit"` + Version int `json:"version"` + BindAddress string `json:"bind_addr"` + NetTimeoutSeconds int `json:"net_timeout_seconds"` + SlowQueryThreshold int64 `json:"slow_query_threshold"` + MaxGraphQueryCacheSize int `json:"max_graphdb_cache_size"` + MaxAPICacheSize int `json:"max_api_cache_size"` + MetricsPort string `json:"metrics_port"` + RootURL serde.URL `json:"root_url"` + WorkDir string `json:"work_dir"` + LogLevel string `json:"log_level"` + LogPath string `json:"log_path"` + TLS TLSConfiguration `json:"tls"` + GraphDriver string `json:"graph_driver"` + Database DatabaseConfiguration `json:"database"` + Neo4J DatabaseConfiguration `json:"neo4j"` + Crypto CryptoConfiguration `json:"crypto"` + SAML SAMLConfiguration `json:"saml"` + SpecterAuth SpecterAuthConfiguration `json:"specter_auth"` + DefaultAdmin DefaultAdminConfiguration `json:"default_admin"` + CollectorsBasePath string `json:"collectors_base_path"` + DatapipeInterval int `json:"datapipe_interval"` + EnableStartupWaitPeriod bool `json:"enable_startup_wait_period"` + EnableAPILogging bool `json:"enable_api_logging"` + DisableAnalysis bool `json:"disable_analysis"` + DisableCypherQC bool `json:"disable_cypher_qc"` + DisableMigrations bool `json:"disable_migrations"` + TraversalMemoryLimit uint16 `json:"traversal_memory_limit"` } func (s Configuration) TempDirectory() string { diff --git a/cmd/api/src/config/default.go b/cmd/api/src/config/default.go index b3d726d367..12f48a9bf2 100644 --- a/cmd/api/src/config/default.go +++ b/cmd/api/src/config/default.go @@ -18,6 +18,7 @@ package config import ( "fmt" + "github.com/specterops/bloodhound/dawgs/drivers/neo4j" "github.com/specterops/bloodhound/src/serde" @@ -33,27 +34,28 @@ func NewDefaultConfiguration() (Configuration, error) { return Configuration{}, fmt.Errorf("failed to generate default password: %w", err) } else { return Configuration{ - Version: 0, - BindAddress: "127.0.0.1", - NetTimeoutSeconds: 70, // Default timeout to avoid race conditions with 60 second gateway timeouts - SlowQueryThreshold: 100, // Threshold in ms for caching queries - MaxGraphQueryCacheSize: 100, // Number of cache items for graph queries - MaxAPICacheSize: 200, // Number of cache items for API utilities - MetricsPort: ":2112", - RootURL: serde.MustParseURL("http://localhost"), - WorkDir: "/opt/bhe/work", - LogLevel: "INFO", - LogPath: DefaultLogFilePath, - CollectorsBasePath: "/etc/bloodhound/collectors", - DatapipeInterval: 60, - EnableAPILogging: true, - DisableAnalysis: false, - DisableCypherQC: false, - DisableMigrations: false, - TraversalMemoryLimit: 2, // 2 GiB by default - TLS: TLSConfiguration{}, - SAML: SAMLConfiguration{}, - GraphDriver: neo4j.DriverName, // Default to Neo4j as the graph driver + Version: 0, + BindAddress: "127.0.0.1", + NetTimeoutSeconds: 70, // Default timeout to avoid race conditions with 60 second gateway timeouts + SlowQueryThreshold: 100, // Threshold in ms for caching queries + MaxGraphQueryCacheSize: 100, // Number of cache items for graph queries + MaxAPICacheSize: 200, // Number of cache items for API utilities + MetricsPort: ":2112", + RootURL: serde.MustParseURL("http://localhost"), + WorkDir: "/opt/bhe/work", + LogLevel: "INFO", + LogPath: DefaultLogFilePath, + CollectorsBasePath: "/etc/bloodhound/collectors", + DatapipeInterval: 60, + EnableStartupWaitPeriod: true, + EnableAPILogging: true, + DisableAnalysis: false, + DisableCypherQC: false, + DisableMigrations: false, + TraversalMemoryLimit: 2, // 2 GiB by default + TLS: TLSConfiguration{}, + SAML: SAMLConfiguration{}, + GraphDriver: neo4j.DriverName, // Default to Neo4j as the graph driver Database: DatabaseConfiguration{ MaxConcurrentSessions: 10, },