Skip to content

fix: harden workflow token permissions and pin yamllint - #218

Merged
marcusburghardt merged 7 commits into
complytime:mainfrom
marcusburghardt:fix/security-workflow-permissions
Sep 4, 2026
Merged

fix: harden workflow token permissions and pin yamllint#218
marcusburghardt merged 7 commits into
complytime:mainfrom
marcusburghardt:fix/security-workflow-permissions

Conversation

@marcusburghardt

Copy link
Copy Markdown
Member

Summary

Add restrictive top-level permissions blocks to three peribolos
workflows to minimize the default GITHUB_TOKEN scope, and pin the
yamllint dependency to a specific version.

Changes

  • peribolos-validate.yml: Add permissions: contents: read at
    workflow level and pin yamllint==1.38.0
  • peribolos-apply.yml: Add top-level permissions: contents: read
    (existing job-level permissions preserved)
  • peribolos-drift.yml: Add top-level permissions: contents: read
    (existing job-level contents: read + issues: write preserved)

Code Scanning Alerts Resolved

gxmiranda
gxmiranda previously approved these changes Sep 4, 2026

@gxmiranda gxmiranda left a comment

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.

LGTM

Add a top-level 'permissions: contents: read' block to restrict the
default GITHUB_TOKEN scope and pin yamllint to v1.38.0 to satisfy the
Pinned-Dependencies check.

Resolves code scanning alerts: complytime#35, complytime#36, complytime#51

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add a restrictive top-level 'permissions: contents: read' block to
ensure the default GITHUB_TOKEN scope is minimal. The existing
job-level permissions block is preserved as an explicit override.

Resolves code scanning alert: complytime#33

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add a restrictive top-level 'permissions: contents: read' block to
ensure the default GITHUB_TOKEN scope is minimal. The existing
job-level permissions block (contents: read, issues: write) is
preserved as an explicit override for the drift detection job.

Resolves code scanning alert: complytime#34

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add persist-credentials: false to the actions/checkout step to
prevent unnecessary git credential storage on disk.

Resolves zizmor artipacked finding.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add persist-credentials: false to both actions/checkout steps to
prevent unnecessary git credential storage on disk.

Resolves zizmor artipacked findings.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add persist-credentials: false to both actions/checkout steps to
prevent unnecessary git credential storage on disk.

Resolves zizmor artipacked findings.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Peribolos manages the entire complytime GitHub org (membership, teams,
repos), so its GitHub App token intentionally requires org-wide scope.
The zizmor github-app audit flags this as dangerous, but scoping the
token to individual repositories would break peribolos functionality.

Resolves zizmor github-app findings.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt

Copy link
Copy Markdown
Member Author

After the initial approval, I rebased onto the latest upstream/main and added 4 follow-up commits to fix zizmor lint failures surfaced by MegaLinter (pre-existing issues in the touched files, not introduced by the original changes):

  • Commits 4-6: Add persist-credentials: false to all actions/checkout steps across the three workflows (resolves artipacked findings)
  • Commit 7: Add .github/zizmor.yml to ignore the github-app audit for peribolos workflows — peribolos intentionally requires org-wide App token scope to manage membership, teams, and repos
    No changes to the original permission hardening or yamllint pinning. The new commits are additive security improvements.

@marcusburghardt
marcusburghardt enabled auto-merge (rebase) September 4, 2026 15:03

@jflowers jflowers left a comment

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.

lgtm

@marcusburghardt
marcusburghardt merged commit 3047e67 into complytime:main Sep 4, 2026
14 checks passed
@marcusburghardt
marcusburghardt deleted the fix/security-workflow-permissions branch September 4, 2026 17:34
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.

4 participants