@@ -41,21 +41,31 @@ resource "azurerm_role_assignment" "sysdig_reader" {
41
41
role_definition_name = " Reader"
42
42
principal_id = azuread_service_principal. sysdig_sp . object_id
43
43
}
44
-
45
44
# ---------------------------------------------------------------------------------------------
46
- # Assign "Azure Kubernetes Service Cluster User Role" role to Sysdig SP for primary subscription
45
+ # Create a Custom role for collecting authsettings
47
46
# ---------------------------------------------------------------------------------------------
48
- resource "azurerm_role_assignment" "sysdig_k8s_reader" {
49
- scope = data. azurerm_subscription . primary . id
50
- role_definition_name = " Azure Kubernetes Service Cluster User Role"
51
- principal_id = azuread_service_principal. sysdig_sp . object_id
47
+ resource "azurerm_role_definition" "sysdig_cspm_role" {
48
+ name = " sysdig-cspm-role"
49
+ scope = data. azurerm_subscription . primary . id
50
+ description = " Custom role for collecting Authsettings for CIS Benchmark"
51
+
52
+ permissions {
53
+ actions = [
54
+ " Microsoft.Web/sites/config/list/action"
55
+ ]
56
+ not_actions = []
57
+ }
58
+
59
+ assignable_scopes = [
60
+ data . azurerm_subscription . primary . id ,
61
+ ]
52
62
}
53
63
54
64
# ---------------------------------------------------------------------------------------------
55
- # Assign "Virtual Machine User Login" role to Sysdig SP for primary subscription
65
+ # Custom role assignment for collecting authsettings
56
66
# ---------------------------------------------------------------------------------------------
57
- resource "azurerm_role_assignment" "sysdig_vm_user " {
67
+ resource "azurerm_role_assignment" "sysdig_cspm_role_assignment " {
58
68
scope = data. azurerm_subscription . primary . id
59
- role_definition_name = " Virtual Machine User Login "
69
+ role_definition_id = azurerm_role_definition . sysdig_cspm_role . role_definition_resource_id
60
70
principal_id = azuread_service_principal. sysdig_sp . object_id
61
71
}
0 commit comments