Skip to content

Conversation

yoff
Copy link
Contributor

@yoff yoff commented Mar 31, 2025

Use this to suggest minimal set of needed permissions.

For review: Do the permissions depend on the version of the actions? Currently, the version is stripped before the permissions are looked up.

Use this to suggest minimal set of nedded permissions
@Copilot Copilot AI review requested due to automatic review settings March 31, 2025 14:50
@yoff yoff requested a review from a team as a code owner March 31, 2025 14:50
@github-actions github-actions bot added the Actions Analysis of GitHub Actions label Mar 31, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new MaD model to specify the minimal permissions required for actions, supporting the permission lookup for CodeQL queries.

  • Added a new test workflow (perms6.yml) for a CWE-275 scenario.
  • Created a configuration file (actions_permissions.yml) listing required permissions for various actions along with TODO comments for pending additions.

Reviewed Changes

Copilot reviewed 2 out of 8 changed files in this pull request and generated no comments.

File Description
actions/ql/test/query-tests/Security/CWE-275/.github/workflows/perms6.yml Introduces a new workflow to test permission configuration.
actions/ql/lib/ext/config/actions_permissions.yml Defines a new data model for action permissions with minimal required scopes.
Files not reviewed (6)
  • actions/ql/lib/codeql/actions/Ast.qll: Language not supported
  • actions/ql/lib/codeql/actions/ast/internal/Ast.qll: Language not supported
  • actions/ql/lib/codeql/actions/config/Config.qll: Language not supported
  • actions/ql/lib/codeql/actions/config/ConfigExtensions.qll: Language not supported
  • actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql: Language not supported
  • actions/ql/test/query-tests/Security/CWE-275/MissingActionsPermissions.expected: Language not supported

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@yoff yoff changed the title ruby: add MaD model for permissions needed by actions actions: add MaD model for permissions needed by actions Mar 31, 2025
Copy link
Collaborator

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Nice work. I like how it's come together and the simple strategy of including the recommendation in the alert message. Minor suggestions only.

Before merging, let's test internally how well autofix does with the new information in the alert message.

@yoff yoff requested a review from adityasharad April 1, 2025 15:11
adityasharad
adityasharad previously approved these changes Apr 1, 2025
Copy link
Collaborator

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Overall looks good. Comment suggestions only.

@adityasharad
Copy link
Collaborator

Ah forgot to mention - change note in the query pack please. Something like "Alerts produced by the query actions/missing-workflow-permission now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file."

Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
@adityasharad adityasharad merged commit d31896b into github:main Apr 2, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Analysis of GitHub Actions documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants