-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage defender support (#2030)
* Add storage defender support * Update modules/storage_account/storage_defender.tf Co-authored-by: Arnaud Lheureux <arnaudlh@users.noreply.github.com> * Update modules/storage_account/storage_defender.tf Co-authored-by: Arnaud Lheureux <arnaudlh@users.noreply.github.com> * Update modules/storage_account/storage_defender.tf Co-authored-by: Arnaud Lheureux <arnaudlh@users.noreply.github.com> * Update modules/storage_account/storage_defender.tf Co-authored-by: Arnaud Lheureux <arnaudlh@users.noreply.github.com> * Added example --------- Co-authored-by: Arnaud Lheureux <arnaudlh@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
examples/storage_accounts/112-storage-account-with-defender/configuration.tfvars
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,49 @@ | ||
global_settings = { | ||
default_region = "region1" | ||
regions = { | ||
region1 = "australiaeast" | ||
} | ||
} | ||
|
||
resource_groups = { | ||
test = { | ||
name = "storage-account-defender" | ||
} | ||
} | ||
|
||
# https://docs.microsoft.com/en-us/azure/storage/ | ||
storage_accounts = { | ||
sa1 = { | ||
name = "sa1dev" | ||
# This option is to enable remote RG reference | ||
# resource_group = { | ||
# lz_key = "" | ||
# key = "" | ||
# } | ||
|
||
resource_group_key = "test" | ||
# Account types are BlobStorage, BlockBlobStorage, FileStorage, Storage and StorageV2. Defaults to StorageV2 | ||
account_kind = "BlobStorage" | ||
# Account Tier options are Standard and Premium. For BlockBlobStorage and FileStorage accounts only Premium is valid. | ||
account_tier = "Standard" | ||
# Valid options are LRS, GRS, RAGRS, ZRS, GZRS and RAGZRS | ||
account_replication_type = "LRS" # https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy | ||
tags = { | ||
environment = "dev" | ||
team = "IT" | ||
## | ||
} | ||
containers = { | ||
dev = { | ||
name = "random" | ||
} | ||
} | ||
|
||
defender = { | ||
override_subscription_settings = true | ||
malware_scanning_on_upload = true | ||
malware_scanning_on_upload_cap_gb_per_month = 10 | ||
sensitive_data_discovery_enabled = false | ||
} | ||
} | ||
} |
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,9 @@ | ||
resource "azurerm_security_center_storage_defender" "defender" { | ||
count = can(var.storage_account.defender) ? 1 : 0 | ||
|
||
storage_account_id = azurerm_storage_account.stg.id | ||
override_subscription_settings_enabled = try(var.storage_account.defender.override_subscription_settings, null) | ||
malware_scanning_on_upload_enabled = try(var.storage_account.defender.malware_scanning_on_upload, null) | ||
malware_scanning_on_upload_cap_gb_per_month = try(var.storage_account.defender.malware_scanning_on_upload_cap_gb_per_month, null) | ||
sensitive_data_discovery_enabled = try(var.storage_account.defender.sensitive_data_discovery_enabled, null) | ||
} |