Detection rules › Panther
AWS CDE EC2 Volume Encryption
This policy ensures that all EC2 volumes that contain CDE are encrypted. Be sure to configure CDE definitions before enabling this policy.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Collection | T1005 Data from Local System |
Rule body yaml
AnalysisType: policy
Filename: aws_ec2_cde_volume_encrypted.py
PolicyID: "AWS.EC2.CDEVolumeEncrypted"
DisplayName: "AWS CDE EC2 Volume Encryption"
Enabled: false
ResourceTypes:
- AWS.EC2.Volume
Tags:
- AWS
- PCI
- Collection:Data From Local System
Reports:
PCI:
- 3.4
MITRE ATT&CK:
- TA0009:T1005
Severity: Medium
Description: >
This policy ensures that all EC2 volumes that contain CDE are encrypted.
Be sure to configure CDE definitions before enabling this policy.
Runbook: >
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default-api
Reference: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html
Tests:
- Name: Volume Encrypted
ExpectedResult: true
Resource:
{
"AccountId": "123456789012",
"Arn": "arn:aws:ec2:us-west-2:123456789012:volume/vol-1",
"Attachments":
[
{
"AttachTime": "2019-01-01T00:00:00Z",
"DeleteOnTermination": false,
"Device": "/dev/sdf",
"InstanceId": "i-1",
"State": "attached",
"VolumeId": "vol-1",
},
],
"AvailabilityZone": "us-west-2b",
"Encrypted": true,
"Id": "vol-1",
"Iops": 100,
"KmsKeyId": null,
"Region": "us-west-2",
"ResourceId": "arn:aws:ec2:us-west-2:123456789012:volume/vol-1",
"ResourceType": "AWS.EC2.Volume",
"Size": 1,
"SnapshotId": null,
"Snapshots":
[
null,
{
"CreateVolumePermissions": null,
"DataEncryptionKeyId": null,
"Description": "volume snapshot",
"Encrypted": false,
"KmsKeyId": null,
"OwnerAlias": null,
"OwnerId": "123456789012",
"Progress": "100%",
"SnapshotId": "snap-1",
"StartTime": "2019-01-01T00:00:00.000Z",
"State": "completed",
"StateMessage": null,
"Tags": null,
"VolumeId": "vol-1",
"VolumeSize": 1,
},
],
"State": "in-use",
"Tags": { "Key1": "Value1", "Key2": "Value2" },
"TimeCreated": "2019-01-01T00:00:00.000Z",
"VolumeType": "gp2",
}
- Name: Volume Not Encrypted
ExpectedResult: false
Resource:
{
"AccountId": "123456789012",
"Arn": "arn:aws:ec2:us-west-2:123456789012:volume/vol-1",
"Attachments":
[
{
"AttachTime": "2019-01-01T00:00:00Z",
"DeleteOnTermination": false,
"Device": "/dev/sdf",
"InstanceId": "i-1",
"State": "attached",
"VolumeId": "vol-1",
},
],
"AvailabilityZone": "us-west-2b",
"Encrypted": false,
"Id": "vol-1",
"Iops": 100,
"KmsKeyId": null,
"Region": "us-west-2",
"ResourceId": "arn:aws:ec2:us-west-2:123456789012:volume/vol-1",
"ResourceType": "AWS.EC2.Volume",
"Size": 1,
"SnapshotId": null,
"Snapshots":
[
null,
{
"CreateVolumePermissions": null,
"DataEncryptionKeyId": null,
"Description": "volume snapshot",
"Encrypted": false,
"KmsKeyId": null,
"OwnerAlias": null,
"OwnerId": "123456789012",
"Progress": "100%",
"SnapshotId": "snap-1",
"StartTime": "2019-01-01T00:00:00.000Z",
"State": "completed",
"StateMessage": null,
"Tags": null,
"VolumeId": "vol-1",
"VolumeSize": 1,
},
],
"State": "in-use",
"Tags": { "environment": "pci" },
"TimeCreated": "2019-01-01T00:00:00.000Z",
"VolumeType": "gp2",
}
Detection logic
Condition
Encrypted not is_not_null
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
Encrypted | is_not_null |