A Lambda function needs to read the current value of exactly one AWS Secrets Manager secret at startup. Which least-privilege IAM permission (action and resource scope) should you grant to the Lambda execution role?
Trap 1: secretsmanager:ListSecrets on all secrets (resource set to "*")
ListSecrets only returns metadata such as secret names, ARNs, and description fields, not the actual secret values. Setting Resource to '*' would permit the role to enumerate every secret in the account, which violates least privilege and creates a broad reconnaissance surface for any compromise. Because the Lambda already knows the exact secret it must read, listing secrets is entirely unnecessary for the scenario.
Trap 2: secretsmanager:UpdateSecret on the specific secret ARN
UpdateSecret is a write operation that modifies the secret's value or rotates it, but performing an update does not return the current secret value to the caller. Even when scoped to the specific secret ARN, this action grants unnecessary write access; if the Lambda role is compromised, an attacker could maliciously change the secret and potentially disrupt downstream applications. A read-only role should never include UpdateSecret because it expands the blast radius beyond the functional need.
Trap 3: secretsmanager:DescribeSecret on all secrets (resource set to "*")
DescribeSecret is a metadata-only call that returns details such as the secret's ARN, name, description, rotation configuration, and last-changed dates, but it never exposes the secret's value. Specifying '*' for the resource expands the permission to every secret in the account without providing any benefit, since the function already has the secret's full ARN. This permission is therefore both insufficient and overly broad—it cannot satisfy the read requirement and it grants far more access than needed.
- A
secretsmanager:ListSecrets on all secrets (resource set to "*")
Why wrong: ListSecrets only returns metadata such as secret names, ARNs, and description fields, not the actual secret values. Setting Resource to '*' would permit the role to enumerate every secret in the account, which violates least privilege and creates a broad reconnaissance surface for any compromise. Because the Lambda already knows the exact secret it must read, listing secrets is entirely unnecessary for the scenario.
- B
secretsmanager:GetSecretValue on only the secret’s full ARN
GetSecretValue is the only AWS Secrets Manager API action that returns the encrypted secret's decrypted string, which is exactly what the Lambda function must read. By restricting the Action to secretsmanager:GetSecretValue and the Resource to the secret's full ARN, the IAM policy grants access to that single secret while denying all other Secrets Manager operations. This follows least privilege because the function cannot update, list, or describe any other secret, and the full ARN is more precise than using a wildcard or partial name.
- C
secretsmanager:UpdateSecret on the specific secret ARN
Why wrong: UpdateSecret is a write operation that modifies the secret's value or rotates it, but performing an update does not return the current secret value to the caller. Even when scoped to the specific secret ARN, this action grants unnecessary write access; if the Lambda role is compromised, an attacker could maliciously change the secret and potentially disrupt downstream applications. A read-only role should never include UpdateSecret because it expands the blast radius beyond the functional need.
- D
secretsmanager:DescribeSecret on all secrets (resource set to "*")
Why wrong: DescribeSecret is a metadata-only call that returns details such as the secret's ARN, name, description, rotation configuration, and last-changed dates, but it never exposes the secret's value. Specifying '*' for the resource expands the permission to every secret in the account without providing any benefit, since the function already has the secret's full ARN. This permission is therefore both insufficient and overly broad—it cannot satisfy the read requirement and it grants far more access than needed.