Documentation
¶
Overview ¶
Package daemon provides the background service functionality for scanorama. It manages scheduled discovery and scanning jobs, handles API endpoints, and coordinates the overall operation of the scanning system.
Index ¶
Constants ¶
const ( DefaultDirPermissions = 0o750 DefaultFilePermissions = 0o600 )
File permission constants.
Variables ¶
This section is empty.
Functions ¶
func DropPrivileges ¶ added in v0.23.0
DropPrivileges drops root privileges to the given user and group when the process is running as root and both names are non-empty. It is safe to call when not root — it logs a notice and returns nil. The logf argument accepts a printf-style function so callers can plug in any logger.
Order matters: group must be changed before user because setuid discards the ability to call setgid afterwards.
WARNING: once privileges are dropped the process cannot reclaim them. Callers that need to invoke nmap with raw-socket access (SYN/OS-detection scans) must do so before calling this function.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon represents the main daemon process.
func (*Daemon) GetContext ¶
GetContext returns the daemon's context.
func (*Daemon) GetDatabase ¶
GetDatabase returns the database connection.
func (*Daemon) IsDebugMode ¶ added in v0.9.0
IsDebugMode returns the current debug mode state.