pub struct Config {
pub scanner: ScannerConfig,
pub database: DatabaseConfig,
pub output: OutputConfig,
pub performance: PerformanceConfig,
pub analysis: AnalysisRulesConfig,
pub detectors: DetectorOptions,
pub server: ServerConfig,
pub runs: RunsConfig,
pub profiles: HashMap<String, ScanProfile>,
pub framework_ctx: Option<FrameworkContext>,
}Expand description
Top-level scanner configuration.
Loaded from nyx.conf (TOML) via Config::load, or constructed in
code for embedded use. Config::default gives conservative defaults:
no symlink following, no hidden files, gitignore respected, 10 s parse
timeout, all analysis passes on.
Config sections mirror nyx.conf sections:
scanner: what files to scan, which analysis passes to enable, severity flooroutput: format, ranking, LOW-finding budgetsanalysis: per-language rules, engine-pass togglesperformance: thread count, depth limit, batch sizedatabase: incremental index settingsdetectors: per-detector sensitivity knobs
Fields§
§scanner: ScannerConfig§database: DatabaseConfig§output: OutputConfig§performance: PerformanceConfig§analysis: AnalysisRulesConfig§detectors: DetectorOptionsPer-detector knobs ([detectors.*] in nyx.conf). Currently exposes
[detectors.data_exfil] for cross-boundary leak suppression.
server: ServerConfig§runs: RunsConfig§profiles: HashMap<String, ScanProfile>§framework_ctx: Option<FrameworkContext>Detected frameworks for the current project, set by the scan pipeline, not persisted to config files.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(config_dir: &Path) -> NyxResult<(Self, Option<String>)>
pub fn load(config_dir: &Path) -> NyxResult<(Self, Option<String>)>
Load config and return (config, optional_note).
The note is a formatted status message about which config file was loaded (or that defaults are in use). The caller decides whether to print it based on output format / quiet mode.
Sourcepub fn resolve_profile(&self, name: &str) -> Option<ScanProfile>
pub fn resolve_profile(&self, name: &str) -> Option<ScanProfile>
Resolve a profile by name: user-defined profiles take precedence over built-ins.
Sourcepub fn apply_profile(&mut self, name: &str) -> NyxResult<()>
pub fn apply_profile(&mut self, name: &str) -> NyxResult<()>
Apply a named profile, overlaying its Some fields onto this config.
Returns an error if the profile is not found.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more