Detection rules › Panther

AWS CloudWatch Log Encryption

Severity
informational
Tags
AWS, Panther
Reference
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html
Source
github.com/panther-labs/panther-analysis

AWS automatically performs server-side encryption of logs, but you can encrypt with your own CMK to protect extra sensitive log data.

Rule body yaml

AnalysisType: policy
Filename: aws_cloudwatch_loggroup_encrypted.py
PolicyID: "AWS.CloudWatchLogs.Encrypted"
DisplayName: "AWS CloudWatch Log Encryption"
Enabled: true
ResourceTypes:
  - AWS.CloudWatch.LogGroup
Tags:
  - AWS
  - Panther
Severity: Info
Description: >
  AWS automatically performs server-side encryption of logs, but you can encrypt with your own CMK
  to protect extra sensitive log data.
Runbook: >
  Encrypt the CloudWatch log group with a KMS key, or add this log group to the ignore list.
Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html
Tests:
  - Name: Logs Are Encrypted
    ExpectedResult: true
    Resource:
      {
        "ARN": "arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2",
        "AccountId": "123456789012",
        "Arn": "arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2",
        "CreationTime": 1234567890123,
        "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012",
        "LogGroupName": "LogGroup-2",
        "MetricFilterCount": 0,
        "Name": "LogGroup-2",
        "Region": "us-west-2",
        "ResourceID": "arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2",
        "ResourceType": "AWS.CloudWatch.LogGroup",
        "RetentionInDays": null,
        "StoredBytes": 0,
        "Tags": { "Key1Name": "Value1" },
        "TimeCreated": "2009-02-13T15:31:30.000-08:00",
      }
  - Name: Logs Are Not Encrypted
    ExpectedResult: false
    Resource:
      {
        "ARN": "arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2",
        "AccountId": "123456789012",
        "Arn": "arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2",
        "CreationTime": 1234567890123,
        "KmsKeyId": null,
        "LogGroupName": "LogGroup-2",
        "MetricFilterCount": 0,
        "Name": "LogGroup-2",
        "Region": "us-west-2",
        "ResourceID": "arn:aws:logs:us-west-2:1234456789012:log-group:LogGroup-2",
        "ResourceType": "AWS.CloudWatch.LogGroup",
        "RetentionInDays": null,
        "StoredBytes": 0,
        "Tags": { "Key1Name": "Value1" },
        "TimeCreated": "2009-02-13T15:31:30.000-08:00",
      }

Detection logic

Condition

KmsKeyId not is_not_null

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
KmsKeyIdis_not_null(no value, null check)