Skip to content

fix: slim down the CrowdSec export, validate imports by parsing, and fix import UI text - #1542

Merged
Wikid82 merged 10 commits into
developmentfrom
fix/crowdsec-export-import-followups
Oct 10, 2026
Merged

Wikid82 merged 10 commits into
developmentfrom
fix/crowdsec-export-import-followups

Conversation

@Wikid82

@Wikid82 Wikid82 commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-ups to #1535 for the CrowdSec configuration export and import. Plan lived outside the repo for this batch.

Closes #1532, closes #1533, closes #1534

Intentional tightening

  • Duplicate keys and non-string keys in config.yaml are now rejected, and a merge key (<<:) at the top level is rejected too. This is stricter than CrowdSec's own loader.
  • A config containing only keys CrowdSec reads from outside the file (for example just disable_agent) is rejected.
  • The export still includes other saved settings; the docs say to treat it as private (tracked in chore: review which stored settings the CrowdSec export includes #1539).

Known limitations (tracked)

Testing

  • Backend coverage 91.2% statements / 90.2% lines; patch coverage 93.8%; go test -race on the crowdsec package and on the import/export/rollback handler tests; full golangci-lint config clean (backend and agent).
  • Frontend coverage 91.46% lines; type-check, lint, build pass.
  • E2E: the ten CrowdSec security specs pass under --project=security-tests (194 tests, no fixme).
  • A QA audit (docs/reports/qa_report.md) found no critical, high or medium issues; includes an alias-expansion probe of the new parser.
  • CodeQL and the image scan run in CI.

The export now contains configuration only, and importing an export from a
real install works again. Imports keep the running server's own connection
details and roll back without touching them.
Imported configuration is now parsed as YAML instead of being matched by text,
and any upload that is not a .tar.gz archive gets one clear message.
The import picker no longer suggests ZIP files, and the Check Now buttons use
the translation files in every supported language.
@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.

@github-actions

github-actions Bot commented Oct 10, 2026 •

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

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.67123% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/internal/api/handlers/crowdsec_handler.go 82.85% 18 Missing ⚠️

📢 Thoughts on this report? Let us know!

require_ci_to_pass was at the top level, which Codecov rejects, so the whole
file was ignored and default coverage targets were used.
Post codecov.yml to Codecov's validator so an invalid file (which Codecov
silently ignores wholesale) fails CI. Validation errors fail the check; an
unreachable validator only warns. Adds bats coverage with a stubbed curl.
@Wikid82
Wikid82 marked this pull request as ready for review October 10, 2026 14:01
@Wikid82
Wikid82 merged commit 504f64a into development Oct 10, 2026
48 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