Skip to content

Cover exempted resources in IAM role policy test#10549

Merged
david-crespo merged 1 commit into
mainfrom
iam-test-exempted
Jun 10, 2026
Merged

Cover exempted resources in IAM role policy test#10549
david-crespo merged 1 commit into
mainfrom
iam-test-exempted

Conversation

@david-crespo

@david-crespo david-crespo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Add IpPool, VpcRouter, RouterRoute, ConsoleSession, and UserBuiltin to the policy_test resource universe and remove them from the coverage exemption list. As far as I can tell, these were not exempted for any particular reason — the comment just says "Resources that we should test, but for which we have not yet added a test."

This came up because I'm experimenting with an Oso to Cedar conversion and I'm trying to get as much test coverage as possible to validate the port.

Adds IpPool, VpcRouter, RouterRoute, ConsoleSession, and UserBuiltin to the
policy_test resource universe and removes them from the coverage exemption
list. All five are role-gated (FleetChild / InProjectFull) so they fit the
existing matrix; no new test machinery needed.
silo1-proj1-limited-collaborator ✘ ✘ ✘ ✘ ✘ ✘ ✔ ✘
silo1-proj1-viewer ✘ ✘ ✘ ✘ ✘ ✘ ✔ ✘
unauthenticated ! ! ! ! ! ! ! !
scim ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘

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.

Anybody can create child because that's the perm we use to allocate IP addresses. It would be nice to have this only work for users in a silo linked to the pool, but currently this is enforced in app code.

silo1-admin ✘ ✔ ✔ ✔ ✔ ✔ ✔ ✔
silo1-collaborator ✘ ✔ ✔ ✔ ✔ ✔ ✔ ✔
silo1-limited-collaborator ✘ ✔ ✔ ✔ ✘ ✘ ✘ ✘
silo1-viewer ✘ ✔ ✔ ✔ ✘ ✘ ✘ ✘

@david-crespo david-crespo Jun 4, 2026

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.

viewer and limited collaborator can't modify networking resources, as expected

@david-crespo david-crespo merged commit 266bfcd into main Jun 10, 2026
18 checks passed
@david-crespo david-crespo deleted the iam-test-exempted branch June 10, 2026 19:05
david-crespo added a commit that referenced this pull request Jun 10, 2026
…test (#10550)

Built on top of #10549. I'm trying to get as much test coverage as
possible for the existing authz setup to increase confidence in a
conversion from Oso to Cedar I'm prototyping.

Prior to this change, `test_iam_roles_behavior` matrix only tests actors
with roles, but there are a few cases where the Polar policy grants
permissions based directly on the identity of the actor rather than
based on a role. For example, a user can modify their own SSH keys just
by virtue of being the owner of those keys. There are also three
constant built-in actors (`db-init`, `internal-api`, `external-authn`),
whose privileges come from fixed Polar rules and seeded fleet role
assignments rather than per-resource roles.

This PR adds coverage for the role-less user and the three built-in
actors to the big authz snapshot test. It definitely adds noise to the
snapshot (+500 lines on top of 2200), but I think it's worth it.
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.

1 participant