AWS IAM OIDC Provider Created by Rare User
Detects when an uncommon user or role creates an OpenID Connect (OIDC) Identity Provider in AWS IAM. OIDC providers enable web identity federation, allowing users authenticated by external identity providers (such as Google, GitHub, or custom OIDC-compliant providers) to assume IAM roles and access AWS resources. Adversaries who have gained administrative access may create rogue OIDC providers to establish persistent, federated access that survives credential rotation. This technique allows attackers to assume roles using tokens from an IdP they control. While OIDC provider creation is benign in some environments, it should still be validated against authorized infrastructure changes.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/02/05"
3integration = ["aws"]
4maturity = "production"
5updated_date = "2026/08/05"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects when an uncommon user or role creates an OpenID Connect (OIDC) Identity Provider in AWS IAM. OIDC providers
11enable web identity federation, allowing users authenticated by external identity providers (such as Google, GitHub, or
12custom OIDC-compliant providers) to assume IAM roles and access AWS resources. Adversaries who have gained
13administrative access may create rogue OIDC providers to establish persistent, federated access that survives credential
14rotation. This technique allows attackers to assume roles using tokens from an IdP they control. While OIDC provider
15creation is benign in some environments, it should still be validated against authorized infrastructure changes.
16"""
17false_positives = [
18 """
19 OIDC providers may be created during legitimate CI/CD integration (e.g., GitHub Actions, GitLab CI), Kubernetes
20 service account federation, or other web identity use cases. Verify whether the user identity and timing align with
21 approved change management processes. If this is expected administrative activity, it can be exempted from the rule.
22 """,
23]
24from = "now-6m"
25index = ["filebeat-*", "logs-aws.cloudtrail-*"]
26language = "kuery"
27license = "Elastic License v2"
28name = "AWS IAM OIDC Provider Created by Rare User"
29note = """## Triage and analysis
30
31### Investigating AWS IAM OIDC Provider Created by Rare User
32
33OpenID Connect (OIDC) providers in AWS IAM enable web identity federation, allowing external identity providers to authenticate users who then assume IAM roles. Common legitimate use cases include GitHub Actions accessing AWS resources, Kubernetes pods authenticating to AWS, and web applications using social login.
34
35This rule detects the first time a specific user or role creates an OIDC provider within an account. While OIDC provider creation is common in some environments, a new user creating one for the first time warrants validation to ensure it's authorized.
36
37### Possible investigation steps
38
39- **Identify the actor**
40 - Review `aws.cloudtrail.user_identity.arn` to determine who created the OIDC provider.
41 - Check if this user has created OIDC providers before in other accounts.
42
43- **Review the OIDC provider details**
44 - Examine `aws.cloudtrail.request_parameters` for the provider URL and client IDs.
45 - Identify the external IdP (e.g., GitHub, Google, custom provider).
46
47- **Validate business justification**
48 - Confirm with DevOps or platform teams whether this aligns with CI/CD pipeline setup.
49 - Check for related change tickets or infrastructure-as-code deployments.
50
51- **Check for follow-on activity**
52 - Search for `CreateRole` or `UpdateAssumeRolePolicy` calls that trust the new OIDC provider.
53 - Look for `AssumeRoleWithWebIdentity` calls using the newly created provider.
54
55- **Correlate with other suspicious activity**
56 - Check for preceding privilege escalation or credential access events.
57 - Look for other persistence mechanisms being established concurrently.
58
59### False positive analysis
60
61- **CI/CD pipeline integration**
62 - GitHub Actions, GitLab CI, and other CI/CD systems commonly use OIDC for AWS authentication.
63 - Validate against known DevOps workflows.
64
65- **Kubernetes federation**
66 - EKS and self-managed Kubernetes clusters may use OIDC providers for pod identity.
67 - Confirm with platform engineering teams.
68
69- **Infrastructure-as-code deployments**
70 - Terraform, CloudFormation, or other IaC tools may create OIDC providers.
71 - Verify via CI/CD logs.
72
73### Response and remediation
74
75- **Immediate containment**
76 - If unauthorized, delete the OIDC provider using `DeleteOpenIDConnectProvider`.
77 - Review and remove any IAM roles that trust the rogue provider.
78
79- **Investigation**
80 - Audit CloudTrail for any `AssumeRoleWithWebIdentity` calls using this provider.
81 - Review all IAM roles with web identity trust relationships.
82
83- **Hardening**
84 - Restrict `iam:CreateOpenIDConnectProvider` permissions to authorized roles.
85 - Implement SCPs to control OIDC provider creation in member accounts.
86 - Enable AWS Config rules to monitor identity provider configurations.
87
88### Additional information
89- **[AWS IAM OIDC Providers Documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html)**
90- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)**
91- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)**
92"""
93references = [
94 "https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateOpenIDConnectProvider.html",
95 "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html",
96 "https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-320a",
97]
98risk_score = 73
99rule_id = "47403d72-3ee2-4752-a676-19dc8ff2b9d6"
100severity = "high"
101tags = [
102 "Domain: Cloud",
103 "Platform: AWS",
104 "Data Source: AWS CloudTrail",
105 "Service: AWS IAM",
106 "Tactic: Persistence",
107 "Rule Type: New Terms",
108 "Resources: Investigation Guide",
109]
110timestamp_override = "event.ingested"
111type = "new_terms"
112
113query = '''
114data_stream.dataset: "aws.cloudtrail"
115 and event.provider: "iam.amazonaws.com"
116 and event.action: "CreateOpenIDConnectProvider"
117 and event.outcome: "success"
118 and not user_agent.original: (*Terraform* or *eksctl*)
119'''
120
121
122[[rule.threat]]
123framework = "MITRE ATT&CK"
124
125[[rule.threat.technique]]
126id = "T1078"
127name = "Valid Accounts"
128reference = "https://attack.mitre.org/techniques/T1078/"
129
130[[rule.threat.technique.subtechnique]]
131id = "T1078.004"
132name = "Cloud Accounts"
133reference = "https://attack.mitre.org/techniques/T1078/004/"
134
135[rule.threat.tactic]
136id = "TA0003"
137name = "Persistence"
138reference = "https://attack.mitre.org/tactics/TA0003/"
139
140[[rule.threat]]
141framework = "MITRE ATT&CK"
142
143[[rule.threat.technique]]
144id = "T1484"
145name = "Domain or Tenant Policy Modification"
146reference = "https://attack.mitre.org/techniques/T1484/"
147
148[[rule.threat.technique.subtechnique]]
149id = "T1484.002"
150name = "Trust Modification"
151reference = "https://attack.mitre.org/techniques/T1484/002/"
152
153[rule.threat.tactic]
154id = "TA0004"
155name = "Privilege Escalation"
156reference = "https://attack.mitre.org/tactics/TA0004/"
157
158[[rule.threat]]
159framework = "MITRE ATT&CK"
160
161[[rule.threat.technique]]
162id = "T1484"
163name = "Domain or Tenant Policy Modification"
164reference = "https://attack.mitre.org/techniques/T1484/"
165
166[[rule.threat.technique.subtechnique]]
167id = "T1484.002"
168name = "Trust Modification"
169reference = "https://attack.mitre.org/techniques/T1484/002/"
170
171[rule.threat.tactic]
172id = "TA0005"
173name = "Defense Evasion"
174reference = "https://attack.mitre.org/tactics/TA0005/"
175[rule.investigation_fields]
176field_names = [
177 "@timestamp",
178 "user.name",
179 "user_agent.original",
180 "source.ip",
181 "aws.cloudtrail.user_identity.arn",
182 "aws.cloudtrail.user_identity.type",
183 "aws.cloudtrail.user_identity.access_key_id",
184 "event.action",
185 "event.outcome",
186 "cloud.account.id",
187 "cloud.region",
188 "aws.cloudtrail.request_parameters",
189 "aws.cloudtrail.response_elements",
190]
191
192[rule.new_terms]
193field = "new_terms_fields"
194value = ["cloud.account.id", "user.name"]
195[[rule.new_terms.history_window_start]]
196field = "history_window_start"
197value = "now-10d"
Triage and analysis
Investigating AWS IAM OIDC Provider Created by Rare User
OpenID Connect (OIDC) providers in AWS IAM enable web identity federation, allowing external identity providers to authenticate users who then assume IAM roles. Common legitimate use cases include GitHub Actions accessing AWS resources, Kubernetes pods authenticating to AWS, and web applications using social login.
This rule detects the first time a specific user or role creates an OIDC provider within an account. While OIDC provider creation is common in some environments, a new user creating one for the first time warrants validation to ensure it's authorized.
Possible investigation steps
-
Identify the actor
- Review
aws.cloudtrail.user_identity.arnto determine who created the OIDC provider. - Check if this user has created OIDC providers before in other accounts.
- Review
-
Review the OIDC provider details
- Examine
aws.cloudtrail.request_parametersfor the provider URL and client IDs. - Identify the external IdP (e.g., GitHub, Google, custom provider).
- Examine
-
Validate business justification
- Confirm with DevOps or platform teams whether this aligns with CI/CD pipeline setup.
- Check for related change tickets or infrastructure-as-code deployments.
-
Check for follow-on activity
- Search for
CreateRoleorUpdateAssumeRolePolicycalls that trust the new OIDC provider. - Look for
AssumeRoleWithWebIdentitycalls using the newly created provider.
- Search for
-
Correlate with other suspicious activity
- Check for preceding privilege escalation or credential access events.
- Look for other persistence mechanisms being established concurrently.
False positive analysis
-
CI/CD pipeline integration
- GitHub Actions, GitLab CI, and other CI/CD systems commonly use OIDC for AWS authentication.
- Validate against known DevOps workflows.
-
Kubernetes federation
- EKS and self-managed Kubernetes clusters may use OIDC providers for pod identity.
- Confirm with platform engineering teams.
-
Infrastructure-as-code deployments
- Terraform, CloudFormation, or other IaC tools may create OIDC providers.
- Verify via CI/CD logs.
Response and remediation
-
Immediate containment
- If unauthorized, delete the OIDC provider using
DeleteOpenIDConnectProvider. - Review and remove any IAM roles that trust the rogue provider.
- If unauthorized, delete the OIDC provider using
-
Investigation
- Audit CloudTrail for any
AssumeRoleWithWebIdentitycalls using this provider. - Review all IAM roles with web identity trust relationships.
- Audit CloudTrail for any
-
Hardening
- Restrict
iam:CreateOpenIDConnectProviderpermissions to authorized roles. - Implement SCPs to control OIDC provider creation in member accounts.
- Enable AWS Config rules to monitor identity provider configurations.
- Restrict
Additional information
References
Related rules
- AWS Account Discovery By Rare User
- AWS EC2 Route Table Created
- AWS IAM Assume Role Policy Update
- AWS IAM Customer-Managed Policy Attached to Role by Rare User
- AWS IAM User Created Access Keys For Another User