GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Declare permissions by jsoref · Pull Request #15493 · github/codeql

Conversation

@jsoref

@jsoref jsoref commented Jan 31, 2024

Copy link
Copy Markdown
Contributor

Repositories can be configured with Default access (restricted) https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

Best practice says that workflows should declare the minimal permissions they require. Without declaring permissions, paranoid forks fail miserably.

closes #15462

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jsoref
jsoref requested review from a team as code owners January 31, 2024 14:00
@github-actions github-actions Bot added C# QL-for-QL labels Jan 31, 2024
@jsoref

jsoref commented Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

To make the Check change note workflow happy, please add label:no-change-note-required

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

angelapwen
angelapwen previously approved these changes Jan 31, 2024
View reviewed changes

@angelapwen angelapwen left a comment

Copy link
Copy Markdown
Contributor

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.

I looked at your fork of the repo, which has identical permissions and works 👍 thank you for the contribution!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread csharp/actions/create-extractor-pack/action.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@angelapwen angelapwen added the no-change-note-required This PR does not need a change note label Jan 31, 2024
@jsoref
jsoref dismissed angelapwen’s stale review via c5a047d January 31, 2024 14:09
@jsoref
jsoref force-pushed the declare-permissions branch from b997f22 to c5a047d Compare January 31, 2024 14:09
@github-actions github-actions Bot removed the C# label Jan 31, 2024
angelapwen
angelapwen approved these changes Jan 31, 2024
View reviewed changes
angelapwen
angelapwen reviewed Feb 1, 2024
View reviewed changes
Comment thread .github/workflows/check-implicit-this.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

angelapwen
angelapwen reviewed Feb 1, 2024
View reviewed changes
Comment thread .github/workflows/labeler.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

angelapwen
angelapwen suggested changes Feb 1, 2024
View reviewed changes

@angelapwen angelapwen left a comment

Copy link
Copy Markdown
Contributor

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.

Blocking merge until the other comments are addressed 😄

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jsoref
jsoref force-pushed the declare-permissions branch from 9da590e to 301cfcc Compare February 1, 2024 15:39
@jsoref
jsoref requested a review from angelapwen February 4, 2024 16:21
aeisenberg
aeisenberg requested changes Feb 6, 2024
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

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.

Thanks for contributing this. I like that this narrows the permissions of all of our tokens.

I think .github/workflows/csv-coverage-update.yml is broken. I have a few other suggestions that will allow you to narrow the permissions. security-events is only required if we are reading or writing SARIF to or from code scanning.

I do have a concern that these jobs haven't been run. Are you able to trigger them in your fork to make sure all permissions are correct?

What we do in other repos and can do here (but best to wait for a followup PR) is to add a chunk that ensures the workflow file is run whenever the workflow file itself is modified.

eg-

  pull_request:
    paths:
      - '.github/workflows/csv-coverage-timeseries.yml'

(and similar for all other workflow files)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/csv-coverage-update.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/ql-for-ql-tests.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/query-list.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/ruby-dataset-measure.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/ruby-qltest.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/swift.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/validate-change-notes.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jsoref

jsoref commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

@aeisenberg: the design of these workflows is really painful.

  • Many of them run only on specific branches.
  • Many of them only run if specific files change.
  • Many of them really really only work if run from a PR. -- I tried to add workflow_dispatch to test things and things exploded spectacularly: https://github.com/check-spelling-sandbox/codeql/actions/runs/7818256643/job/21328047264
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jsoref
jsoref force-pushed the declare-permissions branch from 301cfcc to 0f2888b Compare February 12, 2024 22:30
jsoref
jsoref commented Feb 12, 2024
View reviewed changes
Comment thread .github/workflows/ql-for-ql-build.yml
Comment on lines -22 to +27
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@main

@jsoref jsoref Feb 12, 2024

Copy link
Copy Markdown
Contributor Author

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.

@aeisenberg says:

All of it really should be using @main since we want to test on the latest in case we break something.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jsoref
jsoref requested a review from aeisenberg February 12, 2024 22:34
aeisenberg
aeisenberg reviewed Feb 13, 2024
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

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.

Partial review. I'm finding it hard to verify that this PR is correct.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/csharp-qltest.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/csharp-qltest.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

aeisenberg
aeisenberg previously approved these changes Feb 13, 2024
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

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.

This is looking good to me, but since this change affects lots of files, I'd like someone else to approve as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
angelapwen
angelapwen reviewed Feb 14, 2024
View reviewed changes

@angelapwen angelapwen left a comment

Copy link
Copy Markdown
Contributor

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.

Some questions in comments. Also, I still see a bunch of security-events: read permissions here: are those necessary? I see that they were able to be dropped from a few workflows because of the changes you'd made in the Action 😄

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/csharp-qltest.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/fast-forward.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jsoref
jsoref dismissed aeisenberg’s stale review via 62d530c February 14, 2024 19:29
@jsoref
jsoref force-pushed the declare-permissions branch from f93e918 to 62d530c Compare February 14, 2024 19:29
jsoref added 2 commits February 14, 2024 14:31
@jsoref
use github/codeql-action...@main
e468f40
@jsoref
Declare permissions
b58c856
Repositories can be configured with Default access (restricted)
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

Best practice says that workflows should declare the minimal permissions they require.
Without declaring permissions, paranoid forks fail miserably.
@jsoref
jsoref force-pushed the declare-permissions branch from 62d530c to b58c856 Compare February 14, 2024 19:31
@jsoref
jsoref requested review from aeisenberg and angelapwen February 14, 2024 19:32
aeisenberg
aeisenberg approved these changes Feb 15, 2024
View reviewed changes
angelapwen
angelapwen approved these changes Feb 15, 2024
View reviewed changes
@angelapwen

angelapwen commented Feb 15, 2024

Copy link
Copy Markdown
Contributor

Thank you for your patience and of course contributions @jsoref!! Merging now 💕

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@angelapwen
angelapwen merged commit 0643184 into github:main Feb 15, 2024
@jsoref
jsoref deleted the declare-permissions branch February 15, 2024 10:59
@angelapwen angelapwen mentioned this pull request Feb 16, 2024
Add security-events: write permission in ql-for-ql-build.yml #15631
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg approved these changes
+1 more reviewer
@angelapwen angelapwen angelapwen approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

no-change-note-required This PR does not need a change note QL-for-QL

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Workflows are missing permissions requests

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jsoref @angelapwen @aeisenberg
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.