Skip to content

CI: harden GitHub Actions workflows security#200

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
vitorfloriano:ci-gh-actions-security-hardening
May 11, 2026
Merged

CI: harden GitHub Actions workflows security#200
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
vitorfloriano:ci-gh-actions-security-hardening

Conversation

@vitorfloriano
Copy link
Copy Markdown
Contributor

@vitorfloriano vitorfloriano commented May 3, 2026

This PR hardens the security on GitHub Actions workflows.

Summary of changes:

  • Add persist-credentials: false to checkout action to remediate artipacked.
  • Change top-level permissions to {} (none) and grant necessary permissions in job-level, as needed, to remediate excessive permissions.
  • Pin govulncheck install to commit hash.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 3, 2026

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit f3f826a
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/69f9d4b7c4219400083bf2e0

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 3, 2026
@vitorfloriano vitorfloriano force-pushed the ci-gh-actions-security-hardening branch from 4e77f8a to 043ee66 Compare May 3, 2026 21:28
Copy link
Copy Markdown
Contributor

@ajaysundark ajaysundark left a comment

Choose a reason for hiding this comment

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

@vitorfloriano Thanks for the PR! I support the security hardening changes as they align with Kubernetes policies. However, I'd like to discuss the addition of the new zizmor tool with other maintainers before adding it to CI. Could we split this PR or hold on the tool addition for now?"

Comment thread .github/workflows/lint-gha-workflows.yml Outdated
@vitorfloriano vitorfloriano force-pushed the ci-gh-actions-security-hardening branch from 043ee66 to c735160 Compare May 4, 2026 23:07
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 4, 2026
@vitorfloriano vitorfloriano changed the title CI: add Zizmor SAT and harden GitHub Actions security CI: harden GitHub Actions workflows security May 4, 2026
@vitorfloriano
Copy link
Copy Markdown
Contributor Author

Hi @ajaysundark I split the PR in two, as suggested.

See #210

@vitorfloriano vitorfloriano requested a review from ajaysundark May 4, 2026 23:37
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0
persist-credentials: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: will we have side-effects here, if we are setting this to false. Push will require some token I believe. Feel free to correct me here!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For this one we should indeed persist the credentials. Fixed!

@vitorfloriano vitorfloriano force-pushed the ci-gh-actions-security-hardening branch from c735160 to f3f826a Compare May 5, 2026 11:29
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 5, 2026

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
run: go install golang.org/x/vuln/cmd/govulncheck@d1f380186385b4f64e00313f31743df8e4b89a77 # v1.1.4
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@AvineshTripathi In this second pass I also amended the commit to add this. PTAL.

@ajaysundark
Copy link
Copy Markdown
Contributor

/cc @AvineshTripathi

@ajaysundark
Copy link
Copy Markdown
Contributor

/lgtm

please get an ack from @AvineshTripathi as well before final approval.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 11, 2026
@AvineshTripathi
Copy link
Copy Markdown
Contributor

/lgtm

Thanks for the changes!

@ajaysundark
Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ajaysundark, vitorfloriano

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2026
@k8s-ci-robot k8s-ci-robot merged commit 6d4dd7b into kubernetes-sigs:main May 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants