Repository navigation
fix(github_actions): accept cache-mode key and report schema-invalid workflows - #7787
Open
Varshith-Kali wants to merge 1 commit into
Open
Varshith-Kali wants to merge 1 commit into
Varshith-Kali wants to merge 1 commit into
Conversation
…workflows (bridgecrewio#7786) GitHub Actions added a cache-mode key at workflow and job level (read, write, write-only, none). The workflow schema did not know it, so a workflow declaring it failed is_schema_valid and was skipped silently: no checks ran, no error, no warning, exit code 0. Accept cache-mode at workflow level and on both job kinds via a shared schema definition, and report workflow files that fail to load as parsing errors in the report, so a future unknown key cannot quietly disable the scan for that file. Signed-off-by: Varshith Puli <pulivarshit@gmail.com>
Varshith-Kali
requested a deployment
to
scan-security
November 5, 2026 16:17 — with
GitHub Actions
Waiting
Author
|
Hi maintainers, the start-security-scan check on this PR is waiting on approval. Could someone approve the scan when you get a chance? Thanks! |
This branch is waiting to be deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #7786.
GitHub Actions added a
cache-modekey at workflow and job level (read,write,write-only,none), the recommended control against cache poisoning. Checkov's GitHub Actions schema did not know the key, so a workflow declaring it at the top level failedis_schema_validand was skipped silently: no checks ran, no error, no warning, and the scan still exited 0. Adopting the key quietly turned off everyCKV_GHA_*/CKV2_GHA_*check for that file.This PR:
cache-modeto the workflow schema and to both job kinds (normalJobandreusableWorkflowCallJob, which caps a reusable workflow's cache access), via a shared definition with the four documented values. An invalid value is rejected by the schema.--compact --quiet, and in JSON output asparsing_errors.Reproduction (checkov 3.4.3, the workflow from the issue):
cache-mode: read, no output at all, exit 0.cache-mode: read, 11 passed / 1 failed, exit 1. Same for job-level and both levels. Withcache-mode: bogus, the run reports 1 parsing error naming the file.Tests: 9 new schema-validation tests (all four values accepted at workflow and job level, invalid values rejected) and 2 new runner tests (cache-mode workflow scanned; bogus value reported as a parsing error).
pytest tests/github_actions/: 54 passed. flake8 clean on the changed files.