Skip to content
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

Add permissions block and actions analysis #3927

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

aeisenberg
Copy link
Contributor

This change does two things. If it is complicated to review I will split up.

First, this ensures that all workflows have minimal permissions blocks. Second, this adds actions analysis.

A little bit of extra security hardening.

@Copilot Copilot bot review requested due to automatic review settings February 13, 2025 21:51
@aeisenberg aeisenberg requested a review from a team as a code owner February 13, 2025 21:51

Choose a reason for hiding this comment

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

PR Overview

This PR adds a new ESLint configuration file for the ql-vscode extension and updates several GitHub workflow files to include explicit permissions settings.

  • Introduces an ESLint config file with multiple environments and parser settings.
  • Updates several GitHub workflows to explicitly define minimal permissions for improved security and compliance.

Changes

File Description
extensions/ql-vscode/eslint.config.js New ESLint configuration providing rules, plugins, and settings for various file types and directories.
.github/workflows/codeql.yml Adds a matrix strategy for CodeQL analysis and updates language inputs.
.github/workflows/cli-test.yml Updates CLI test workflows to include required permissions.
.github/workflows/release.yml Modifies release workflows to include explicit permissions for build and release steps.
.github/workflows/main.yml Sets minimal permissions on the main workflow.
.github/workflows/label-issue.yml Adds permission for issues to be written for labeling.
.github/workflows/e2e-tests.yml Introduces explicit permissions in the e2e tests workflow.

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

Comments suppressed due to low confidence (1)

extensions/ql-vscode/eslint.config.js:5

  • There is an unintended trailing space in the '.tsx ' file extension, which could lead to file matching issues. Please remove the extra space.
files: [".js", ".ts", ".tsx "],

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

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

This change does two things. If it is complicated to review
I will split up.

First, this ensures that all workflows have minimal permissions
blocks. Second, this adds actions analysis.
@aeisenberg aeisenberg force-pushed the aeisenberg/add-permissions-actions branch from 323aa3e to acc46ce Compare February 13, 2025 22:32
Copy link
Member

@koesie10 koesie10 left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -17,6 +17,8 @@ jobs:
find-nightly:
Copy link
Member

Choose a reason for hiding this comment

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

Should we set permissions: {} on the top-level so any new jobs that are defined won't get permission by default? Alternatively, we could also set permissions: { contents: read } at the workflow-level and keep the permissions block on the report-failure job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

Comment on lines +19 to +20
permissions:
contents: read
Copy link
Member

Choose a reason for hiding this comment

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

Same here, should we set this as the workflow level?

@aeisenberg aeisenberg merged commit 93645de into main Feb 14, 2025
28 checks passed
@aeisenberg aeisenberg deleted the aeisenberg/add-permissions-actions branch February 14, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants