Skip to content

Add Fix for insecure-commands audit rule - #1045

Merged
woodruffw merged 5 commits into
zizmorcore:mainfrom
mostafa:insecure-commands-fix
Jul 31, 2025
Merged

woodruffw merged 5 commits into
zizmorcore:mainfrom
mostafa:insecure-commands-fix

Conversation

@mostafa

@mostafa mostafa commented Jul 29, 2025 •

Copy link
Copy Markdown
Contributor

xref #876

@woodruffw woodruffw added enhancement New feature or request autofix Auto-fix functionality labels Jul 31, 2025
@woodruffw

Copy link
Copy Markdown
Member

Thanks @mostafa! I'm reviewing now.

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good to me, thanks @mostafa! Just some small nits.

One additional request: could we add a negative testcase for the "maybe present" scenario, i.e. to ensure we don't suggest a fix when we aren't sure whether ACTIONS_ALLOW_UNSECURE_COMMANDS is present?

Comment on lines +442 to +450
// Check that ACTIONS_ALLOW_UNSECURE_COMMANDS is removed
assert!(
!fixed_document
.source()
.contains("ACTIONS_ALLOW_UNSECURE_COMMANDS")
);

// Check that other environment variables are preserved
assert!(fixed_document.source().contains("OTHER_VAR: keep-me"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this an inline snapshot instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f3b276a.

@mostafa

mostafa commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

@woodruffw Thanks for the review! I'll have a look tonight.

@kusari-inspector

kusari-inspector Bot commented Jul 31, 2025 •

Copy link
Copy Markdown

Kusari Analysis Results

Analysis for commit: 35429ef, performed at: 2025-07-31T23:22:18Z

• @kusari-inspector rerun - Trigger a re-analysis of this PR

• @kusari-inspector feedback [your message] - Send feedback to our AI and team


Recommendation

✅ PROCEED with this Pull Request

Summary

✅ No Flagged Issues Detected

All values appear to be within acceptable risk parameters.

No pinned version dependency changes, code issues or exposed secrets detected!

Found this helpful? Give it a 👍 or 👎 reaction!

@mostafa

mostafa commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

@woodruffw Addressed your comments.

@kusari-inspector

Copy link
Copy Markdown

Kusari PR Analysis rerun based on - 35429ef performed at: 2025-07-31T23:22:18Z - link to updated analysis

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mostafa!

@woodruffw
woodruffw merged commit 0dcd6eb into zizmorcore:main Jul 31, 2025
@mostafa
mostafa deleted the insecure-commands-fix branch August 11, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix Auto-fix functionality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants