Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GROW-2556): enable azure storage account infra encryption #1431

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lwgenerate/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ func createActivityLog(args *GenerateAzureTfConfigurationArgs) ([]*hclwrite.Bloc
attributes["storage_account_resource_group"] = args.StorageAccountResourceGroup
}

// if a new storage account is being created (i.e., ExistingStorageAccount is false), enable infrastructure
// encryption
if !args.ExistingStorageAccount {
attributes["infrastructure_encryption_enabled"] = true
}

// Set the location if needed
if args.StorageLocation != "" {
attributes["location"] = args.StorageLocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ module "az_ad_application" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
all_subscriptions = true
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
all_subscriptions = true
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ module "az_ad_application" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ module "az_ad_application" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
service_principal_id = module.az_ad_application.service_principal_id
subscription_ids = ["test-id-1", "test-id-2", "test-id-3"]
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
service_principal_id = module.az_ad_application.service_principal_id
subscription_ids = ["test-id-1", "test-id-2", "test-id-3"]
use_existing_ad_application = true
}
15 changes: 8 additions & 7 deletions lwgenerate/azure/test-data/activity-log-with-location.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ module "az_ad_application" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
location = "West US 2"
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
location = "West US 2"
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}
13 changes: 7 additions & 6 deletions lwgenerate/azure/test-data/activity_log_with_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ module "az_config" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}
13 changes: 7 additions & 6 deletions lwgenerate/azure/test-data/activity_log_without_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ module "az_ad_application" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}
15 changes: 8 additions & 7 deletions lwgenerate/azure/test-data/customer-ad-details.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ module "az_config" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = "AD-Test-Application-ID"
application_password = "AD-Test-Password"
lacework_integration_name = "Test Activity Log Rename"
service_principal_id = "AD-Test-Principal-ID"
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = "AD-Test-Application-ID"
application_password = "AD-Test-Password"
infrastructure_encryption_enabled = true
lacework_integration_name = "Test Activity Log Rename"
service_principal_id = "AD-Test-Principal-ID"
use_existing_ad_application = true
}
15 changes: 8 additions & 7 deletions lwgenerate/azure/test-data/renamed_activity_log.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ module "az_ad_application" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
lacework_integration_name = "Test Activity Log Rename"
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
lacework_integration_name = "Test Activity Log Rename"
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}
15 changes: 8 additions & 7 deletions lwgenerate/azure/test-data/renamed_config_and_activity_log.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ module "az_config" {
}

module "az_activity_log" {
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
lacework_integration_name = "Test Activity Log Rename"
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
source = "lacework/activity-log/azure"
version = "~> 2.0"
application_id = module.az_ad_application.application_id
application_password = module.az_ad_application.application_password
infrastructure_encryption_enabled = true
lacework_integration_name = "Test Activity Log Rename"
service_principal_id = module.az_ad_application.service_principal_id
use_existing_ad_application = true
}