Skip to content

docs: widen iam:GetRole scope and add missing organizations: actions in Identity Center setup - #150

Merged
luisina-santos merged 5 commits into
mainfrom
luisinasantos/fix-identity-center-iam-getrole-scope
Aug 7, 2026
Merged

docs: widen iam:GetRole scope and add missing organizations: actions in Identity Center setup#150
luisina-santos merged 5 commits into
mainfrom
luisinasantos/fix-identity-center-iam-getrole-scope

Conversation

@luisina-santos

Copy link
Copy Markdown
Contributor

Summary

The Identity Center setup policy in docs/connector.mdx (and the matching block in README.md) scoped iam:GetRole to SSO-provisioned roles only (arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/*), but the connector calls GetRole on every IAM role returned by ListRoles. A reader who follows the Identity Center walkthrough verbatim gets a connector that silently omits grants for every non-SSO-provisioned role.

This mirrors the fix proposed in ConductorOne/docs#442 (currently open/unmerged), applied here to the source of truth that regenerates the published page.

Changes

  • docs/connector.mdx (JSON + Terraform Identity Center policy blocks):
    • Adds iam:GetRole to ConductorOneReadAccess (Resource: "*")
    • Adds organizations:DescribeAccount, organizations:DescribeOrganization, organizations:ListParents — all declared in baton_capabilities.json and called by the connector, but missing from the documented policy
    • Updates the explanatory bullets for Section 1 and Section 3 to match
  • README.md: adds organizations:DescribeAccount to the two Identity Center policy blocks — iam:GetRole, organizations:DescribeOrganization, and organizations:ListParents were already present here, only DescribeAccount was missing

Why organizations:DescribeAccount belongs here

Verified against the code, not just the ticket's claim — it's used at pkg/connector/account.go:572 (account status checks during provisioning) and declared at pkg/connector/resource_types.go:236. Its absence degrades to a warn-and-skip with a less-clear error message (account.go:713, :880), the same silent-degradation failure class as the iam:GetRole gap.

Test plan

  • JSON and Terraform (jsonencode) blocks still parse as valid JSON/HCL after the edits
  • Diff mirrors docs#442's JSON changes exactly, adapted to this repo's two policy blocks (JSON + Terraform) instead of one
  • organizations:DescribeAccount verified as a real, called permission via source inspection, not assumed from the ticket

Refs CXP-865.

🤖 Generated with Claude Code

…in Identity Center setup (CXP-865)

The Identity Center setup policy scoped iam:GetRole to SSO-provisioned
roles only, but the connector calls GetRole for every IAM role returned
by ListRoles — silently dropping grants for non-SSO-provisioned roles.
Also adds organizations:DescribeAccount, organizations:DescribeOrganization,
and organizations:ListParents, which are declared in baton_capabilities.json
and called by the connector but were missing from the documented policy.

Mirrors the fix proposed in ConductorOne/docs#442 in the source-of-truth
docs/connector.mdx, and brings README.md's Identity Center policy in line
with it (organizations:DescribeAccount was missing there too).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 6, 2026

Copy link
Copy Markdown

CXP-865

Comment thread README.md Outdated
Comment thread docs/connector.mdx Outdated
Comment thread docs/connector.mdx
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Connector PR Review: docs: widen iam:GetRole scope and add missing organizations: actions in Identity Center setup

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 81d699a7cf6c.
Review mode: incremental since 297ca10d
View review run

Review Summary

This is a docs-only PR (README.md, docs/connector.mdx); the full PR diff was scanned for security and correctness issues and no code paths changed. The new commit 6b86cbd2 addresses the prior parity finding by bringing the Terraform ConductorOneReadAccess and ConductorOneProvisionAccess blocks to action-for-action parity with the JSON policy — I compared both action lists and they now match exactly, and the added iam:GetUser / iam:List... / iam:Delete... / iam:DeactivateMFADevice / iam:TagUser actions correspond precisely to the calls in the IAM user create/delete flow (pkg/connector/user.go:322-619). I also re-verified the prose claims against the code: a failed iam:GetRole warns and skips trust-policy grants for that role (pkg/connector/role.go:166-180), missing organizations:ListParents degrades to flat accounts (pkg/connector/account.go:238), and missing organizations:DescribeAccount proceeds on AccessDenied (pkg/connector/account.go:572-588). No new issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

Note: the machine-readable review-state marker could not be emitted from this run because the sandbox rejected the required literal sequence; the next review will therefore run in full mode against head 6b86cbd2b1e77dcc9da563e9a6db981bac72f155 (base 81d699a7cf6c718050361b43077f8dd9351f91ee).

- Drop the now-redundant iam:GetRole from the AccessToSSOProvisionedRoles
  statements (JSON + Terraform in connector.mdx, footnote in README.md)
  now that Section 1 grants it at Resource:* — leaving it in both places
  contradicted the new explanatory note.
- Drop the duplicate organizations:DescribeAccount added to README.md's
  provisioning policy; that policy already grants it via the dedicated
  AccountStatusValidationForProvisioning statement, which also carries
  the "Recommended" framing this duplicate would have undermined.
- Split the new organizations: bullet in connector.mdx so
  ListParents/DescribeAccount are documented as Recommended-but-optional
  (matching their actual graceful-degradation behavior in account.go)
  rather than lumped in as hard requirements alongside ListAccounts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread README.md Outdated

@github-actions github-actions Bot 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.

No blocking issues found.

It's only called from verifyAccountStatus (account.go:571), which runs
exclusively from provisionAssignment/deprovisionAssignment — never during
sync. Adding it to the sync-only policy granted a provisioning-only
permission outside least-privilege; it's already covered by the dedicated
AccountStatusValidationForProvisioning statement in the provisioning policy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread docs/connector.mdx
Comment thread docs/connector.mdx
Comment thread docs/connector.mdx Outdated

@github-actions github-actions Bot 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.

No blocking issues found.

- Terraform ConductorOneReadAccess statement was missing
  organizations:ListRoots and organizations:ListOrganizationalUnitsForParent,
  unlike the JSON policy above it. Without both, granting only ListParents
  with the hierarchy opt-in enabled would parent accounts to Root/OU
  resources that organization.go skips creating.
- organizations:DescribeOrganization is granted in every policy block but
  never called anywhere in pkg/ (only declared in capability metadata).
  Reworded its bullet to say so instead of claiming it's used to "retrieve
  organization details."
- iam:GetRole was lumped into the same bullet as iam:List.../iam:GetGroup as
  if needed to "identify resources." It's actually only used in the Grants
  phase to read a role's trust policy (role.go:166) and degrades gracefully
  on failure. Split it into its own Recommended/fail-soft bullet, consistent
  with how ListParents and DescribeAccount are already documented.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread docs/connector.mdx

@github-actions github-actions Bot 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.

No blocking issues found.

… parity with JSON

The Terraform policy's ConductorOneReadAccess and ConductorOneProvisionAccess
statements were missing several iam:* actions present in the equivalent JSON
policy (iam:GetAccessKeyLastUsed, iam:GetUser, iam:ListAccessKeys,
iam:ListSigningCertificates, iam:ListSSHPublicKeys,
iam:ListServiceSpecificCredentials, iam:ListMFADevices, iam:ListUserPolicies,
iam:ListAttachedUserPolicies, iam:ListGroupsForUser, iam:CreateUser, and the
iam:Delete*/iam:Deactivate*/iam:TagUser cleanup actions used for full IAM user
deprovisioning). Users following the Terraform path got a strictly weaker
role than the console/JSON path for the same features.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@github-actions github-actions Bot 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.

No blocking issues found.

@luisina-santos
luisina-santos merged commit ee4cc1b into main Aug 7, 2026
9 checks passed
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.

2 participants