Skip to content

Commit 502a716

Browse files
authored
Create aws_iam_access_keys_policy.yaml
1 parent fcd3f22 commit 502a716

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
id: aws_iam_access_keys_policy
2+
title: AWS IAM Access Key Policy
3+
description: Specifies the maximum age for IAM Access Keys
4+
language: sql
5+
integration_type:
6+
- aws_cloud_account
7+
primary_resource: aws_iam_access_key
8+
definition: |
9+
SELECT
10+
access_key_id AS resource,
11+
platform_integration_id AS platform_integration_id,
12+
platform_resource_id AS platform_resource_id,
13+
CASE
14+
WHEN status <> 'Active' THEN 'skip'
15+
WHEN create_date + ('{{.awsIamAccessKeyAge}}' || ' days')::interval < NOW() THEN 'alarm'
16+
ELSE 'ok'
17+
END AS status,
18+
CASE
19+
WHEN status <> 'Active' THEN 'key is not activated'
20+
WHEN create_date + ('{{.awsIamAccessKeyAge}}' || ' days')::interval < NOW() THEN 'key is too old'
21+
ELSE 'key is not old yet'
22+
END AS reason,
23+
region,
24+
account_id
25+
FROM
26+
aws_iam_access_key v

0 commit comments

Comments
 (0)