Repository navigation
Conversation
Pin DependencyCheck to 13.0.0 instead of reading the unmaintained current.txt feed (stuck at 12.1.0), authenticate OSS Index with the Guide token as the password only, set --ossIndexRemoteErrorWarnOnly, read secrets from the environment, and make the failure print step actually run on failure.
This branch has not been 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.
Issue #, if available:
Description of changes:
Context (preventive)
The daily scan in this repo is currently green, but only because the OSS Index analyzer has had nothing to look up in recent runs, so the legacy credentials are not proven to work. The sibling ADOT repos running the same step (Python, JS, .NET) fail on every run with exit code 14 for the reasons below (example run in the Python repo). This applies the same change here for consistency, before it starts failing.
Why
Failed to request component-reports).--failOnCVSSis evaluated, so the scan aborts without ever reporting on CVEs. The step is red because of tooling, not because of a finding.jeremylong.github.io/DependencyCheck/current.txt, which is no longer maintained and still returns 12.1.0.What changed
In
.github/workflows/daily-scan.yml:VERSION=13.0.0instead of readingcurrent.txt. 13.0.0 defaults the OSS Index URL to the Guide API and is signed with the same GPG key the step already imports.--ossIndexPassword, and drop--ossIndexUsername.--ossIndexRemoteErrorWarnOnly true.${{ env.X }}interpolation into the script.Print dependency scan results on failure: a step-levelifwithout a status function carries an implicitsuccess(), so the step was skipped on exactly the failures it exists to report. It is nowalways() && steps.dep_scan.outcome != 'success', and usescatinstead ofless(no pager in CI).execute_and_retry; the command string keeps that layout, with the explanation moved to a comment above the step since the single-quoted command cannot hold comments. Env vars are expanded when the actionevals the command.All other flags (suppression file, scan target,
--failOnCVSS, etc.) are unchanged. The secret fetch step already flattens that secret into env vars, so no change is needed there.Why no
--ossIndexUsernameIt is deprecated for Guide tokens and is not just redundant: DependencyCheck builds basic auth as
base64(username:password), so a non-empty username sendsuser:tokeninstead of the:tokenform the Guide token scheme expects. Upstream docs describe the username as optional when using a Guide token.Why warn-only
Without it, any remote OSS Index failure (rate limiting, server errors, timeouts) throws an
AnalysisExceptionand produces the same abort-before-the-CVSS-gate exit 14. With it, such failures are logged as warnings and only the OSS Index enrichment degrades; NVD findings still fail the build. A missing or malformed token does not silently pass either: the analyzer logs that it is disabled due to missing credentials.This mirrors aws/aws-xray-daemon#300, which is merged and whose dependency scan step is green with the same change (recent run).
The
org.owasp.dependencycheckGradle plugin applied inotelagentis not invoked by this workflow and is not touched.Testing
actionlintlocally (no new findings).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.