How to Secure AWS OIDC Integrations with the Right IAM Conditions

· Original article ↗

Summary

A review of more than 20 vendors’ AWS OIDC guidance finds that trust policies need vendor-specific conditions to limit role access. Recommendations include checking both aud and sub claims, while investigating exceptions.

Key points

  • Missing conditions in AWS IAM trust policies can allow an account on a third-party service to assume a customer’s role.
  • For GitHub Actions, the sub condition should restrict access to the intended repository and branch; AWS changes have largely prevented creating new roles without it.
  • Required conditions vary: Microsoft Defender uses sts:RoleSessionName, while DoIT uses aws:RequestTag/DoitEnvironment.
  • Some vendors use shared audience values, so those values do not uniquely restrict access to a customer.
  • The author reviewed public documentation for more than 20 vendors and created detections for integrations missing desired conditions.
  • The article recommends checking aud and sub conditions, investigating vendor-specific exceptions, and using narrower sub matching where possible.

Article Details

Defense Focus
Detect and prevent overly permissive AWS IAM trust policies for OIDC integrations by checking for provider-appropriate conditions that restrict which identities can assume roles.
Detection Methods
  • Use the article's detections to identify AWS OIDC integrations missing recommended conditions, including checks for both aud and sub where appropriate.
  • Review each provider's documentation for required conditions beyond aud and sub, such as sts:RoleSessionName or aws:RequestTag conditions.
  • Inspect sub condition patterns for overly broad StringLike matching that permits any repository or branch in an organization.
  • Use AWS Access Analyzer's policy checks for missing condition keys and its suggestion to include an aud element.
Data Sources
  • AWS IAM role trust policies and OIDC provider configurations
  • AWS Access Analyzer policy-check findings
  • Provider documentation describing recommended OIDC claim and condition values
Rule Types
  • AWS IAM trust-policy configuration checks for missing or insufficient OIDC conditions
Platforms
  • AWS
Defensive Actions
  • Require aud and sub conditions for OIDC integrations when applicable, and investigate provider-specific exceptions.
  • Use provider documentation or support guidance to verify the required claims and condition values for each integration.
  • Constrain sub conditions to the intended repository and branch rather than broadly matching all repositories or branches.
  • Consider restricting role access to recommended source IP addresses where providers support that control.
  • Add any provider-specific conditions, such as sts:RoleSessionName or aws:RequestTag requirements, to the trust policy.

Vendors

Products

Related Articles