Skip to content

Set finer-grain workflow permissions#1163

Merged
jrhemstad merged 5 commits intoNVIDIA:mainfrom
jrhemstad:fine-grain-permissions
Nov 29, 2023
Merged

Set finer-grain workflow permissions#1163
jrhemstad merged 5 commits intoNVIDIA:mainfrom
jrhemstad:fine-grain-permissions

Conversation

@jrhemstad
Copy link
Collaborator

Description

closes #919

In following with better security best practices, we don't want to rely on the default GHA_TOKEN permissions.

Instead, we want to set the least permissive permissions at the workflow level, and then set higher permissions at individual jobs that need them.

Most jobs need id-token: write for https://github.com/aws-actions/configure-aws-credentials for sccache configuration.

@jrhemstad
Copy link
Collaborator Author

Hey @diogoteles08, finally got around to addressing this. Would you mind taking a look?

@jarmak-nv
Copy link
Contributor

I think we'll need to update https://github.com/NVIDIA/cccl/blob/main/.github/workflows/triage_rotation.yml as well.

I think it just needs issue:write but not 100% certain.

@jrhemstad jrhemstad marked this pull request as ready for review November 29, 2023 19:22
@jrhemstad jrhemstad requested review from a team as code owners November 29, 2023 19:22
Copy link
Contributor

@jarmak-nv jarmak-nv left a comment

Choose a reason for hiding this comment

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

🔒 Looks good

@jrhemstad jrhemstad merged commit 72ab111 into NVIDIA:main Nov 29, 2023
wmaxey pushed a commit that referenced this pull request Dec 1, 2023
* Set workflow read permissions and per-job write permissions.

* set pull-requests read at workflow level.

* Set contents read at job level.

* Explicitly set job-level read permissions.

* Add permissions to verify-devcontainers.
wmaxey added a commit that referenced this pull request Dec 1, 2023
* Avoid batch benchmarks

* Relax minimal benchmarking time

* Don't benchmark small problem sizes

* Reduce sort workloads

* Split benchmarks into shards

* Fewer histogram benchmarks

* Fewer seg sort benchmarks

* Think about P0 algorithms

* Extra print

* Next round of simplification

* Do not treat segmented problems as P0

* Fewer workloads for memcpy

* Better workload filter

* Do not stop on first bench failure

* Update nvbench

* Remove draft automation + reduce permissions (#1154)

* Set finer-grain workflow permissions (#1163)

* Set workflow read permissions and per-job write permissions.

* set pull-requests read at workflow level.

* Set contents read at job level.

* Explicitly set job-level read permissions.

* Add permissions to verify-devcontainers.

---------

Co-authored-by: Georgy Evtushenko <evtushenko.georgy@gmail.com>
Co-authored-by: Ben Jarmak <104460670+jarmak-nv@users.noreply.github.com>
Co-authored-by: Jake Hemstad <jhemstad@nvidia.com>
@diogoteles08
Copy link

Hey @diogoteles08, finally got around to addressing this. Would you mind taking a look?

Hey @jrhemstad! Took a look and it looks good! Thanks for addressing this =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

CI: set minimal permissions on GitHub Workflow

4 participants