Skip to content

[RULE] Use pinned script dependencies #3324

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

Open
BernieWhite opened this issue Apr 11, 2025 · 0 comments
Open

[RULE] Use pinned script dependencies #3324

BernieWhite opened this issue Apr 11, 2025 · 0 comments
Labels
pillar: security Aligned to the Security pillar. rule: automation-account Rules for Automation Account rule: deployment Rule for Azure Resource Manager templates

Comments

@BernieWhite
Copy link
Collaborator

Existing rule

No response

Suggested rule

When pulling in external files that will be executed such as scripts a pinned URL should be used, to prevent the file at the end of the URL from being maliciously changed latter. (supply chain).

The URL must use a method that prevents the content from being changed. For example, a git branch or tag can be easily changed, and a git commit hash is considered unique (excluding collisions for the key space).

Separate rules should be created for:

  • Automation runbooks
  • Deployment scripts

Initially focus on https://raw.githubusercontent.com/.

For example:

This is not pinned: https://raw.githubusercontent.com/Azure/PSRule.Rules.Azure/refs/heads/main/scripts/pipeline-deps.ps1

This is pinned to a SHA commit hash: https://raw.githubusercontent.com/Azure/PSRule.Rules.Azure/8dc395b739a8be00571d039c0af9df88d85c1e2a/scripts/pipeline-deps.ps1

Pillar

Security

Additional context

No response

@BernieWhite BernieWhite added pillar: security Aligned to the Security pillar. rule The issue relates to a rule labels Apr 11, 2025
@BernieWhite BernieWhite added rule: deployment Rule for Azure Resource Manager templates rule: automation-account Rules for Automation Account and removed rule The issue relates to a rule labels May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pillar: security Aligned to the Security pillar. rule: automation-account Rules for Automation Account rule: deployment Rule for Azure Resource Manager templates
Projects
None yet
Development

No branches or pull requests

1 participant