Repository navigation
Description
Problem: docs/CI.md (from #106) covers GitHub Actions and has one GitLab job that keeps a SARIF artifact. GitLab's merge-request security widget and Vulnerability Report do not read SARIF, and there is nothing for Bitbucket Pipelines, Azure Pipelines, Jenkins or CircleCI. Each of those has its own idea of pass/fail/warn, secrets, caching and artifacts, and a snippet that has never run is worse than none.
Goal: a copy-paste file for each major CI system that has actually been run once, with secfoo's exit codes mapped to that system's semantics, and findings in GitLab's own report format.
Build:
secfoo findings export --format gitlab-sast. Emit GitLab's SAST report JSON (schema v15:scan,vulnerabilities[]withid,category: sast,name,description,severity(Critical/High/Medium/Low/Info),location.file+start_line,identifiers(CWE, secfoo fingerprint)). Secret-scanning findings go to--format gitlab-secret-detection(same schema,category: secret_detection). Validate against the published schema in tests. The GitLab example switches toartifacts: reports: sast:so findings show in the MR widget.- Examples that ran. Under
examples/ci/:bitbucket-pipelines.yml(reports as a pipe or a Code Insights report),azure-pipelines.yml(publish SARIF as a build artifact; the SARIF SAST Scans Tab extension picks it up),Jenkinsfile(declarative;warnings-ngreads SARIF),circleci-config.yml(store artifacts, test summary). Each uses--agent apiwith the platform's secret store,--json --rescan --project-name, exports SARIF and JSONL, and maps exit1to failure,2to failure,3to a visible warning or failure as the platform allows. Record in each file's header the date and platform version it was run on. - Docker variant. Each example notes how to use the published container image instead of
pip install(image publishing is owned by the maintainers; keep the image nameghcr.io/rakfortltd/secfooas referenced in the README). - Platform matrix in
docs/CI.md: where findings appear, what the secret variable is called, how to cache~/.secfoo, and which exit codes the platform can distinguish.
Where to look: src/secfoo/cli.py (findings export, FindingsFormat), src/secfoo/report/sarif.py (the pattern to follow for a new serializer: pure function, no I/O, tested in tests/test_report/), examples/ci/, docs/CI.md.
Relation: builds on #106 and #46. The diff-aware scan and baseline issue adds flags these examples should pass through once merged.
Done when: gitlab-sast and gitlab-secret-detection exports validate against GitLab's schema in tests and render in a real GitLab MR (screenshot in the PR); each example file was run on its platform at least once (free tiers are enough) with the run link or screenshot in the PR; docs/CI.md matrix complete.
Activity
feat(export): add gitlab-sast and gitlab-secret-detection findings fo…