Skip to content

feat(security): protect sensitive values in CrowdSec exports - #1565

Merged
Wikid82 merged 12 commits into
developmentfrom
feat/crowdsec-export-redaction
Oct 11, 2026
Merged

Wikid82 merged 12 commits into
developmentfrom
feat/crowdsec-export-redaction

Conversation

@Wikid82

@Wikid82 Wikid82 commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Exported CrowdSec configurations no longer carry passwords, tokens or webhook addresses from notification files, and importing one keeps your current values. 12 ordered commits.

  • Export: notification settings are exported with their sensitive values blanked (names, types and plain settings stay readable). Anything that cannot be blanked safely is exported as an empty file, never as written. Stray non-YAML files in notification folders are left out.
  • Import: a blanked export fills in the current values for notifications that already exist with the same type, name and target. Anything else keeps its placeholder, and the import card shows one passive line listing the files that still need values (translated in de, en, es, fr, zh).
  • Docs: feature guide and troubleshooting entry, including the known limits.
  • Tooling: the pre-commit phase now lints staged markdown files (config relaxed for pre-existing prose; a repo-wide cleanup follows separately).

Verification

  • Backend coverage 91.5% statements / 90.5% lines; frontend 91.5% lines; patch coverage 96.5%.
  • Full golangci-lint clean; race tests on the crowdsec and handlers packages; go build, npm run build and type-check pass.
  • Property and fuzz tests over the rewriter (120 s fuzz run, about 536k executions, no failures); adversarial probes in QA.
  • Local CodeQL: Go 4 results (all pre-existing suppressions, none in this diff), JS 0. Trivy: no high/critical.
  • Targeted E2E (--project=security-tests): 93 passed, 0 skipped.
  • QA verdict PASS. Report: docs/reports/qa_report.md.

Issues

Closing keywords only take effect on merge to main, so these stay open until the promotion.

Closes #1551, #1546

Adds pending end-to-end cases for exports that blank notification values and for imports that keep the current ones, plus the inline note in the import card. All cases are skipped until the feature lands.
…rt check and the export

Add one shared selector for notification files, the notification folder resolver and the environment reference test, with table tests. Not yet used by the import check or the export.
Add the rewriter for CrowdSec notification files with golden, property and fuzz tests. Not yet called from the export or the import.
Exported CrowdSec notification settings now have their sensitive
values blanked, while names and structure stay intact so profiles keep
working. Files in the notification folders that CrowdSec does not read
are left out of the export, and a notification file that cannot be
read safely is exported empty instead of as written.
…rowdSec configuration

Importing a configuration whose notification files were blanked on export now fills the blanked
values from the files being replaced, when the notification has the same type and name and still
points at the same target. Files that cannot be filled keep their placeholders and the import
response lists them in needs_values.
The import card lists, as one passive inline line, the notification files that came back with blanked values (first 10 names, then a count). The export description now mentions that these values are blanked.
Enable the pending export and import cases and align them with the implemented behaviour: aliased files are listed and left as exported, anchored-but-unreferenced files merge normally, and a fresh host keeps the placeholders and lists the file.
Explain what is blanked in exported notification files, how importing keeps current values, and what to do when files still need values.
Notification settings kept outside the usual folder are now recognised when the type is quoted or not the first document. Export, merge and scan share one probe that checks every document of a file within the existing size and node limits.
Add a lefthook pre-commit markdownlint job (staged .md only, generated and ignored paths skipped), a make lint-markdown target, and a CONTRIBUTING note. Rename .markdownlint.json to .markdownlint.jsonc so the rules known to fire on older prose (MD001, MD013, MD025, MD036, MD040, MD060) can be switched off with a TODO until the repo-wide cleanup.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Supply Chain Verification Results

✅ PASSED

📦 SBOM Summary

  • Components: 1870

🔍 Vulnerability Scan

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 0
🟢 Low 0
Total 0

📎 Artifacts

  • SBOM (CycloneDX JSON) and Grype results available in workflow artifacts

Generated by Supply Chain Verification workflow • View Details

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@Wikid82
Wikid82 marked this pull request as ready for review October 11, 2026 20:32
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

@Wikid82
Wikid82 merged commit d680d46 into development Oct 11, 2026
49 checks passed
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