Skip to content

Commit 3317c0a

Browse files
chore(aws): enhance metadata for ec2 service (#9549)
Co-authored-by: Daniel Barranquero <[email protected]>
1 parent 8476455 commit 3317c0a

File tree

71 files changed

+1359
-861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1359
-861
lines changed

prowler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
5252
- Update AWS IAM service metadata to new format [(#9550)](https://github.com/prowler-cloud/prowler/pull/9550)
5353
- Enhance `user_registration_details` perfomance and user `mfa` evaluation [(#9236)](https://github.com/prowler-cloud/prowler/pull/9236)
5454
- Update AWS Cognito service metadata to new format [(#8853)](https://github.com/prowler-cloud/prowler/pull/8853)
55+
- Update AWS EC2 service metadata to new format [(#9549)](https://github.com/prowler-cloud/prowler/pull/9549)
5556

5657
---
5758

prowler/providers/aws/services/ec2/ec2_ami_public/ec2_ami_public.metadata.json

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
{
22
"Provider": "aws",
33
"CheckID": "ec2_ami_public",
4-
"CheckTitle": "Ensure there are no EC2 AMIs set as Public.",
4+
"CheckTitle": "EC2 AMI owned by the account is not public",
55
"CheckType": [
6-
"Infrastructure Security"
6+
"Software and Configuration Checks/AWS Security Best Practices",
7+
"Effects/Data Exposure"
78
],
89
"ServiceName": "ec2",
9-
"SubServiceName": "ami",
10-
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id",
10+
"SubServiceName": "",
11+
"ResourceIdTemplate": "",
1112
"Severity": "critical",
1213
"ResourceType": "Other",
1314
"ResourceGroup": "compute",
14-
"Description": "Ensure there are no EC2 AMIs set as Public.",
15-
"Risk": "When your AMIs are publicly accessible, they are available in the Community AMIs where everyone with an AWS account can use them to launch EC2 instances. Your AMIs could contain snapshots of your applications (including their data), therefore exposing your snapshots in this manner is not advised.",
15+
"Description": "**EC2 AMIs owned by the account** are evaluated for **public visibility** via their launch permissions. Images shared with all accounts (`Group=all`) are treated as publicly accessible.",
16+
"Risk": "Public AMIs expose image contents to any AWS account, undermining **confidentiality** and **integrity**:\n- Leakage of embedded secrets, configs, or data from referenced snapshots\n- Adversaries can fingerprint your stack, aiding targeted exploits or repackaging for supply chain abuse",
1617
"RelatedUrl": "",
18+
"AdditionalURLs": [
19+
"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cancel-sharing-an-AMI.html",
20+
"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-explicit.html",
21+
"https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-image-attribute.html",
22+
"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html"
23+
],
1724
"Remediation": {
1825
"Code": {
19-
"CLI": "aws ec2 modify-image-attribute --region <REGION> --image-id <EC2_AMI_ID> --launch-permission {\"Remove\":[{\"Group\":\"all\"}]}",
26+
"CLI": "aws ec2 modify-image-attribute --image-id <EC2_AMI_ID> --launch-permission \"Remove=[{Group=all}]\"",
2027
"NativeIaC": "",
21-
"Other": "https://docs.prowler.com/checks/aws/public-policies/public_8",
28+
"Other": "1. Open the Amazon EC2 console and go to AMIs\n2. Select the AMI with Visibility = Public\n3. Click Actions > Edit AMI permissions\n4. Under AMI availability, select Private\n5. Click Save changes",
2229
"Terraform": ""
2330
},
2431
"Recommendation": {
25-
"Text": "We recommend your EC2 AMIs are not publicly accessible, or generally available in the Community AMIs.",
26-
"Url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cancel-sharing-an-AMI.html"
32+
"Text": "Keep AMIs **private** and enforce **least privilege** launch permissions. Share only with specific accounts and review access routinely. Enable **block public access for AMIs**, sanitize images to remove secrets, encrypt backing snapshots, and apply lifecycle governance to retire outdated images.",
33+
"Url": "https://hub.prowler.com/check/ec2_ami_public"
2734
}
2835
},
2936
"Categories": [

prowler/providers/aws/services/ec2/ec2_client_vpn_endpoint_connection_logging_enabled/ec2_client_vpn_endpoint_connection_logging_enabled.metadata.json

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,41 @@
11
{
22
"Provider": "aws",
33
"CheckID": "ec2_client_vpn_endpoint_connection_logging_enabled",
4-
"CheckTitle": "EC2 Client VPN endpoints should have client connection logging enabled.",
5-
"CheckType": [],
4+
"CheckTitle": "EC2 Client VPN endpoint has client connection logging enabled",
5+
"CheckType": [
6+
"Software and Configuration Checks/AWS Security Best Practices",
7+
"Software and Configuration Checks/Industry and Regulatory Standards/AWS Foundational Security Best Practices",
8+
"Software and Configuration Checks/Industry and Regulatory Standards/NIST 800-53 Controls (USA)"
9+
],
610
"ServiceName": "ec2",
711
"SubServiceName": "",
8-
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id",
12+
"ResourceIdTemplate": "",
913
"Severity": "low",
1014
"ResourceType": "AwsEc2ClientVpnEndpoint",
1115
"ResourceGroup": "network",
12-
"Description": "This control checks whether an AWS Client VPN endpoint has client connection logging enabled. The control fails if the endpoint doesn't have client connection logging enabled.",
13-
"Risk": "Client VPN endpoints allow remote clients to securely connect to resources in a Virtual Private Cloud (VPC) in AWS. Connection logs allow you to track user activity on the VPN endpoint and provides visibility.",
14-
"RelatedUrl": "https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/what-is.html",
16+
"Description": "**AWS Client VPN endpoints** are evaluated for **client connection logging** that records client connect/disconnect events to CloudWatch Logs. The evaluation detects endpoints where this logging is disabled.",
17+
"Risk": "Without **Client VPN connection logs**, remote access lacks an **audit trail**, reducing detection and accountability.\n- Stolen credentials can be used unnoticed\n- Lateral movement and data exfiltration persist\nImpacts **confidentiality** and **integrity**; delayed investigation can degrade **availability**.",
18+
"RelatedUrl": "",
19+
"AdditionalURLs": [
20+
"https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/what-is.html",
21+
"https://docs.aws.amazon.com/securityhub/latest/userguide/ec2-controls.html#ec2-51",
22+
"https://docs.aws.amazon.com/config/latest/developerguide/ec2-client-vpn-connection-log-enabled.html"
23+
],
1524
"Remediation": {
1625
"Code": {
17-
"CLI": "",
18-
"NativeIaC": "",
19-
"Other": "https://docs.aws.amazon.com/securityhub/latest/userguide/ec2-controls.html#ec2-51",
20-
"Terraform": ""
26+
"CLI": "aws ec2 modify-client-vpn-endpoint --client-vpn-endpoint-id <CLIENT_VPN_ENDPOINT_ID> --connection-log-options Enabled=true,CloudWatchLogGroup=<CLOUDWATCH_LOG_GROUP_NAME>",
27+
"NativeIaC": "```yaml\n# CloudFormation: enable connection logging on a Client VPN endpoint\nResources:\n <example_resource_name>:\n Type: AWS::EC2::ClientVpnEndpoint\n Properties:\n ClientCidrBlock: 10.0.0.0/22\n ServerCertificateArn: arn:aws:acm:<REGION>:<ACCOUNT_ID>:certificate/<example_resource_id>\n AuthenticationOptions:\n - Type: certificate-authentication\n MutualAuthentication:\n ClientRootCertificateChainArn: arn:aws:acm:<REGION>:<ACCOUNT_ID>:certificate/<example_resource_id>\n ConnectionLogOptions: # CRITICAL: enables client connection logging\n Enabled: true # CRITICAL: turns on logging\n CloudWatchLogGroup: <example_resource_name> # CRITICAL: destination log group\n```",
28+
"Other": "1. Open the Amazon VPC console and go to Client VPN Endpoints\n2. Select the endpoint and choose Actions > Modify client VPN endpoint\n3. Under Connection logging, check Enable\n4. For CloudWatch log group, select an existing log group\n5. Click Save changes",
29+
"Terraform": "```hcl\n# Terraform: enable connection logging on a Client VPN endpoint\nresource \"aws_ec2_client_vpn_endpoint\" \"<example_resource_name>\" {\n server_certificate_arn = \"arn:aws:acm:<REGION>:<ACCOUNT_ID>:certificate/<example_resource_id>\"\n client_cidr_block = \"10.0.0.0/22\"\n\n authentication_options {\n type = \"certificate-authentication\"\n root_certificate_chain_arn = \"arn:aws:acm:<REGION>:<ACCOUNT_ID>:certificate/<example_resource_id>\"\n }\n\n connection_log_options { # CRITICAL: enables client connection logging\n enabled = true # CRITICAL: turns on logging\n cloudwatch_log_group = \"<example_resource_name>\" # CRITICAL: destination log group\n }\n}\n```"
2130
},
2231
"Recommendation": {
23-
"Text": "To enable connection logging, see Enable connection logging for an existing Client VPN endpoint in the AWS Client VPN Administrator Guide.",
24-
"Url": "https://docs.aws.amazon.com/config/latest/developerguide/ec2-client-vpn-connection-log-enabled.html"
32+
"Text": "Enable **client connection logging** on all Client VPN endpoints and send events to a centralized log group.\n- Enforce least privilege on log access\n- Define retention and immutability\n- Integrate with monitoring/alerts\n- Separate VPN operations from log administration\n- Review anomalous login patterns",
33+
"Url": "https://hub.prowler.com/check/ec2_client_vpn_endpoint_connection_logging_enabled"
2534
}
2635
},
27-
"Categories": [],
36+
"Categories": [
37+
"logging"
38+
],
2839
"DependsOn": [],
2940
"RelatedTo": [],
3041
"Notes": ""

prowler/providers/aws/services/ec2/ec2_ebs_default_encryption/ec2_ebs_default_encryption.metadata.json

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
{
22
"Provider": "aws",
33
"CheckID": "ec2_ebs_default_encryption",
4-
"CheckTitle": "Check if EBS Default Encryption is activated.",
4+
"CheckTitle": "EBS default encryption is enabled",
55
"CheckType": [
6-
"Data Protection"
6+
"Software and Configuration Checks/AWS Security Best Practices",
7+
"Software and Configuration Checks/Industry and Regulatory Standards/AWS Foundational Security Best Practices",
8+
"Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark",
9+
"Effects/Data Exposure"
710
],
811
"ServiceName": "ec2",
9-
"SubServiceName": "ebs",
10-
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id",
11-
"Severity": "medium",
12-
"ResourceType": "Other",
12+
"SubServiceName": "",
13+
"ResourceIdTemplate": "",
14+
"Severity": "high",
15+
"ResourceType": "AwsEc2Volume",
1316
"ResourceGroup": "compute",
14-
"Description": "Check if EBS Default Encryption is activated.",
15-
"Risk": "If not enabled sensitive information at rest is not protected.",
17+
"Description": "**EBS** uses `encryption by default` at the account and region level, ensuring new volumes, snapshots, and AMI-backed volumes are automatically encrypted with a chosen **KMS key**",
18+
"Risk": "Without `encryption by default`, data on new **EBS volumes** and **snapshots** may be stored in plaintext. A compromised account or mis-shared snapshot can expose disk contents, enabling data exfiltration, offline analysis, and loss of **confidentiality**.",
1619
"RelatedUrl": "",
20+
"AdditionalURLs": [
21+
"https://aws.amazon.com/premiumsupport/knowledge-center/ebs-automatic-encryption/",
22+
"https://docs.aws.amazon.com/ebs/latest/userguide/encryption-by-default.html",
23+
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/EBS/configure-default-encryption.html"
24+
],
1725
"Remediation": {
1826
"Code": {
19-
"CLI": "aws ec2 enable-ebs-encryption-by-default",
20-
"NativeIaC": "",
21-
"Other": "https://docs.prowler.com/checks/aws/general-policies/ensure-ebs-default-encryption-is-enabled#aws-console",
22-
"Terraform": "https://docs.prowler.com/checks/aws/general-policies/ensure-ebs-default-encryption-is-enabled#terraform"
27+
"CLI": "aws ec2 enable-ebs-encryption-by-default --region <REGION>",
28+
"NativeIaC": "```yaml\nResources:\n <example_resource_name>:\n Type: AWS::EC2::EBSEncryptionByDefault\n Properties:\n Enabled: true # Critical: turns on default EBS encryption in this region\n```",
29+
"Other": "1. In the AWS console, switch to the affected Region\n2. Go to EC2 > Settings (or Account attributes) > EBS encryption\n3. Click Enable default encryption and Save",
30+
"Terraform": "```hcl\nresource \"aws_ebs_encryption_by_default\" \"<example_resource_name>\" {\n enabled = true # Critical: enables default EBS encryption in this region\n}\n```"
2331
},
2432
"Recommendation": {
25-
"Text": "Enable Encryption. Use a CMK where possible. It will provide additional management and privacy benefits.",
26-
"Url": "https://aws.amazon.com/premiumsupport/knowledge-center/ebs-automatic-encryption/"
33+
"Text": "Enable `EBS encryption by default` in every region and select a **customer-managed KMS key**. Apply **least privilege** to key use, rotate keys, and monitor access. Enforce encrypted volume creation with organizational guardrails and secure templates as **defense in depth**.",
34+
"Url": "https://hub.prowler.com/check/ec2_ebs_default_encryption"
2735
}
2836
},
2937
"Categories": [

prowler/providers/aws/services/ec2/ec2_ebs_public_snapshot/ec2_ebs_public_snapshot.metadata.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
{
22
"Provider": "aws",
33
"CheckID": "ec2_ebs_public_snapshot",
4-
"CheckTitle": "Ensure there are no EBS Snapshots set as Public.",
4+
"CheckTitle": "EBS snapshot is not public",
55
"CheckType": [
6-
"Data Protection"
6+
"Software and Configuration Checks/AWS Security Best Practices",
7+
"Software and Configuration Checks/Industry and Regulatory Standards/AWS Foundational Security Best Practices",
8+
"Effects/Data Exposure"
79
],
810
"ServiceName": "ec2",
9-
"SubServiceName": "snapshot",
10-
"ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id",
11+
"SubServiceName": "",
12+
"ResourceIdTemplate": "",
1113
"Severity": "critical",
12-
"ResourceType": "Other",
14+
"ResourceType": "AwsEc2Volume",
1315
"ResourceGroup": "compute",
14-
"Description": "Ensure there are no EBS Snapshots set as Public.",
15-
"Risk": "When you share a snapshot, you are giving others access to all of the data on the snapshot. Share snapshots only with people with whom you want to share all of your snapshot data.",
16+
"Description": "**EBS snapshots** with **public sharing** permissions (accessible by all AWS accounts) are identified, as opposed to snapshots shared privately with specific accounts.",
17+
"Risk": "Public snapshots expose full volume contents, harming **confidentiality**. Any account can create a volume from the snapshot to read files, secrets, or database data, enabling **data exfiltration**, broad reconnaissance, and facilitating **lateral movement**.",
1618
"RelatedUrl": "",
19+
"AdditionalURLs": [
20+
"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html",
21+
"https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/EBS/public-snapshots.html"
22+
],
1723
"Remediation": {
1824
"Code": {
19-
"CLI": "aws ec2 modify-snapshot-attribute --region <REGION> --snapshot-id <EC2_SNAPSHOT_ID> --attribute createVolumePermission --operation remove --user-ids all",
25+
"CLI": "aws ec2 modify-snapshot-attribute --snapshot-id <EC2_SNAPSHOT_ID> --attribute createVolumePermission --operation-type remove --group-names all",
2026
"NativeIaC": "",
21-
"Other": "https://docs.prowler.com/checks/aws/public-policies/public_7",
27+
"Other": "1. Open the AWS Management Console and go to EC2\n2. In the left menu, select Snapshots\n3. Select the snapshot <EC2_SNAPSHOT_ID>\n4. Click Actions > Modify permissions\n5. Choose Private (remove Public/all if present)\n6. Click Save changes",
2228
"Terraform": ""
2329
},
2430
"Recommendation": {
25-
"Text": "Ensure the snapshot should be shared.",
26-
"Url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html"
31+
"Text": "Keep snapshots **private** and share only with specific accounts under **least privilege**. Enable `Block public access for Amazon EBS snapshots` regionally. Prefer **CMEK encryption** and avoid sharing keys broadly. Regularly review sharing permissions and monitor snapshot usage.",
32+
"Url": "https://hub.prowler.com/check/ec2_ebs_public_snapshot"
2733
}
2834
},
2935
"Categories": [

prowler/providers/aws/services/ec2/ec2_ebs_snapshot_account_block_public_access/ec2_ebs_snapshot_account_block_public_access.metadata.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
{
22
"Provider": "aws",
33
"CheckID": "ec2_ebs_snapshot_account_block_public_access",
4-
"CheckTitle": "Ensure that public access to EBS snapshots is disabled",
4+
"CheckTitle": "All EBS snapshots have public access blocked",
55
"CheckType": [
6-
"Data Protection"
6+
"Software and Configuration Checks/AWS Security Best Practices",
7+
"Software and Configuration Checks/Industry and Regulatory Standards/AWS Foundational Security Best Practices",
8+
"Effects/Data Exposure"
79
],
810
"ServiceName": "ec2",
9-
"SubServiceName": "snapshot",
10-
"ResourceIdTemplate": "arn:partition:service:region:account-id",
11+
"SubServiceName": "",
12+
"ResourceIdTemplate": "",
1113
"Severity": "high",
12-
"ResourceType": "AwsAccount",
13-
"ResourceGroup": "governance",
14-
"Description": "EBS snapshots can be shared with other AWS accounts or made public. By default, EBS snapshots are private and only the AWS account that created the snapshot can access it. If an EBS snapshot is shared with another AWS account or made public, the data in the snapshot can be accessed by the other account or by anyone on the internet. Ensure that public access to EBS snapshots is disabled.",
15-
"Risk": "If public access to EBS snapshots is enabled, the data in the snapshot can be accessed by anyone on the internet.",
16-
"RelatedUrl": "https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots-work.html#block-public-access-snapshots-enable",
14+
"ResourceType": "AwsEc2Volume",
15+
"ResourceGroup": "compute",
16+
"Description": "**EBS snapshots** account/Region configuration for **Block Public Access** is assessed to see whether public sharing is fully blocked (`block-all-sharing`) versus only new sharing (`block-new-sharing`) or unblocked. The state indicates if any snapshot can be publicly shared.",
17+
"Risk": "Without `block-all-sharing`, previously public snapshots can remain accessible, exposing raw disk data.\n\nImpacts:\n- Loss of **confidentiality** (PII, keys, configs)\n- Unauthorized cloning enabling **lateral movement**\n- Cross-account copies create **irreversible data leakage**",
18+
"RelatedUrl": "",
19+
"AdditionalURLs": [
20+
"https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots-work.html#block-public-access-snapshots-enable",
21+
"https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html"
22+
],
1723
"Remediation": {
1824
"Code": {
1925
"CLI": "aws ec2 enable-snapshot-block-public-access --state block-all-sharing",
20-
"NativeIaC": "",
21-
"Other": "",
22-
"Terraform": ""
26+
"NativeIaC": "```yaml\nResources:\n <example_resource_name>:\n Type: AWS::EC2::SnapshotBlockPublicAccess\n Properties:\n State: block-all-sharing # CRITICAL: Blocks all public sharing of EBS snapshots in this Region to pass the check\n```",
27+
"Other": "1. In the AWS console, select the target Region in the top-right.\n2. Go to EC2 > Snapshots.\n3. Click Settings > Block public access for snapshots.\n4. Select Block all sharing.\n5. Click Save changes.",
28+
"Terraform": "```hcl\nresource \"aws_ebs_snapshot_block_public_access\" \"<example_resource_name>\" {\n state = \"block-all-sharing\" # CRITICAL: Blocks all public sharing of EBS snapshots in this Region\n}\n```"
2329
},
2430
"Recommendation": {
25-
"Text": "Use the following procedures to configure and monitor block public access for snapshots.",
26-
"Url": "https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots-work.html#block-public-access-snapshots-enable"
31+
"Text": "Set **Block Public Access** for EBS snapshots to `block-all-sharing` in all active Regions.\n\nApply **least privilege** and guardrails (SCPs) to prevent changes. Regularly inventory snapshots, remove public sharing, and use segregated accounts with strict reviews for any necessary external sharing.",
32+
"Url": "https://hub.prowler.com/check/ec2_ebs_snapshot_account_block_public_access"
2733
}
2834
},
2935
"Categories": [

0 commit comments

Comments
 (0)