Skip to content

Feat/rules engine refactor - #753

Merged
frjcomp merged 5 commits into
mainfrom
feat/rules-engine-refactor
Oct 19, 2026
Merged

frjcomp merged 5 commits into
mainfrom
feat/rules-engine-refactor

Conversation

@frjcomp

@frjcomp frjcomp commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 07:10
Embed built-in rules, preserve local overrides, and make external rule downloads explicit. Standardize verified confidence labels and suppress unverified TruffleHog results when verification is enabled. Update UI, documentation, and regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Cross-engine behavior changes need human validation, with unresolved filtering performance and dashboard compatibility issues.

2 open issues
What changed in this PR

Refactors Pipeleek’s rules engine to use embedded defaults and optional local rules, while standardizing detection levels.

Changes:

  • Adds explicit rules downloads, validation, and local overrides.
  • Migrates confidence levels and updates reporting, UI, and documentation.
  • Adds GitLab job-status and pipeline-source filters with tests.
File Description
tests/​e2e/​rules/​download_test.go Tests download command behavior.
tests/​e2e/​gitlab/​scan/​scan_flags_test.go Tests filtering and configuration precedence.
tests/​e2e/​gitlab/​scan/​errors_test.go Tests inaccessible-resource handling.
tests/​e2e/​github/​scan/​local_rules_test.go Tests local rules and detection levels.
pkg/​webui/​server.go Updates confidence displays and notifications.
pkg/​webui/​server_test.go Tests migrated UI and export levels.
pkg/​scanner/​scanner.go Removes automatic-download alias.
pkg/​scanner/​scanner_test.go Updates exported-function checks.
pkg/​scanner/​rules/​rules.yaml Defines embedded GitLab patterns.
pkg/​scanner/​rules/​rules.go Compiles and merges rules.
pkg/​scanner/​rules/​rules_test.go Tests loading, overrides, and boundaries.
pkg/​scanner/​rules/​download.go Implements validated explicit downloads.
pkg/​scanner/​rules/​download_test.go Tests download safety and failures.
pkg/​scanner/​engine/​reporting_test.go Tests verification and confidence filtering.
pkg/​scanner/​engine/​engine.go Centralizes filtering and TruffleHog reporting.
pkg/​scanner/​engine/​engine_test.go Updates confidence expectations.
pkg/​scanner/​engine/​betterleaks.go Migrates verified-result mapping.
pkg/​scanner/​detectors/​gitlab_url_detector.go Reuses embedded token patterns.
pkg/​scanner/​detectors/​gitlab_patterns_test.go Tests shared token matching.
pkg/​scan/​result/​levels_test.go Tests logged detection metadata.
pkg/​gitlab/​scan/​pipeline.go Applies job and pipeline filters.
pkg/​gitlab/​scan/​pipeline_test.go Tests pagination and filtered queues.
pkg/​gitlab/​scan/​pipeline_source.go Validates pipeline sources.
pkg/​gitlab/​scan/​pipeline_source_test.go Tests source parsing.
pkg/​gitlab/​scan/​job_status.go Parses job-status lists.
pkg/​gitlab/​scan/​job_status_test.go Tests status parsing.
pkg/​config/​gen/​gen.go Includes rules-download configuration.
internal/​cmd/​rules/​rules.go Adds rules-download command.
internal/​cmd/​rules/​rules_test.go Tests command wiring.
internal/​cmd/​root.go Registers rules commands.
internal/​cmd/​gitlab/​scan/​scan.go Binds filters and local options.
internal/​cmd/​gitlab/​scan/​scan_test.go Tests configuration and timeout parsing.
docs/​introduction/​secrets_verification.md Documents rules and confidence migration.
docs/​introduction/​configuration.md Documents new configuration options.
docs/​guides/​scanning.md Updates detection guidance.
docs/​guides/​gitlab.md Documents GitLab scan filters.

Review effort: Balanced

Comment thread pkg/scanner/engine/betterleaks.go
Comment thread pkg/scanner/engine/engine.go Outdated
@frjcomp
frjcomp force-pushed the feat/rules-engine-refactor branch from 47badee to 9bbb412 Compare October 19, 2026 07:19
frjcomp and others added 3 commits October 19, 2026 08:27
Report merged GitLab CI configuration findings as cicd-yaml and link to the CI YAML file. Add the source type to the web UI and regression tests. Consolidate rules documentation and update ELK verified-confidence queries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip excluded YAML patterns before scanning while preserving final cross-engine filtering. Make scan E2E tests independent of legacy downloaded rules and provider verification. Check host Renovate prerequisites and surface launch failures. Simplify verification documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Annotate the CI YAML source label and fixed local rules-file read. Print gosec finding details before failing the CI check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Cross-engine detection changes need human validation and passing cross-platform checks, with correctness issues still unresolved.

2 open issues
2 resolved since last review

Review effort: Balanced

Comment thread pkg/gitlab/scan/pipeline.go Outdated
Comment thread pkg/scanner/rules/rules.go Outdated
Comment thread docs/guides/gitlab.md
Comment thread docs/guides/scanning.md Outdated
Comment thread docs/introduction/configuration.md Outdated
Comment thread docs/introduction/configuration.md Outdated
Comment thread examples/compose-elk/setup-kibana.sh
Comment thread pkg/scanner/rules/download.go Outdated
Comment thread pkg/scanner/rules/download.go
Comment thread pkg/scanner/rules/rules.go
Comment thread pkg/scanner/rules/rules.go
Comment thread pkg/scanner/rules/rules.yaml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cross-engine detection and confidence migration needs regression validation and final human review.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@frjcomp
frjcomp merged commit 83b449d into main Oct 19, 2026
14 checks passed
@frjcomp
frjcomp deleted the feat/rules-engine-refactor branch October 19, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants