Skip to content

Commit f6456b9

Browse files
Merge pull request #1135 from NHSDigital/feature/kabo5-NRL-1826-immutable-backups-compliance-mode
NRL-1826 enable compliance mode
2 parents 0ff9896 + 33b2cc6 commit f6456b9

2 files changed

Lines changed: 2 additions & 25 deletions

File tree

terraform/backup-infrastructure/modules/aws-backup-destination/backup_vault_policy.tf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,4 @@ data "aws_iam_policy_document" "vault_policy" {
4141
resources = ["*"]
4242
}
4343
}
44-
45-
dynamic "statement" {
46-
for_each = var.enable_vault_protection ? [1] : []
47-
content {
48-
sid = "DenyBackupCopyExceptToSourceAccount"
49-
effect = "Deny"
50-
51-
principals {
52-
type = "AWS"
53-
identifiers = ["arn:aws:iam::${var.account_id}:root"]
54-
}
55-
actions = [
56-
"backup:CopyFromBackupVault"
57-
]
58-
resources = ["*"]
59-
condition {
60-
test = "StringNotEquals"
61-
variable = "backup:CopyTargets"
62-
values = [
63-
"arn:aws:backup:${var.region}:${var.source_account_id}:backup-vault:${var.region}-${var.source_account_id}-backup-vault"
64-
]
65-
}
66-
}
67-
}
6844
}

terraform/backup-infrastructure/prod/aws-backup.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module "destination" {
2828
account_id = local.destination_account_id
2929
source_account_id = local.source_account_id
3030
kms_key = aws_kms_key.destination_backup_key.arn
31-
enable_vault_protection = false
31+
enable_vault_protection = true
32+
vault_lock_type = "compliance"
3233
}
3334

3435
###

0 commit comments

Comments
 (0)