How the attack works
AWS Secrets Manager holds the credentials that workloads fetch at run time: database passwords, API keys, OAuth tokens. A principal allowed secretsmanager:GetSecretValue on a secret receives its decrypted value. BatchGetSecretValue returns up to 20 secrets in one call, chosen by name or by a filter. An identity policy that allows these actions on every resource, or a wildcard such as secretsmanager:*, makes every secret in the account readable by whoever holds that identity.
Attackers who take over such an identity (a workload role, a pipeline role, an administrator) list the secrets and read them. What they collect are credentials for systems outside IAM, such as databases, SaaS platforms and other clouds, so the compromise spreads beyond the AWS account and outlasts the original foothold. A quieter variant attaches a resource policy to a secret (PutResourcePolicy), so that another principal, possibly in another account, can keep reading it later.
Secrets Manager logs all of its API calls as CloudTrail management events under secretsmanager.amazonaws.com. A batch call writes one BatchGetSecretValue entry and a GetSecretValue entry for each secret requested. Single GetSecretValue calls are what every application makes all day, so a rule on that event alone is noise. The batch call and a resource policy change are far less common, and that is what the rules here match. Systems Manager Parameter Store keeps the same kind of data in SecureString parameters; these rules do not cover it. An attacker who reads secrets one at a time still stands out by breadth: a threshold rule counts how many different secrets one principal requests with GetSecretValue in a short window.
What an attacker needs
- Credentials for a principal allowed secretsmanager:GetSecretValue on many secrets, usually through a wildcard resource or action. The batch call also needs secretsmanager:BatchGetSecretValue, and secretsmanager:ListSecrets when it selects secrets by filter.
- kms:Decrypt on the key, for secrets encrypted with a customer managed key instead of the AWS managed key aws/secretsmanager.
- For the resource policy variant, secretsmanager:PutResourcePolicy on the secret. Reading from another account also requires the secret to use a customer managed key whose key policy admits that account.
Impact
The attacker holds working credentials for whatever the secrets protect: databases, third-party services, pipelines, other cloud accounts. Those credentials are used outside AWS, where CloudTrail sees nothing, and they stay valid until each secret is rotated. A resource policy that admits an outside principal keeps the secret readable after the compromised identity has been cleaned up.
Detection rules
Many Different Secrets Retrieved by One Principal
Counts, per calling principal (userIdentity.arn), how many different secrets it requested from AWS Secrets Manager with GetSecretValue. An application reads the few secrets it was built for, again and again. Ten or more different secrets within 10 minutes is the pattern of someone who lists the secrets of an account and reads them one after another, which the rule on the batch call does not see. AWS documents that Secrets Manager writes CloudTrail entries for all of its operations. The secret is read from requestParameters.secretId, which follows the SecretId request parameter of the Secrets Manager API reference and is the field AWS shows in its example records of other Secrets Manager operations. It holds what the caller sent, a name or an ARN, so one secret that is requested in both forms is counted twice. Denied attempts are counted as well. The count and the window are starting points to tune. For role sessions the principal is the session ARN, so one role used with different session names is counted per session.
Fires when one userIdentity.arn has at least 10 different requestParameters.secretId values within 10 minutes.
title: Secret Value Retrieved (Many Secrets Base Event)
id: b4ab407f-494b-47b4-8784-4aa6789e87f4
name: aws_secrets_manager_secret_value_retrieved
status: experimental
description: >-
Base event of the threshold rule in this file. Any GetSecretValue call to
AWS Secrets Manager, including attempts that were denied.
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: secretsmanager.amazonaws.com
eventName: GetSecretValue
condition: selection
level: low
---
title: Many Different Secrets Retrieved by One Principal
id: e8a8fcb4-e74e-443b-b953-8b1e5f3d8f73
status: experimental
description: >-
Counts, per calling principal (userIdentity.arn), how many different
secrets it requested from AWS Secrets Manager with GetSecretValue. An
application reads the few secrets it was built for, again and again. Ten
or more different secrets within 10 minutes is the pattern of someone who
lists the secrets of an account and reads them one after another, which
the rule on the batch call does not see. AWS documents that Secrets
Manager writes CloudTrail entries for all of its operations. The secret
is read from requestParameters.secretId, which follows the SecretId
request parameter of the Secrets Manager API reference and is the field
AWS shows in its example records of other Secrets Manager operations. It
holds what the caller sent, a name or an ARN, so one secret that is
requested in both forms is counted twice. Denied attempts are counted as
well. The count and the window are starting points to tune. For role
sessions the principal is the session ARN, so one role used with
different session names is counted per session.
references:
- https://docs.aws.amazon.com/secretsmanager/latest/userguide/cloudtrail_log_entries.html
- https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html
- https://repost.aws/knowledge-center/secrets-manager-arn
- https://attack.mitre.org/techniques/T1555/006/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1555.006
correlation:
type: value_count
rules:
- aws_secrets_manager_secret_value_retrieved
group-by:
- userIdentity.arn
timespan: 10m
condition:
field: requestParameters.secretId
gte: 10
falsepositives:
- Secret rotation jobs, backup and inventory tools, and platform services that load the secrets of many applications, such as a secrets operator in a cluster. Exclude the roles they use.
- Deployments that start many services at once under one role. Give such roles a higher count.
- The values of 10 different secrets and 10 minutes are starting points, not tested limits. Measure what your own workloads produce and adjust both.
level: medium
False positives
- Secret rotation jobs, backup and inventory tools, and platform services that load the secrets of many applications, such as a secrets operator in a cluster. Exclude the roles they use.
- Deployments that start many services at once under one role. Give such roles a higher count.
- The values of 10 different secrets and 10 minutes are starting points, not tested limits. Measure what your own workloads produce and adjust both.
Resource Policy Attached to an AWS Secrets Manager Secret
Detects PutResourcePolicy calls to Secrets Manager, which attach or replace the resource policy of a secret. A resource policy can let another principal, including one in another account, read the secret value, so it is a way to keep access to a secret after the access of the calling identity is removed. The rule cannot tell who the policy admits: read the policy in the request parameters. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: Resource Policy Attached to an AWS Secrets Manager Secret
id: ade84f0e-e7a2-4ed6-b27a-954fd7d37163
status: experimental
description: >-
Detects PutResourcePolicy calls to Secrets Manager, which attach or replace
the resource policy of a secret. A resource policy can let another principal,
including one in another account, read the secret value, so it is a way to
keep access to a secret after the access of the calling identity is removed.
The rule cannot tell who the policy admits: read the policy in the request
parameters.
It also matches attempts that failed (errorCode present): check errorCode,
because an unauthorized attempt is worth seeing.
references:
- https://docs.aws.amazon.com/secretsmanager/latest/userguide/cloudtrail_log_entries.html
- https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_PutResourcePolicy.html
- https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples_cross.html
- https://attack.mitre.org/techniques/T1555/006/
author: Forestall
date: 2026-11-14
tags:
- attack.credential-access
- attack.t1555.006
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: secretsmanager.amazonaws.com
eventName: PutResourcePolicy
condition: selection
falsepositives:
- Infrastructure-as-code pipelines and platform teams that set resource policies when a secret is created, or share a secret with another account on purpose. Add the deployment roles to a filter_* selection on userIdentity.arn and review calls made by anyone else.
- Policies that only restrict access (deny statements) also match.
level: medium
False positives
- Infrastructure-as-code pipelines and platform teams that set resource policies when a secret is created, or share a secret with another account on purpose. Add the deployment roles to a filter_* selection on userIdentity.arn and review calls made by anyone else.
- Policies that only restrict access (deny statements) also match.
Secrets Retrieved in a Batch From AWS Secrets Manager
Detects BatchGetSecretValue calls, which return the values of up to 20 Secrets Manager secrets in one request, selected by name or by filter. Applications usually read one secret at a time with GetSecretValue, so a batch call from an identity that does not normally make one deserves a look. Secrets Manager also writes a GetSecretValue entry for each secret requested; use those to see which secrets were involved. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: Secrets Retrieved in a Batch From AWS Secrets Manager
id: b6dd27c9-e5f4-4cbd-a365-42f54faf2e17
status: experimental
description: >-
Detects BatchGetSecretValue calls, which return the values of up to 20
Secrets Manager secrets in one request, selected by name or by filter.
Applications usually read one secret at a time with GetSecretValue, so a
batch call from an identity that does not normally make one deserves a look.
Secrets Manager also writes a GetSecretValue entry for each secret requested;
use those to see which secrets were involved.
It also matches attempts that failed (errorCode present): check errorCode,
because an unauthorized attempt is worth seeing.
references:
- https://docs.aws.amazon.com/secretsmanager/latest/userguide/cloudtrail_log_entries.html
- https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_BatchGetSecretValue.html
- https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_finding-types-iam.html
- https://attack.mitre.org/techniques/T1555/006/
author: Forestall
date: 2026-11-14
tags:
- attack.credential-access
- attack.t1555.006
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: secretsmanager.amazonaws.com
eventName: BatchGetSecretValue
condition: selection
falsepositives:
- Applications, deployment tools and secret-loading components that fetch several secrets in one call. They do it on every start or refresh, from the same role; add those roles to a filter_* selection on userIdentity.arn once confirmed.
- Administrators and audit scripts that export or compare secrets. Confirm the change record; a person reading many production secrets is rarely routine.
level: medium
False positives
- Applications, deployment tools and secret-loading components that fetch several secrets in one call. They do it on every start or refresh, from the same role; add those roles to a filter_* selection on userIdentity.arn once confirmed.
- Administrators and audit scripts that export or compare secrets. Confirm the change record; a person reading many production secrets is rarely routine.
Triage
- Identify the caller (userIdentity.arn), the source IP address and the user agent. Is this a workload that normally loads secrets in a batch, calling from where it normally runs?
- Find the GetSecretValue entries written for the same caller at the same time; they name the secrets that were requested.
- Look for ListSecrets calls and for denied GetSecretValue calls (errorCode present) by the same principal shortly before. Listing everything and probing what is readable is collection, not application behaviour.
- For PutResourcePolicy, read the policy in the request parameters. A principal from another account, or a wildcard principal, needs an owner and a reason.
- If the activity is not explained, rotate every secret the principal could read, revoke its sessions and review what the stolen credentials give access to.
Response
Once the attack is confirmed:
- Stop the reading. Revoke the active sessions of the role that made the calls, or deactivate the access keys if it was an IAM user, and narrow its policy before the identity is used again.
- Remove resource policy statements that admit a principal you do not recognize, on every secret the caller could change and not only on the one in the alert.
- Rotate the secrets the principal could read, starting with those named in the
GetSecretValueentries and with credentials for systems that can be reached from the internet. A stolen value stays valid until its secret is rotated. - Review the logs of the systems the secrets protect, such as databases, SaaS platforms and other cloud accounts, for use of the stolen credentials. CloudTrail does not see that activity.
- Afterwards, confirm that no secret has cross-account access you did not intend and that the identity can read only the secrets it needs.
Mitigation
- Allow secretsmanager:GetSecretValue only on the secret ARNs each workload needs; remove statements that allow it on every resource and wildcard actions such as
secretsmanager:*. - Allow secretsmanager:BatchGetSecretValue only to the workloads that really load several secrets in one call.
- Encrypt sensitive secrets with a customer managed KMS key and restrict its key policy, so that an over-broad IAM policy alone is not enough to read them.
- Require the condition key
secretsmanager:BlockPublicPolicyin every policy that allows secretsmanager:PutResourcePolicy, and review cross-account access to secrets with IAM Access Analyzer. - Turn on automatic rotation, so that a stolen value stops working without anyone having to notice the theft.
Frequently asked questions
Why is there no rule on GetSecretValue itself?
Every application that uses Secrets Manager calls `GetSecretValue` all day, so a rule on that event alone is noise. The batch call and a resource policy change are far less common, which makes them usable as alerts. An attacker who reads secrets one at a time is matched only by the threshold rule, which counts the different secrets one principal requests in a short window.
How do I see which secrets a batch call asked for?
A batch call writes one `BatchGetSecretValue` entry and a `GetSecretValue` entry for each secret requested. Search for the `GetSecretValue` entries of the same caller at the same time to get the list. One batch call can return up to 20 secrets, chosen by name or by a filter.
Do these rules cover Systems Manager Parameter Store?
No. Parameter Store keeps the same kind of data in SecureString parameters, but the rules on this page match only events of `secretsmanager.amazonaws.com`. Reads of parameters need their own detection.
Does the resource policy rule tell me who was given access to the secret?
No. It fires on every `PutResourcePolicy` call to Secrets Manager, including policies that only restrict access. Read the policy in the request parameters. A principal from another account, or a wildcard principal, needs an owner and a reason.
References
- MITRE ATT&CK T1555.006: Cloud Secrets Management Stores
- AWS CloudTrail entries for Secrets Manager
- Secrets Manager API Reference: BatchGetSecretValue
- Secrets Manager API Reference: PutResourcePolicy
- Access AWS Secrets Manager secrets from a different account
- AWS Secrets Manager best practices
- What is AWS Secrets Manager (all events are logged as management events)
- GuardDuty IAM finding types (CredentialAccess:IAMUser/AnomalousBehavior)
- Revoke IAM role temporary security credentials