-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller-profile.tf
More file actions
44 lines (42 loc) · 1.17 KB
/
controller-profile.tf
File metadata and controls
44 lines (42 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
data "aws_iam_policy_document" "controller" {
# checkov:skip=CKV2_AWS_40: "Ensure AWS IAM policy does not allow full IAM privileges"
# checkov:skip=CKV_AWS_49: "Ensure no IAM policies documents allow "*" as a statement's actions"
# checkov:skip=CKV_AWS_107: "Ensure IAM policies does not allow credentials exposure"
statement {
sid = "AllowDescribeClusters"
effect = "Allow"
actions = [
"cloudhsm:DescribeClusters"
]
resources = [
"*"
]
}
statement {
sid = "AllowAllInCluster"
effect = "Allow"
actions = [
"*"
]
resources = [
"*"
# "arn:aws:cloudhsm:${local.region}:${local.account_id}:cluster/${aws_cloudhsm_v2_cluster.cluster.cluster_id}"
]
}
statement {
sid = "AllowAllOnBackups"
effect = "Allow"
actions = [
"*"
]
resources = [
"arn:aws:cloudhsm:${local.region}:${local.account_id}:backup/*" # TODO: reconsider
]
}
}
resource "aws_iam_policy" "controller" {
name = "${local._deployment}-controller"
path = "/"
description = "Policy for the ${local._deployment} controller"
policy = data.aws_iam_policy_document.controller.json
}