Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Revise metrics filter for UnauthorizedAttemptsAlarm. #51

Merged
merged 2 commits into from
Jun 1, 2022

Conversation

tkimurz
Copy link
Contributor

@tkimurz tkimurz commented May 21, 2022

Exclude calls “Decrypt" event by config.amazonaws.com to ignore innocuous errors caused by AWS Config.
That error occurs when Lambda function has a KMS (CMK) encrypted environment variable.

Sample error logged in CloudTrail:

{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "XXXXXXXXXXXXXXXXXXXXX:LambdaDescribeHandlerSession",
-- snip ---
        "invokedBy": "config.amazonaws.com"
    },
    "eventTime": "2021-10-30T02:19:55Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "Decrypt",
    "awsRegion": "ap-northeast-1",
    "sourceIPAddress": "config.amazonaws.com",
    "userAgent": "config.amazonaws.com",
    "errorCode": "AccessDenied",
    "errorMessage": "User: arn:aws:sts::000000000000:assumed-role/aws-controltower-ConfigRecorderRole/LambdaDescribeHandlerSession is not authorized to perform: kms:Decrypt on resource: arn:aws:kms:ap-northeast-1:000000000000:key/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx because no resource-based policy allows the kms:Decrypt action",
-- snip --
}

@ohmurayu ohmurayu merged commit 6dd30b4 into aws-samples:main Jun 1, 2022
@tkimurz tkimurz deleted the feature/revise_metrics_filter branch June 3, 2022 09:20
terayas pushed a commit to terayas/baseline-environment-on-aws that referenced this pull request Jun 13, 2022
…es#51)

* feat: Revise metrics filter for UnauthorizedAttemptsAlarm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants