Skip to content

Commit b28483c

Browse files
fixing data bug and updating README (#15)
1 parent 0ba7d3a commit b28483c

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ Deployment examples can be found [here][].
4444

4545
[here]: https://github.com/corelight/corelight-cloud/tree/main/terraform/azure-scaleset-sensor
4646

47+
#### Least Privilege Deployment
48+
The Corelight Azure sensor can be deployed with the following privileges:
49+
50+
1. The `Network Contributor` built-in role
51+
2. `Microsoft.Compute/images/read` on the Corelight VM Image
52+
3. A custom role definition with the following permissions:
53+
```
54+
"Microsoft.Resources/subscriptions/resourcegroups/read"
55+
"Microsoft.Compute/virtualMachineScaleSets/read"
56+
"Microsoft.Insights/autoScaleSettings/read"
57+
"Microsoft.Compute/virtualMachineScaleSets/write"
58+
"Microsoft.Insights/autoScaleSettings/write"
59+
```
60+
4761
## License
4862

4963
The project is licensed under the [MIT][] license.

data.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
data "azurerm_subnet" "mon_subnet" {
22
name = local.monitoring_subnet_name
3-
resource_group_name = var.resource_group_name
3+
resource_group_name = local.monitoring_subnet_resource_group_name
44
virtual_network_name = local.monitoring_subnet_vnet_name
55
}

locals.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
locals {
2-
monitoring_subnet_resource_id_slice = split("/", var.monitoring_subnet_id)
3-
monitoring_subnet_name = local.monitoring_subnet_resource_id_slice[length(local.monitoring_subnet_resource_id_slice) - 1]
4-
monitoring_subnet_vnet_name = local.monitoring_subnet_resource_id_slice[8]
5-
6-
monitoring_health_check_port = 41080
2+
monitoring_subnet_resource_id_slice = split("/", var.monitoring_subnet_id)
3+
monitoring_subnet_name = local.monitoring_subnet_resource_id_slice[length(local.monitoring_subnet_resource_id_slice) - 1]
4+
monitoring_subnet_resource_group_name = local.monitoring_subnet_resource_id_slice[4]
5+
monitoring_subnet_vnet_name = local.monitoring_subnet_resource_id_slice[8]
6+
monitoring_health_check_port = 41080
77

88
# https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-custom-probe-overview#probe-source-ip-address
99
azure_lb_health_check_probe_ip = "168.63.129.16/32"

sensor_config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module "sensor_config" {
1313
sensor_monitoring_interface_name = "eth1"
1414
sensor_health_check_probe_source_ranges_cidr = [local.azure_lb_health_check_probe_ip]
1515
sensor_health_check_http_port = local.monitoring_health_check_port
16-
subnetwork_monitoring_gateway = cidrhost(data.azurerm_subnet.mon_subnet.address_prefix, 1)
16+
subnetwork_monitoring_gateway = cidrhost(data.azurerm_subnet.mon_subnet.address_prefixes[0], 1)
1717
subnetwork_monitoring_cidr = data.azurerm_subnet.mon_subnet.address_prefix
1818
gzip_config = true
1919
base64_encode_config = true

0 commit comments

Comments
 (0)