-
Notifications
You must be signed in to change notification settings - Fork 672
[New Rule] AWS IAM Login Profile Created or Modified for an IAM User #6303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bryans3c
wants to merge
8
commits into
main
Choose a base branch
from
rule/aws-iam-login-profile-created-or-modified
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
72017df
[New Rule] AWS IAM Login Profile Created or Modified for an IAM User
bryans3c 57103e7
Update persistence_iam_login_profile_created_or_modified.toml
bryans3c d73d1e3
Update persistence_iam_login_profile_created_or_modified.toml
bryans3c 49ebd60
Potential fix for pull request finding
bryans3c 6118c8a
Potential fix for pull request finding
bryans3c c8fbf33
Update rules/integrations/aws/persistence_iam_login_profile_created_o…
bryans3c 9fc257a
Update rules/integrations/aws/persistence_iam_login_profile_created_o…
bryans3c 6d54ea0
Update index and user agent filters in IAM profile rule
bryans3c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
133 changes: 133 additions & 0 deletions
133
rules/integrations/aws/persistence_iam_login_profile_created_or_modified.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| [metadata] | ||
| creation_date = "2026/06/18" | ||
| integration = ["aws"] | ||
| maturity = "production" | ||
| updated_date = "2026/06/18" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| Identifies creation or modification of a console login profile for an AWS IAM user via CreateLoginProfile or | ||
| UpdateLoginProfile. A login profile enables password-based console sign-in for an IAM user. Adversaries who obtain | ||
| programmatic credentials may create a login profile to add persistent interactive console access, or update an existing | ||
| profile to reset another user's password and take over the account, even after the original access keys are rotated. | ||
| Because console access for IAM users is increasingly provisioned through federation or IAM Identity Center, direct use | ||
| of these APIs by an unexpected principal warrants review. This rule targets IAM users (the userName parameter is | ||
| present); creation of a login profile for the account root user is covered by a separate rule. | ||
| """ | ||
| false_positives = [ | ||
| """ | ||
| Administrators and identity teams may legitimately create or reset console login profiles during user onboarding, | ||
| password resets, or break-glass procedures. Verify the principal in "aws.cloudtrail.user_identity.arn", the target | ||
| user in "aws.cloudtrail.request_parameters", and whether the change aligns with an approved request. Known | ||
| administration roles and provisioning automation can be excluded after validation. | ||
| """, | ||
| ] | ||
| from = "now-6m" | ||
| index = ["filebeat-*", "logs-aws.cloudtrail-*"] | ||
| language = "kuery" | ||
| license = "Elastic License v2" | ||
| name = "AWS IAM Login Profile Created or Modified for an IAM User" | ||
| note = """## Triage and analysis | ||
|
|
||
| ### Investigating AWS IAM Login Profile Created or Modified for an IAM User | ||
|
|
||
| A login profile enables password-based AWS console access for an IAM user. "CreateLoginProfile" adds a console password to a user that did not have one, and "UpdateLoginProfile" changes the password of an existing profile. An adversary operating with stolen programmatic credentials can use "CreateLoginProfile" to establish persistent interactive access, or "UpdateLoginProfile" to reset a privileged user's password and hijack the account, retaining access even if the compromised access keys are later disabled. | ||
|
|
||
| Because IAM-user console access is commonly provisioned through federation or IAM Identity Center rather than these APIs directly, unexpected use is a meaningful signal. Note that a user changing their own password uses ChangePassword, not UpdateLoginProfile, so UpdateLoginProfile typically reflects an administrative (or adversarial) reset of another user. | ||
|
|
||
| ### Possible investigation steps | ||
|
|
||
| - Identify the actor in "aws.cloudtrail.user_identity.arn", "aws.cloudtrail.user_identity.type", and "aws.cloudtrail.user_identity.session_context.session_issuer.arn", and review "source.ip", "source.as.organization.name", and "user_agent.original" to determine whether the action came from an expected network path or automation platform. | ||
| - Identify the target user in "aws.cloudtrail.request_parameters" and determine whether that user normally has console access and how privileged it is. | ||
| - Check "aws.cloudtrail.request_parameters" for "passwordResetRequired"; a value of false (or omitted) may indicate the actor set a password they intend to reuse. | ||
| - Correlate with surrounding activity by the same principal, such as CreateAccessKey, AttachUserPolicy, PutUserPolicy, virtual MFA registration, or a subsequent ConsoleLogin for the target user, which may indicate persistence or account takeover. | ||
|
|
||
| ### False positive analysis | ||
|
|
||
| - Onboarding, password resets, and break-glass procedures legitimately use these APIs. Confirm the change is expected and exclude known administration roles or provisioning automation on "aws.cloudtrail.user_identity.arn" after validation. | ||
|
|
||
| ### Response and remediation | ||
|
|
||
| - If the change is unauthorized, delete the login profile or reset the affected user's password, and revoke active console sessions for that user. | ||
| - Rotate or restrict credentials for the acting principal if compromise is suspected, and review any IAM permission changes or access keys created by the same session. | ||
| - Restrict "iam:CreateLoginProfile" and "iam:UpdateLoginProfile" to a small set of trusted administrators, and prefer federation or IAM Identity Center for console access. | ||
|
|
||
| ### Additional information | ||
|
|
||
| - [CreateLoginProfile API](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateLoginProfile.html) | ||
| - [UpdateLoginProfile API](https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateLoginProfile.html) | ||
| """ | ||
| references = [ | ||
| "https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateLoginProfile.html", | ||
| "https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateLoginProfile.html", | ||
| ] | ||
| risk_score = 47 | ||
| rule_id = "f4dc90eb-e77e-4f0e-b18b-eb50da9e827e" | ||
| setup = """The AWS Fluentd or AWS Beats integration, CloudTrail logging, and a configured CloudTrail trail are required for | ||
| this rule. See the AWS integration documentation: https://docs.elastic.co/integrations/aws/cloudtrail""" | ||
|
Copilot marked this conversation as resolved.
Outdated
|
||
| severity = "medium" | ||
| tags = [ | ||
| "Domain: Cloud", | ||
| "Domain: Identity", | ||
| "Data Source: AWS", | ||
| "Data Source: Amazon Web Services", | ||
| "Data Source: AWS IAM", | ||
| "Use Case: Identity and Access Audit", | ||
| "Tactic: Persistence", | ||
| "Resources: Investigation Guide", | ||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "query" | ||
|
|
||
| query = ''' | ||
| data_stream.dataset: "aws.cloudtrail" | ||
| and event.provider: "iam.amazonaws.com" | ||
| and event.action: ("CreateLoginProfile" or "UpdateLoginProfile") | ||
| and event.outcome: "success" | ||
| and aws.cloudtrail.request_parameters: *userName* | ||
| and not aws.cloudtrail.user_identity.type: "AWSService" | ||
|
bryans3c marked this conversation as resolved.
Outdated
|
||
| and not aws.cloudtrail.user_identity.arn: arn*/terraform | ||
|
bryans3c marked this conversation as resolved.
Outdated
|
||
| and not source.as.organization.name: (Amazon* or Google*) | ||
|
bryans3c marked this conversation as resolved.
Outdated
bryans3c marked this conversation as resolved.
Outdated
|
||
| and not source.address: ("cloudformation.amazonaws.com" or "servicecatalog.amazonaws.com") | ||
|
Copilot marked this conversation as resolved.
Outdated
|
||
| ''' | ||
|
|
||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
| [[rule.threat.technique]] | ||
| id = "T1098" | ||
| name = "Account Manipulation" | ||
| reference = "https://attack.mitre.org/techniques/T1098/" | ||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1098.001" | ||
| name = "Additional Cloud Credentials" | ||
| reference = "https://attack.mitre.org/techniques/T1098/001/" | ||
|
|
||
|
|
||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0003" | ||
| name = "Persistence" | ||
| reference = "https://attack.mitre.org/tactics/TA0003/" | ||
|
|
||
| [rule.investigation_fields] | ||
| field_names = [ | ||
| "@timestamp", | ||
| "user.name", | ||
| "user_agent.original", | ||
| "source.ip", | ||
| "source.as.number", | ||
| "source.as.organization.name", | ||
| "aws.cloudtrail.user_identity.arn", | ||
| "aws.cloudtrail.user_identity.type", | ||
| "aws.cloudtrail.user_identity.access_key_id", | ||
| "aws.cloudtrail.user_identity.session_context.session_issuer.arn", | ||
| "event.action", | ||
| "event.outcome", | ||
| "cloud.account.id", | ||
| "cloud.region", | ||
| "aws.cloudtrail.request_parameters", | ||
| "aws.cloudtrail.response_elements", | ||
| ] | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.