Skip to content

Support distrusting Actions owners via !owner entries - #22415

Open
redsun82 wants to merge 3 commits into
mainfrom
redsun82-distrusted-actions-owner-override
Open

Support distrusting Actions owners via !owner entries#22415
redsun82 wants to merge 3 commits into
mainfrom
redsun82-distrusted-actions-owner-override

Conversation

@redsun82

Copy link
Copy Markdown
Contributor

Why

GitHub's first-party organizations (actions, github, advanced-security) are trusted by default, so actions/unpinned-tag never reports their unpinned tags. Some users want to hold first-party actions to the same pinning standard as everything else, but there was no way to opt an owner out of the trusted list.

What

Adds an in-band negation convention to trustedActionsOwnerDataModel: an entry prefixed with ! removes the matching owner from the trusted set. For example, contributing ["!github"] makes unpinned github/* actions get flagged.

This works entirely in the single Config.qll wrapper that already interprets the extensible predicate, so no new predicate or query change is needed:

  • An owner is trusted iff it is listed and its !owner form is not listed.
  • A !owner entry always wins over a plain owner entry.
  • !-prefixed sentinels are themselves excluded from the effective owner set.

The ! prefix is unambiguous because GitHub owner names can never start with !.

Notes for reviewers

  • Immutable actions (e.g. actions/checkout) are exempted by the query independently of the trusted-owner list, so distrusting an owner cannot surface those. The new test therefore exercises non-immutable first-party actions.
  • New isolated test under CWE-829-untrusted-owner/ adds ["!actions"] and asserts the previously-trusted owner is now flagged, while an untouched first-party owner stays trusted. The existing UnpinnedActionsTag test is unchanged and still passes.
  • Docs updated with the convention and a worked example.

Fixes: #22409

Lets `trustedActionsOwnerDataModel` remove an owner (including the
first-party `actions`, `github` and `advanced-security`) with a
`!`-prefixed entry, so unpinned tags for those Actions are reported by
`actions/unpinned-tag`. Unambiguous because owner names can never start
with `!`.

Closes #22409

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 24, 2026 14:18
@redsun82
redsun82 requested a review from a team as a code owner August 24, 2026 14:18

Copilot AI 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.

Pull request overview

Adds negated trusted-owner entries so users can flag unpinned first-party Actions.

Changes:

  • Implements !owner override semantics.
  • Adds isolated query coverage.
  • Documents configuration and release impact.
Show a summary per file
File Description
Config.qll Implements negated-owner filtering.
UnpinnedActionsTag.qlref Registers the test query.
UnpinnedActionsTag.ext.yml Distrusts actions in the test.
UnpinnedActionsTag.expected Captures expected alerts.
unpinned_first_party.yml Provides test workflows.
customizing-library-models-for-actions.rst Documents !owner usage.
2026-08-24-untrusted-actions-owner.md Adds the change note.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread actions/ql/lib/codeql/actions/test/InlineExpectationsTestQuery.ql Fixed
`codeql.Locations` already re-exports it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Actions Analysis of GitHub Actions documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removing first-party entries from trustedActionsOwnerDataModel

3 participants