Skip to content

Commit

Permalink
Merge pull request #81 from ScaleSec/kms
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenSmiley authored Oct 15, 2024
2 parents 521ac29 + 8db4a22 commit dfacc47
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
33 changes: 33 additions & 0 deletions security_controls_scp/modules/kms/deny_kms_custom_key_store.tf
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
}
5 changes: 5 additions & 0 deletions security_controls_scp/modules/kms/variables.tf
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
}

0 comments on commit dfacc47

Please sign in to comment.