-
Notifications
You must be signed in to change notification settings - Fork 103
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
Use zizmor to scan for GHA security problems #320
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cf6d774
apply GHA security improvements suggested by zizmor
dfremont 8b2ec7c
run zizmor in CI
dfremont f46654e
Update GH_REF reference in check_simulator_version_updates job
lola831 88a6718
Fix attempt to resolve GH_REF issue in git clone command
lola831 16f2ae2
Next attempt to fix GH_REF handling in git clone command
lola831 c64ecaf
Next attempt to fix GH_REF handling in git clone command
lola831 b16bf1e
Pass GH_REF environment variable to SSH session using SendEnv
lola831 05fdf64
Pass GH_REF as LC_GH_REF for SSH session
lola831 385ff50
Use export to set LC_GH_REF for SSH
lola831 27538d8
Remove debugging echo statements
lola831 ea2f451
Refactor to pass GH_REF directly via SSH
lola831 45f2e32
Export GH_REF to ensure it's passed to SSH session
lola831 cccd942
Fix export GH_REF
lola831 79dd756
Rename env variable from GH_REF to GH_WORKFLOW_REF
lola831 b6eb5df
Test: Apply changes to SSH config and verify
lola831 457b434
Add export for GH_REF to pass via SSH
lola831 a7177b8
Update run-simulators.yml
lola831 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,12 +88,13 @@ jobs: | |
HOSTNAME: ${{ secrets.SSH_HOST }} | ||
USER_NAME: ${{ secrets.SSH_USERNAME }} | ||
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
GH_REF: ${{ github.ref }} | ||
run: | | ||
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | ||
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} ' | ||
ssh -o StrictHostKeyChecking=no -o SendEnv=GH_REF -i private_key ${USER_NAME}@${HOSTNAME} ' | ||
cd /home/ubuntu/actions/ && | ||
rm -rf Scenic && | ||
git clone --branch $(basename "${{ github.ref }}") --single-branch https://[email protected]/BerkeleyLearnVerify/Scenic.git && | ||
git clone --branch $(basename "$GH_REF") --single-branch https://[email protected]/BerkeleyLearnVerify/Scenic.git && | ||
cd Scenic && | ||
python3 -m venv venv && | ||
source venv/bin/activate && | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: GitHub Actions Security Analysis with zizmor 🌈 | ||
# https://woodruffw.github.io/zizmor | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["**"] | ||
|
||
jobs: | ||
zizmor: | ||
name: zizmor latest via PyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
security-events: write | ||
# required for workflows in private repositories | ||
contents: read | ||
actions: read | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v4 | ||
|
||
- name: Run zizmor 🌈 | ||
run: uvx zizmor --format sarif . > results.sarif | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: results.sarif | ||
category: zizmor |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Changed the method for passing the environment variable into SSH by using SendEnv. I manually ran the run-simulators GitHub workflow action, and it worked as expected.