Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4a3ff13
build(deps): bump github/codeql-action/init from 4.37.0 to 4.37.8
dependabot[bot] Aug 25, 2026
661afd3
test(codeql): require coordinated action versions
seonghobae Aug 26, 2026
9532f27
fix(codeql): keep action components aligned
seonghobae Aug 26, 2026
ffcc758
test(codeql): require coordinated SARIF uploader release
seonghobae Aug 26, 2026
b8c1d1d
fix(codeql): align Scorecard SARIF uploader release
seonghobae Aug 26, 2026
871ac35
fix(codeql): align Trivy SARIF uploader release
seonghobae Aug 26, 2026
d2b7097
test(dependabot): require existing CI/CD label
seonghobae Aug 26, 2026
9fc32ab
fix(dependabot): use existing CI/CD label
seonghobae Aug 26, 2026
481766c
fix(codeql): normalize contract import spacing
seonghobae Aug 26, 2026
19484ed
fix(codeql): normalize SARIF contract spacing
seonghobae Aug 26, 2026
2c8a453
style: normalize dependabot contract imports
seonghobae Aug 28, 2026
717d48a
Merge branch 'develop' into dependabot/github_actions/develop/github/…
seonghobae Aug 28, 2026
be5fd37
test(scorecard): reproduce missing PR code-scanning evidence
seonghobae Sep 1, 2026
4b9050d
fix(scorecard): emit SARIF for pull-request heads
seonghobae Sep 1, 2026
d50df53
fix(scorecard): restore default-branch publish guard
seonghobae Sep 1, 2026
e6ea024
test(scorecard): align PR publish guard contract
seonghobae Sep 1, 2026
046e221
test(trivy): add PR scan contract verifier
seonghobae Sep 1, 2026
06d93ae
test(trivy): preserve PR scan regressions
seonghobae Sep 1, 2026
0913edf
test(trivy): gate quickcheck on PR scan wiring
seonghobae Sep 1, 2026
c1f8ccb
fix(trivy): scan protected pull-request heads
seonghobae Sep 1, 2026
a3507bf
chore(codeql): drop Trivy regression from canonical lifecycle lane
seonghobae Sep 1, 2026
513f051
chore(codeql): remove duplicate Trivy verifier lane
seonghobae Sep 1, 2026
ef6f3b1
chore(codeql): restore Trivy ownership boundary
seonghobae Sep 1, 2026
c0d4ebc
chore(codeql): remove duplicate Trivy quickcheck wiring
seonghobae Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ updates:
open-pull-requests-limit: 10
labels:
- "dependencies"
- "github-actions"
- "area: ci-cd"
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- python
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
- uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
languages: ${{ matrix.language }}
- uses: github/codeql-action/autobuild@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
- uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
- uses: github/codeql-action/autobuild@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
- uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
14 changes: 9 additions & 5 deletions .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
Comment on lines +11 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Existing workflow contract test now fails

The existing push-only contract rejects pull_request: in Scorecard and Trivy. These additions make the Python gate fail.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


permissions: read-all

Expand All @@ -27,21 +31,21 @@ jobs:
with:
persist-credentials: false
- uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
if: github.event_name == 'pull_request' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
with:
results_file: results.sarif
results_format: sarif
publish_results: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
Comment thread
seonghobae marked this conversation as resolved.
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
if: github.event_name == 'pull_request' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
with:
name: ossf-scorecard-results
path: results.sarif
retention-days: 5
scorecard-sarif-upload:
name: scorecard-sarif-upload
needs: analysis
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
if: github.event_name == 'pull_request' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Forked pull requests fail Scorecard upload

Fork pull requests run scorecard-sarif-upload without the requested write permission. The SARIF upload fails, leaving external contributions with a failed workflow.

Prompt for agents
The scorecard-sarif-upload job now runs for every pull_request, including pull requests from forks. GitHub downgrades GITHUB_TOKEN permissions for fork-triggered pull_request workflows, so security-events: write is unavailable and github/codeql-action/upload-sarif cannot upload the result. Preserve Scorecard analysis or artifact generation for fork PRs if useful, but gate the SARIF upload path to trusted same-repository pull requests (for example by comparing the head repository to github.repository), or provide another non-failing path for forks. Update the workflow contract test to cover the fork condition.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

runs-on: ubuntu-latest
permissions:
actions: read
Expand All @@ -63,7 +67,7 @@ jobs:
with:
persist-credentials: false
path: trusted-scorecard-scripts
ref: ${{ github.ref_name }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.ref_name }}
Comment thread
seonghobae marked this conversation as resolved.
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ossf-scorecard-results
Expand All @@ -79,6 +83,6 @@ jobs:
python3 trusted-scorecard-scripts/scripts/checks/normalize_scorecard_sarif.py
scorecard-sarif/results.sarif
normalized-scorecard-results.sarif
- uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 peeled commit; SHA pinning retained as supply-chain attack mitigation.
- uses: github/codeql-action/upload-sarif@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8 peeled commit; SHA pinning retained as supply-chain attack mitigation.
with:
sarif_file: normalized-scorecard-results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
skip-dirs: 'services/analysis-engine/.venv'
trivyignores: ./.trivyignore
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0 peeled commit; SHA pinning retained as supply-chain attack mitigation.
uses: github/codeql-action/upload-sarif@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8 peeled commit; SHA pinning retained as supply-chain attack mitigation.
if: always()
with:
sarif_file: trivy-results.sarif
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Regression contract for coordinated CodeQL Action component upgrades."""

from __future__ import annotations

import re
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[3]
CODEQL_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "codeql.yml"
CODEQL_ACTION_PATTERN = re.compile(
r"github/codeql-action/(?:init|autobuild|analyze)@([0-9a-f]{40})\s+#\s+(v[0-9.]+)"
)


def test_codeql_job_uses_one_action_release() -> None:
"""Require init, autobuild, and analyze to use one reviewed CodeQL release."""
workflow = CODEQL_WORKFLOW.read_text(encoding="utf-8")
action_refs = CODEQL_ACTION_PATTERN.findall(workflow)

assert len(action_refs) == 3
assert len({sha for sha, _version in action_refs}) == 1
assert len({version for _sha, version in action_refs}) == 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Regression contracts for CodeQL SARIF uploader provenance comments."""

from __future__ import annotations

from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[3]
EXPECTED_SHA = "db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28"
EXPECTED_VERSION = "v4.37.8"
UPLOAD_SARIF_REF = (
f"github/codeql-action/upload-sarif@{EXPECTED_SHA} # {EXPECTED_VERSION} peeled commit;"
)
WORKFLOWS = (
REPO_ROOT / ".github" / "workflows" / "ossf-scorecard.yml",
REPO_ROOT / ".github" / "workflows" / "trivy.yml",
)


def test_upload_sarif_sha_and_version_comment_move_together() -> None:
"""Keep each immutable SARIF uploader pin paired with its reviewed release label."""
for workflow in WORKFLOWS:
contents = workflow.read_text(encoding="utf-8")
assert contents.count(UPLOAD_SARIF_REF) == 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Regression contract for Dependabot's configured repository labels."""

from __future__ import annotations

from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[3]
DEPENDABOT_CONFIG = REPO_ROOT / ".github" / "dependabot.yml"


def test_github_actions_updates_use_repository_ci_cd_taxonomy() -> None:
"""Keep GitHub Actions updates on an existing CI/CD taxonomy label."""
config = DEPENDABOT_CONFIG.read_text(encoding="utf-8")
github_actions = config.split('package-ecosystem: "github-actions"', maxsplit=1)[1]

assert '- "area: ci-cd"' in github_actions
assert '- "github-actions"' not in github_actions
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Regression contract for OpenSSF Scorecard evidence on pull-request heads."""

from __future__ import annotations

from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[3]
WORKFLOW = REPO_ROOT / ".github" / "workflows" / "ossf-scorecard.yml"
DEFAULT_BRANCH_GUARD = "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)"
PR_OR_DEFAULT_BRANCH = f"github.event_name == 'pull_request' || {DEFAULT_BRANCH_GUARD}"
Comment on lines +9 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Pull requests remain excluded

Pull-request refs cannot satisfy DEFAULT_BRANCH_GUARD. Removing the explicit event-name condition therefore preserves default-branch-only Scorecard publishing.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

PR_SAFE_TRUSTED_REF = (
"ref: ${{ github.event_name == 'pull_request' && "
"github.event.pull_request.base.sha || github.ref_name }}"
)


def test_scorecard_produces_pr_code_scanning_evidence_without_pr_publishing() -> None:
"""Keep PR SARIF coverage while publishing only trusted default-branch runs."""
contents = WORKFLOW.read_text(encoding="utf-8")

assert "pull_request_target:" not in contents
assert " pull_request:\n branches:\n - develop\n - main\n" in contents
assert contents.count(f"if: {PR_OR_DEFAULT_BRANCH}") == 3
publish_lines = [
line.strip()
for line in contents.splitlines()
if line.strip().startswith("publish_results:")
]
assert publish_lines == [f"publish_results: ${{{{ {DEFAULT_BRANCH_GUARD} }}}}"]
Comment on lines +24 to +29

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Publishing assertion covers every occurrence

The exact publish_lines comparison rejects duplicate or additional publishing settings. A matching fragment elsewhere can no longer satisfy the contract.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

assert PR_SAFE_TRUSTED_REF in contents
Loading