-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from ScaleSec/kms
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
security_controls_scp/modules/kms/deny_kms_custom_key_store.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#-----security_controls_scp/modules/kms/deny_kms_custom_key_store.tf----# | ||
|
||
data "aws_iam_policy_document" "deny_kms_custom_key_store" { | ||
statement { | ||
sid = "DenyKmsCustomKeyStore" | ||
|
||
actions = [ | ||
"kms:CreateCustomKeyStore", | ||
"kms:UpdateCustomKeyStore", | ||
"kms:ConnectCustomKeyStore", | ||
"kms:DisconnectCustomKeyStore", | ||
"kms:DeleteCustomKeyStore", | ||
] | ||
|
||
resources = [ | ||
"*", | ||
] | ||
|
||
effect = "Deny" | ||
} | ||
} | ||
|
||
resource "aws_organizations_policy" "deny_kms_custom_key_store" { | ||
name = "Deny KMS custom key store" | ||
description = "Deny the ability to use KMS custom key store | ||
content = data.aws_iam_policy_document.deny_kms_custom_key_store.json | ||
} | ||
resource "aws_organizations_policy_attachment" "deny_kms_custom_key_store_attachment" { | ||
policy_id = aws_organizations_policy.deny_kms_custom_key_store.id | ||
target_id = var.target_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#-----security_controls_scp/modules/kms/variables.tf----# | ||
variable "target_id" { | ||
description = "The Root ID, Organizational Unit ID, or AWS Account ID to apply SCPs." | ||
type = string | ||
} |