You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: expand Security Gates with CI/CD examples - #99
…D040)
Add blank lines around headings, lists and fences, and tag bare code fences with a language so the pre-commit CI passes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address Copilot review findings in the GitHub Actions and GitLab CI examples:
- remove TruffleHog base/head overrides; add contents/actions read permissions
- run Semgrep explicitly, write semgrep.json and fail closed when missing
- enforce zero-high policy for SCA and container gates (no silent >5 loophole)
- install locked deps before pip-licenses; note CodeQL is enforced via code-scanning rulesets
- fix Checkov output path, drop bogus evaluated_keys severity check, handle array/object reports
- summary job fails on cancelled/skipped, not only failure
- GitLab: clear TruffleHog entrypoint, use --fail instead of dumping raw secret JSON,
build image before scanning, drop native-JSON reports: declarations, check HIGH threshold,
apply shared rules to all gate-dependency jobs
- emergency bypass now relies on protected environments instead of a caller-supplied APPROVED_BY
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…e examples
- Kaniko: write /kaniko/.docker/config.json from CI_REGISTRY_* before pushing
- Trivy: pass TRIVY_USERNAME/TRIVY_PASSWORD so the private image can be pulled
- Bypass job: needs: [build-image] so it is a DAG job that can run when gates fail
- License gate: match GPL/AGPL native and SPDX names, exclude LGPL, share one filter
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The secrets job inherits only contents: read, but Gitleaks v2 calls the pull-request commits API before scanning. That endpoint requires pull-requests: read for private repositories, so private-repository PRs fail before the scan runs, even with no secrets present. Add that permission to this job while retaining checkout access.
The workflow runs TruffleHog from mutable @main, both Trivy scans from @master (lines 236 and 303), and Checkov from @master (line 342). Upstream branch changes can therefore replace code running against the repository without a reviewed workflow update, creating supply-chain risk in the security gates themselves. Pin these actions to vetted full commit SHAs, using the same Trivy pin for both scans.
Provide Gitleaks license for organization-owned repositories
Gitleaks Action v2 requires GITLEAKS_LICENSE for organization-owned repositories and exits before scanning when it is absent. This example supplies only the token, so organization users cannot run the pipeline even on clean commits. Document and supply the license secret, or use the standalone Gitleaks CLI instead.
…fault branch
- TruffleHog: capture --json output outside the workspace and print only count + detector names (plain printer also emits Raw result)
- Bypass job rule now requires CI_COMMIT_BRANCH == CI_DEFAULT_BRANCH so build-image always exists in the pipeline
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Gitleaks Action requires GITLEAKS_LICENSE for organization-owned repositories. Passing only GITHUB_TOKEN makes the action fail before scanning in those repositories. Document and pass the required repository or organization secret, or use the license-free Gitleaks CLI instead.
Mixed-case repository name breaks Docker image build
github.repository preserves capitalization, but Docker image repository names must be lowercase. A name such as org/DevSecOpsGuideline makes this build fail before scanning. Since the image is used only within this job, use the same fixed lowercase local name for the build and Trivy scan.
Thanks @Ali-Yazdani, done - closing this in favour of #111, which is a single clean commit on top of current master with the same content (plus the #110 edits folded in and scanner actions pinned).
Supersedes #99, rebased onto current master as a single commit.
Adds to 2-3-5-Security-Gates.md:
- Pipeline placement diagram and severity-threshold table
- Policy-as-code example (.security-gates.yaml) and gradual rollout guidance
- End-to-end GitHub Actions and GitLab CI gate pipelines (secrets, SAST, SCA,
container, IaC) with a single fail-closed summary gate
- Sample gate output, exceptions-as-code, and an auditable emergency bypass
- License gate with SPDX-aware matching
- Additional tools, KPIs and references
Keeps all V0.4 content and the edits from #110 (semgrep ci example, VEX link,
scanner-pinning pitfall, updated references). Third-party actions in the
examples are pinned to release tags.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
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.
Expand Security Gates documentation
Filled in the Security Gates stub (
current-version/2-Process/2-3-Build/2-3-5-Security-Gates.md) with practical content.What's added
Why
The original file was just a TBD stub. Security gates are a core DevSecOps concept and the guideline needed concrete examples teams can actually use.
Checklist
-for lists (MD004)