Skip to content

Commit 683b4f8

Browse files
committed
chore(aws): adapt metadata to new standard per metadata guidelines
1 parent d415f4e commit 683b4f8

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
11
{
22
"Provider": "aws",
33
"CheckID": "secretsmanager_has_restrictive_resource_policy",
4-
"CheckTitle": "Ensure Secrets Manager secrets have restrictive resource-based policies.",
4+
"CheckTitle": "Secrets Manager secret has a restrictive resource-based policy",
55
"CheckType": [
6-
"Software and Configuration Checks/AWS Security Best Practices"
6+
"Software and Configuration Checks/AWS Security Best Practices",
7+
"Effects/Data Exposure"
78
],
89
"ServiceName": "secretsmanager",
910
"SubServiceName": "",
1011
"ResourceIdTemplate": "arn:aws:secretsmanager:region:account-id:secret:secret-name",
1112
"Severity": "high",
1213
"ResourceType": "AwsSecretsManagerSecret",
13-
"Description": "This check verifies whether Secrets Manager secrets have resource-based policies that restrict access.",
14-
"Risk": "Secrets without restrictive resource-based policies may be accessed by unauthorized entities, leading to potential data breaches.",
15-
"RelatedUrl": "https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-policies.html",
14+
"ResourceGroup": "security",
15+
"Description": "**AWS Secrets Manager secrets** are evaluated for **restrictive resource-based policies**. The policy must include an explicit **Deny** for unauthorized principals, restrict access to the **AWS Organization**, limit each principal to **specific actions** via `NotAction`, and constrain AWS service access with `aws:SourceAccount`.",
16+
"Risk": "Without a restrictive resource policy, **any IAM principal** in the account—or even **cross-account entities**—can read, modify, or delete the secret, compromising **confidentiality** and **integrity**. Overly broad policies enable **lateral movement** and **privilege escalation** through exposed credentials.",
17+
"RelatedUrl": "",
18+
"AdditionalURLs": [
19+
"https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-policies.html",
20+
"https://docs.aws.amazon.com/secretsmanager/latest/userguide/determine-acccess_examine-iam-policies.html"
21+
],
1622
"Remediation": {
1723
"Code": {
18-
"CLI": "",
19-
"NativeIaC": "",
20-
"Other": "",
21-
"Terraform": ""
24+
"CLI": "aws secretsmanager put-resource-policy --secret-id <example_resource_id> --resource-policy file://policy.json",
25+
"NativeIaC": "```yaml\nResources:\n <example_resource_name>:\n Type: AWS::SecretsManager::ResourcePolicy\n Properties:\n SecretId: <example_resource_id>\n ResourcePolicy: # Critical: deny-by-default with explicit exceptions\n Version: '2012-10-17'\n Statement:\n - Effect: Deny\n Principal: '*'\n Action: '*'\n Resource: '*'\n Condition:\n StringNotEquals:\n aws:PrincipalArn: <AUTHORIZED_ROLE_ARN>\n```",
26+
"Other": "1. Open AWS Console > Secrets Manager\n2. Select the secret > Overview tab > Resource permissions > Edit permissions\n3. Add a **Deny** statement for `Principal: *` with `StringNotEquals` condition listing only authorized `aws:PrincipalArn` values\n4. Add a **Deny** statement with `StringNotEquals` on `aws:PrincipalOrgID` to block access from outside your organization\n5. For each authorized principal, add a **Deny** with `NotAction` listing only the specific actions they need\n6. Save the policy",
27+
"Terraform": "```hcl\nresource \"aws_secretsmanager_secret_policy\" \"<example_resource_name>\" {\n secret_arn = \"<example_resource_id>\"\n policy = jsonencode({ # Critical: deny-by-default with explicit exceptions\n Version = \"2012-10-17\"\n Statement = [\n {\n Effect = \"Deny\"\n Principal = \"*\"\n Action = \"*\"\n Resource = \"*\"\n Condition = {\n StringNotEquals = {\n \"aws:PrincipalArn\" = [\"<AUTHORIZED_ROLE_ARN>\"]\n }\n }\n }\n ]\n })\n}\n```"
2228
},
2329
"Recommendation": {
24-
"Text": "Ensure that Secrets Manager policies restrict access to authorized principals only, following the Principle of Least Privilege.",
25-
"Url": "https://docs.aws.amazon.com/secretsmanager/latest/userguide/determine-acccess_examine-iam-policies.html"
30+
"Text": "Apply **deny-by-default** resource policies to every secret:\n- Deny all principals except explicitly authorized roles via `StringNotEquals` on `aws:PrincipalArn`\n- Deny access from outside the AWS Organization via `aws:PrincipalOrgID`\n- Restrict each authorized principal to **least-privilege actions** using `NotAction`\n- Constrain AWS service access with `aws:SourceAccount`",
31+
"Url": "https://hub.prowler.com/check/secretsmanager_has_restrictive_resource_policy"
2632
}
2733
},
2834
"Categories": [
29-
"access-control"
35+
"secrets",
36+
"trust-boundaries"
3037
],
3138
"DependsOn": [],
3239
"RelatedTo": [],
33-
"Notes": ""
40+
"Notes": "This check enforces a strict deny-by-default pattern for Secrets Manager resource policies. It validates four layered controls: (1) an explicit Deny for all unauthorized principals, (2) an organization boundary via PrincipalOrgID, (3) per-principal action restrictions via NotAction, and (4) SourceAccount constraints for AWS service principals. Cross-account Allow statements cause the check to fail intentionally to surface expanded trust boundaries for review."
3441
}

0 commit comments

Comments
 (0)