Add scan configuration: enable/disable categories, metrics, components - #1
Merged
Conversation
…nents Lets a scan switch off any part of the methodology (component, metric, or category) via a ScanConfig embedded in every report, so scores stay reproducible and auditable. Disabled items are excluded from scoring exactly like missing data, with remaining weights renormalized. CLI gains --config/--disable-category/--disable-metric/--disable-component; HTML reports render a "Scan configuration" section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ScanConfigthat lets a scan switch off any part of the scoring methodology — a single component, a whole metric, or a whole category — and embeds it in every report (configfield, schema0.7.0) so scores stay reproducible and auditable.notes distinguish "no data" from "disabled in scan configuration".--config <file.json>,--disable-category,--disable-metric,--disable-component METRIC:COMPONENT(flags merge on top of a config file). Unknown keys produce warnings (validate_config) instead of failing. Re-rendering a stored JSON report keeps its own embedded config and warns that config flags are ignored.docs/metrics.md(new Configuration section),docs/report-schema.md(schema version bump +configfield),README.md(usage examples).Why
Metrics/categories/components previously had no way to be selectively enabled/disabled per scan — this was needed to support running audits with a customized methodology (e.g. a certification profile that skips certain checks) while keeping the resulting score transparent about what was and wasn't measured.
Test plan
pytest— 112 passed (95 pre-existing + 17 new intests/test_config.py)securitycategory andpopularitymetric renormalizes correctly and lifts the overall score as expected; JSON round-tripsconfig; CLI--disable-componentbuilds config fromMETRIC:COMPONENTflags; re-rendering a stored JSON with stray--disable-*flags emits the ignore-note and keeps the original config🤖 Generated with Claude Code