Trustabl Agent scanner - #301
Conversation
📝 WalkthroughWalkthroughThe pull request adds a ChangesTrustabl CI integration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/trustabl.yml:
- Line 16: Update the actions/checkout@v4 step in the workflow to set
persist-credentials to false, while leaving the existing Trustabl use of
github.token for SARIF uploads unchanged.
- Line 17: Update the Trustabl workflow step using trustabl/trustabl-action so
the action reference is pinned to a reviewed full commit SHA instead of the
moving v0 tag, and configure the action with an explicit approved Trustabl CLI
scanner release rather than its latest default. Preserve the existing workflow
permissions and behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6742cf2f-533e-413e-ac50-0e017ef85fcb
📒 Files selected for processing (1)
.github/workflows/trustabl.yml
| scan: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== workflow around checkout =="
sed -n '1,80p' .github/workflows/trustabl.yml | cat -n
echo
echo "== all actions in workflow =="
grep -nE '^\\s*('-+|uses:|persist-credentials:|github.token|permissions:)' .github/workflows/trustabl.yml || trueRepository: zvadaadam/deus-machine
Length of output: 666
🌐 Web query:
actions/checkout v4 persist-credentials default true README
💡 Result:
In actions/checkout v4, the persist-credentials input defaults to true [1][2]. When set to true, the action configures the local git repository with the authentication token or SSH key used for the checkout [3][4]. This allows subsequent steps in your workflow to run authenticated git commands (e.g., git push or git pull) without needing to manually configure credentials [3][5]. The token is removed during the post-job cleanup phase [3][4]. To opt-out of this behavior and prevent the credentials from being added to the local git config, you must explicitly set persist-credentials to false in your workflow file [3][5]: - uses: actions/checkout@v4 with: persist-credentials: false While the default remains true in v4 [1][2], discussions within the project have noted security considerations regarding this default, leading some users to prefer disabling it when authenticated git operations are not required by downstream steps [6].
Citations:
- 1: https://github.com/actions/checkout/blob/v4/action.yml
- 2: https://github.com/actions/checkout/blob/v4.1.1/action.yml
- 3: https://github.com/actions/checkout/blob/v4/README.md
- 4: https://github.com/actions/checkout/tree/v4.3.1
- 5: https://github.com/actions/checkout/blob/85e6279cec87321a52edac9c87bce653a07cf6c2/README.md
- 6: [security] Escalate concerning default
persist-credentials=trueplease actions/checkout#2312
Disable checkout credential persistence.
actions/checkout@v4 persists the checkout token only when needed for authenticated Git operations. Set persist-credentials: false on checkout to avoid leaving the token in repo config for the Trustabl step. Trustabl can still use ${{ github.token }} for SARIF uploads.
Proposed fix
- uses: actions/checkout@v4
+ with:
+ persist-credentials: false📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false |
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 16-16: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/trustabl.yml at line 16, Update the actions/checkout@v4
step in the workflow to set persist-credentials to false, while leaving the
existing Trustabl use of github.token for SARIF uploads unchanged.
Source: Linters/SAST tools
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: trustabl/trustabl-action@v0 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== workflow excerpt =="
if [ -f .github/workflows/trustabl.yml ]; then
cat -n .github/workflows/trustabl.yml
else
echo ".github/workflows/trustabl.yml not found"
fi
echo
echo "== git status/stat =="
git status --short
git diff --stat || true
echo
echo "== search for trustabl usage =="
rg -n "trustabl/trustabl-action|trustabl-action|security-events|pull-requests" .github/workflows || trueRepository: zvadaadam/deus-machine
Length of output: 821
🌐 Web query:
trustabl/trustabl-action README uses version: latest security-events write pull-requests write
💡 Result:
The trustabl/trustabl-action GitHub Action requires specific repository permissions to enable its automated reporting features [1]. In the action's workflow configuration, the permissions are defined as follows: permissions: contents: read security-events: write # Enables uploading SARIF reports to the Security tab pull-requests: write # Enables adding a sticky comment to the Pull Request These permissions serve the following purposes: - security-events: write: This allows the action to upload scan results in the SARIF format to the repository's GitHub Code Scanning "Security" tab, which also enables inline PR alerts [1][2]. - pull-requests: write: This allows the action to post a sticky summary comment on a pull request, providing human-readable feedback on the findings [1]. If these permissions are omitted, the action degrades gracefully: it will still perform the scan and provide feedback via the job's Step Summary and inline annotations, but it will skip the automated security tab upload and the sticky PR comment [1]. On fork pull requests, where tokens are restricted to read-only access by default, these write actions are skipped automatically [1]. Regarding the use of version: latest in the README example: while often seen in configuration snippets, it is generally recommended to use a specific version tag (e.g., v0.5.0) for reproducible CI pipelines to prevent unexpected changes in behavior between runs [1].
Citations:
- 1: https://claudeers.com/trustabl-action
- 2: https://github.com/trustabl/trustabl/blob/main/README.md
🌐 Web query:
trustabl/trustabl-action v0 README uses version: latest security-events write pull-requests write
💡 Result:
The permissions security-events: write and pull-requests: write in the trustabl/trustabl-action workflow are required to enable specific features of the GitHub Action [1]: * security-events: write: This permission is necessary for the action to upload SARIF (Static Analysis Results Interchange Format) files to the repository's Security tab, enabling GitHub's code scanning features [1][2][3]. * pull-requests: write: This permission is required for the action to post a sticky summary comment on pull requests and to provide inline annotations for findings directly within the pull request interface [1]. It is standard practice for GitHub Actions that perform security analysis and interact with pull requests to require these write permissions to function as intended [4][3][5]. The trustabl/trustabl-action documentation recommends these settings to ensure the action can fully surface scan results where developers work [1].
Citations:
- 1: https://claudeers.com/trustabl-action
- 2: https://github.com/trustabl/trustabl/blob/main/README.md
- 3: https://github.com/JacobPEvans/claude-code-plugins/blob/main/codeql-resolver/skills/codeql-permission-classification/SKILL.md
- 4: Updates the permissions block to be minimal github/codeql-action#689
- 5: github/codeql-action@dba4f66
🌐 Web query:
github trustabl/trustabl-action defaults version latest action.yml
💡 Result:
For the trustabl/trustabl-action, the default value for the version input is latest [1][2]. This version input determines which release tag of the trustabl CLI is downloaded and executed by the action. While latest is the default, users are encouraged to pin a specific release version (e.g., v0.5.0) in their workflow configuration to ensure reproducible CI runs [1][2].
Citations:
🌐 Web query:
github trustabl/trustabl-action action.yml version input default latest
💡 Result:
In the trustabl/trustabl-action GitHub Action, the version input has a default value of latest [1][2]. This input specifies the trustabl release tag to run, such as v0.5.0, or can be set to latest to automatically use the most recent release [1][2].
Citations:
Pin the Trustabl action and scanner release.
trustabl/trustabl-action@v0 is a moving major tag, and the action defaults the scanner version to latest. When this workflow runs, the moving action code executes with security-events: write and pull-requests: write; pin the action to a reviewed full commit SHA and set an explicit approved Trustabl CLI release.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/trustabl.yml at line 17, Update the Trustabl workflow step
using trustabl/trustabl-action so the action reference is pinned to a reviewed
full commit SHA instead of the moving v0 tag, and configure the action with an
explicit approved Trustabl CLI scanner release rather than its latest default.
Preserve the existing workflow permissions and behavior.
We came across your repo and we like how you enable developers to access AI coding agents from various devices, making development more accessible and flexible. We scanned the repo, and noticed agent runtime reliability findings that might be worth reviewing.
File: packages/device-use/skills/device-use/SKILL.md
What it means: This skill's body references an external http(s) URL. This can introduce security vulnerabilities by allowing malicious code execution or data leakage.
Recommendations are based on our understanding of agent runtime reliability, some findings may be intentional. Please let us know if this was intentional or if our findings are helpful so we can improve the accuracy of the scanner.
Best,
Trustabl.ai
Open-source AI agent reliability scanner (runs locally, GitHub Action)
Summary by CodeRabbit