-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: R-16 toolchain pin + reconciliation #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
84e8f88
b9a56c1
257414d
49a4a2e
a45a0a3
c836ada
393b1ac
9d8a50d
d6c8721
bb5106b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,9 @@ on: | |
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| actions: read | ||
| contents: read | ||
|
|
||
| security-events: write | ||
| id-token: write | ||
|
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
file=".github/workflows/scorecard.yml"
# Verify that write permissions are nested under the intended Scorecard job,
# not under the top-level permissions block.
sed -n '1,180p' "$file"
rg -n -C 6 '^\s*permissions:|^\s*(security-events|id-token):|ossf/scorecard-action|publish_results|^\s*uses:' "$file"Repository: hyperpolymath/http-capability-gateway Length of output: 995 🌐 Web query:
💡 Result: The OSSF scorecard-action requires specific permission configurations to function correctly, particularly when publishing results or running in private repositories [1][2][3]. Key Permission Requirements: - security-events: write: This permission is required if you intend to upload results to the GitHub code-scanning dashboard [4][5][6]. - id-token: write: This permission is required when publish_results is set to true [1][2][3]. It allows the action to access GitHub's OIDC token to verify the authenticity of the results during publication [1][6]. Important Workflow Restrictions: - Workflow-level permissions: The workflow must not contain top-level write permissions [1][3]. Permissions should be defined at the job level [1][2]. - ID Token restriction: Only the job specifically running the OSSF scorecard-action should be granted id-token: write permissions [1][3]. - Global constraints: The workflow must not contain top-level environment variables or defaults [1][3]. Additional Notes: - For private repositories, it is recommended to add specific job-level read permissions (e.g., contents: read, issues: read, pull-requests: read, checks: read) to ensure the action can fully query the repository and avoid errors like Resource not accessible by integration [1][2][3]. - The requirement for security-events: write is a known aspect of the action's functionality and is necessary for integrating with security tools [7][8]. Users should configure these permissions at the job level rather than the workflow level to maintain security best practices [1][3]. Citations:
🌐 Web query:
💡 Result: When using GitHub Actions reusable workflows, the permissions for the GITHUB_TOKEN are governed by the following rules regarding inheritance and scoping [1][2]. 1. Permission Inheritance and Downgrading: The called workflow inherits the permissions defined in the caller workflow's job [1][2]. A called workflow can only have the same or more restrictive (downgraded) permissions than those provided by the caller [1][2]. It cannot elevate permissions beyond what the caller has granted [1][2]. 2. Default Behavior: If Citations:
Remove the workflow-level write permissions. The OSSF Scorecard workflow must not define top-level write permissions. Keep 🧰 Tools🪛 zizmor (1.29.0)[warning] 11-11: overly broad permissions (excessive-permissions): security-events: write is overly broad at the workflow level (excessive-permissions) [error] 12-12: overly broad permissions (excessive-permissions): id-token: write is overly broad at the workflow level (excessive-permissions) [warning] 11-11: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment (undocumented-permissions) 🤖 Prompt for AI AgentsSources: MCP tools, Linters/SAST tools |
||
| jobs: | ||
| scorecard: | ||
| uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@7fdc2705df74b4e352d2a1cde3e87a5923fdf329 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [tools] | ||
| elixir = "1.19.5-otp-28" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- .mise.toml ---'
cat -n .mise.toml
printf '%s\n' '--- mix.exs Elixir requirement ---'
rg -n -C 2 'elixir|Elixir' mix.exs
printf '%s\n' '--- Containerfile toolchain image ---'
cat -n Containerfile | sed -n '1,12p'Repository: hyperpolymath/http-capability-gateway Length of output: 1319 Align the container image with the new toolchain pin. Line 2 selects Elixir 🤖 Prompt for AI Agents |
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ LOW RISK
Suggestion: These permissions are redundant as they are already explicitly defined in the 'scorecard' job. It is safer to keep sensitive permissions scoped to the specific job that requires them rather than applying them to the entire workflow, adhering to the principle of least privilege.