From 5d46642a4be456424bf02d328a2fda37857066ff Mon Sep 17 00:00:00 2001 From: navigator Date: Wed, 7 Oct 2026 17:53:51 +0000 Subject: [PATCH] ci: security scanning, with the findings read and justified Calls security-scan.yml of keel-linux/.github (gitleaks, bandit, semgrep, shellcheck on hosted runners, no secrets) on pull requests, pushes to keel/trixie and by hand. Not a required check. A scan of keel/trixie finds nothing for bandit, and in upstream's util/php-dictionary-gen, a maintainer tool the package does not install: semgrep's ifs-tampering (IFS=$'\n\t' strict mode), three useless cats and two shellcheck SC2046. Justified in .github/security-baseline. gitleaks finds 7 tokens in upstream's regression tests, which are attack payloads on purpose: the jwt.io sample JWT and made-up session and OAuth tokens. .github/gitleaks.toml allowlists tests/regression/tests/*.yaml by path. --- .github/gitleaks.toml | 12 ++++++++++++ .github/security-baseline | 8 ++++++++ .github/workflows/security.yml | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .github/gitleaks.toml create mode 100644 .github/security-baseline create mode 100644 .github/workflows/security.yml diff --git a/.github/gitleaks.toml b/.github/gitleaks.toml new file mode 100644 index 0000000..597c2b1 --- /dev/null +++ b/.github/gitleaks.toml @@ -0,0 +1,12 @@ +# gitleaks (keel-linux/.github, security-scan.yml): the default rules, less +# the upstream CRS regression tests, which are attack payloads on purpose and +# carry example tokens (the jwt.io sample JWT, made-up session and OAuth +# tokens). A new fixture is added here by path once it has been read. +[extend] +useDefault = true + +[[allowlists]] +description = "CRS regression test payloads, fake tokens on purpose" +paths = [ + '''^tests/regression/tests/.+\.yaml$''', +] diff --git a/.github/security-baseline b/.github/security-baseline new file mode 100644 index 0000000..b4e9ec5 --- /dev/null +++ b/.github/security-baseline @@ -0,0 +1,8 @@ +# Security scan baseline (keel-linux/.github, security-scan.yml): findings +# that were read and are not a risk, one per line, the fingerprint and why. +semgrep:bash.lang.best-practice.useless-cat.useless-cat:util/php-dictionary-gen/php-dictionary-creator.sh:7e62555e4944 style only: useless cat in a pipeline +semgrep:bash.lang.best-practice.useless-cat.useless-cat:util/php-dictionary-gen/php-dictionary-creator.sh:86547fbb70e6 style only: useless cat in a pipeline +semgrep:bash.lang.best-practice.useless-cat.useless-cat:util/php-dictionary-gen/php-dictionary-creator.sh:9acc3fca24d1 style only: useless cat in a pipeline +semgrep:bash.lang.security.ifs-tampering.ifs-tampering:util/php-dictionary-gen/php-dictionary-creator.sh:fdbe2dc66bc3 upstream maintainer tool, IFS=$'\n\t' is the usual strict mode, not attacker-controlled; not shipped in the package +shellcheck:SC2046:util/php-dictionary-gen/php-dictionary-creator.sh:aa779a9bbc62 shell lint, not a security risk: upstream maintainer tool, unquoted substitution over files it generates itself +shellcheck:SC2046:util/php-dictionary-gen/php-dictionary-creator.sh:ea41cfcd1687 shell lint, not a security risk: upstream maintainer tool, unquoted substitution over files it generates itself diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..b40ce41 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,19 @@ +# Security scanning (keel-linux/.github, profile/WORKFLOWS.md "Security +# scanning"): gitleaks, bandit, semgrep and shellcheck on GitHub-hosted +# runners, no secrets. Findings that are not a risk are listed, each with its +# justification, in .github/security-baseline; gitleaks fixtures, if any, in +# .github/gitleaks.toml. +name: security +on: + pull_request: + push: + branches: [keel/trixie] + workflow_dispatch: +permissions: + contents: read +jobs: + security: + uses: keel-linux/.github/.github/workflows/security-scan.yml@main + permissions: + contents: read + security-events: write