feat: integrate security scan CI workflow#668
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe publish workflow's build phase was refactored to separate concerns. The prior single "Build dependencies" step combining environment setup, dependency installation, and compilation was split into three discrete steps: "Install dependencies" runs environment bootstrap and package installation, a new "Security scan" step runs the InjectiveLabs security-scan action with a 5-minute timeout, and "Build" runs the pnpm build command. The remainder of the publish job logic remains unchanged. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/publish.yaml:
- Around line 197-199: The workflow step named "Security scan" currently pins
the external action to a mutable ref (`uses:
InjectiveLabs/github-fe/actions/security-scan@master`); replace that mutable ref
with an immutable commit SHA of the security-scan action (e.g., `uses:
InjectiveLabs/github-fe/actions/security-scan@<commit-sha>`) to prevent
supply-chain and reproducibility issues, by updating the `uses` value in the
publish YAML step for the "Security scan" action and committing the specific SHA
from the upstream repository; optionally add a comment or dependabot rule to
periodically refresh the pinned SHA.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cde8407a-ec6b-4f3e-9678-9cb97e834633
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (1)
.github/workflows/publish.yaml
| - name: Security scan | ||
| uses: InjectiveLabs/github-fe/actions/security-scan@master | ||
| timeout-minutes: 5 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd /tmp && git clone https://github.com/InjectiveLabs/injective-ts 2>/dev/null || true
cd /tmp/injective-ts 2>/dev/null || cd . && cat -n .github/workflows/publish.yaml | head -210Repository: InjectiveLabs/injective-ts
Length of output: 9348
🏁 Script executed:
cat -n .github/workflows/publish.yaml | grep -A 15 -B 15 "security-scan"Repository: InjectiveLabs/injective-ts
Length of output: 1196
🏁 Script executed:
head -50 .github/workflows/publish.yamlRepository: InjectiveLabs/injective-ts
Length of output: 1630
Pin the security-scan action to an immutable commit SHA.
Line 198 uses a mutable ref (@master) on an external action within a publish workflow that has contents: write and id-token: write permissions. This creates a supply-chain risk—the action code could change without notice, or the external repository could be compromised, allowing arbitrary code execution during package publishing and git operations. Additionally, this breaks reproducibility.
Suggested fix
- name: Security scan
- uses: InjectiveLabs/github-fe/actions/security-scan@master
+ uses: InjectiveLabs/github-fe/actions/security-scan@<commit_sha>
timeout-minutes: 5🤖 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/publish.yaml around lines 197 - 199, The workflow step
named "Security scan" currently pins the external action to a mutable ref
(`uses: InjectiveLabs/github-fe/actions/security-scan@master`); replace that
mutable ref with an immutable commit SHA of the security-scan action (e.g.,
`uses: InjectiveLabs/github-fe/actions/security-scan@<commit-sha>`) to prevent
supply-chain and reproducibility issues, by updating the `uses` value in the
publish YAML step for the "Security scan" action and committing the specific SHA
from the upstream repository; optionally add a comment or dependabot rule to
periodically refresh the pinned SHA.
c3fdf1c to
f25d81f
Compare
995f3ec
into
chore/add-alchemy-rpcs-to-ledger-trezor
Summary by CodeRabbit