fix: pin 2 unpinned action(s),extract 21 unsafe expression(s) to env vars#38893
Conversation
|
Bito Automatic Review Skipped - Files Excluded |
Sequence DiagramThis PR hardens the tag release GitHub Actions workflow by routing manual inputs and secret checks through environment variables before shell execution, ensuring that Docker image builds and releases use validated configuration and credentials. sequenceDiagram
participant Developer
participant GitHubActions
participant ConfigJob
participant ReleaseJob
participant Supersetbot
participant DockerRegistry
Developer->>GitHubActions: Trigger tag release workflow
GitHubActions->>ConfigJob: Run config job with secret check via env vars
ConfigJob-->>GitHubActions: Set has-secrets flag
GitHubActions->>ReleaseJob: Start docker release job when has-secrets is true
ReleaseJob->>ReleaseJob: Read workflow inputs from env vars and checkout ref
ReleaseJob->>Supersetbot: Invoke docker command with release and flags
Supersetbot->>DockerRegistry: Build and push tagged images
Generated by CodeAnt AI |
|
Let me know if you have any questions |
hainenber
left a comment
There was a problem hiding this comment.
Thank you @dagecko for this valuable contribution! This will surely strengthen the project's CI/CD security posture.
Re: previous PR you opened but closed due to branch issue, things might slipped under cracks for us Ops maintainers so anything on CI/CD, feel free to ping me for needful support.
For this PR, it's a LGTM!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #38893 +/- ##
==========================================
- Coverage 65.81% 64.56% -1.25%
==========================================
Files 1823 2536 +713
Lines 73182 130753 +57571
Branches 23451 30323 +6872
==========================================
+ Hits 48163 84426 +36263
- Misses 25019 44859 +19840
- Partials 0 1468 +1468
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks @hainenber, appreciate the approval and the offer. I'll definitely reach out if I come across anything else. Happy to help. Have a great day.
|
|
Hey, thanks again for merging this. I was doing some additional validation against the CodeQL envvar-injection-critical guidance (https://codeql.github.com/codeql-query-help/actions/actions-envvar-injection-critical/) and noticed
|
Mitigates shell/JS injection via user-controllable github.event.* fields used directly in run and script blocks. Inspired by the tj-actions supply-chain attack class. Follows the pattern established in apache#38893. Co-Authored-By: bot_apk <apk@cognition.ai>
User description
Security: Harden GitHub Actions workflows
Hey, I found some CI/CD security issues in this repo's GitHub Actions workflows. These are the same vulnerability classes that were exploited in the tj-actions/changed-files supply chain attack. I've been reviewing repos that are affected and submitting fixes where I can.
This PR applies mechanical fixes and flags anything else that needs a manual look. Happy to answer any questions.
Fixes applied
.github/workflows/bump-python-package.yml.github/workflows/embedded-sdk-release.yml.github/workflows/ephemeral-env-pr-close.yml.github/workflows/ephemeral-env-pr-close.yml.github/workflows/ephemeral-env.yml.github/workflows/generate-FOSSA-report.yml.github/workflows/release.yml.github/workflows/showtime-trigger.yml.github/workflows/superset-docs-deploy.yml.github/workflows/tag-release.yml.github/workflows/tech-debt.ymlAdditional findings (manual review recommended)
| Rule | Severity | File | Description |
| RGS-016 | critical |
.github/workflows/check_db_migration_confict.yml| Unicode Steganography in Workflow File || RGS-004 | high |
.github/workflows/claude.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/claude.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-003 | high |
.github/workflows/pre-commit.yml| Filename Injection via Git Diff or File Listing || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-012 | high |
.github/workflows/superset-docs-deploy.yml| Secret Exfiltration via Outbound HTTP Request || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/superset-docs-deploy.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/supersetbot.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/supersetbot.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/supersetbot.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-004 | high |
.github/workflows/supersetbot.yml| Comment-Triggered Workflow Without Author Authorization Check || RGS-005 | medium |
.github/workflows/claude.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/claude.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/ephemeral-env-pr-close.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/ephemeral-env.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/ephemeral-env.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/labeler.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/showtime-trigger.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/supersetbot.yml| Excessive Permissions on Untrusted Trigger || RGS-005 | medium |
.github/workflows/welcome-new-users.yml| Excessive Permissions on Untrusted Trigger |Why this matters
GitHub Actions workflows that use untrusted input in
run:blocks or reference unpinned third-party actions are vulnerable to code injection and supply chain attacks. These are the same vulnerability classes exploited in the tj-actions/changed-files incident which compromised CI secrets across thousands of repositories.How to verify
Review the diff, each change is mechanical and preserves workflow behavior:
${{ }}expressions fromrun:blocks intoenv:mappings, preventing shell injectionIf this PR is not welcome, just close it and I won't send another.
CodeAnt-AI Description
Harden GitHub Actions workflows that handle releases, docs, and ephemeral environments
What Changed
Impact
✅ Lower risk of secret exposure in CI✅ Safer release and deploy runs✅ Fewer unpinned workflow dependencies💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.