From e8c037376568b6ce7625548f8259e6538244de34 Mon Sep 17 00:00:00 2001
From: Ryan Haney <25014745+thathaneydude@users.noreply.github.com>
Date: Thu, 23 May 2024 16:33:28 -0500
Subject: [PATCH] adding enrichment options, updating descriptions, etc...
---
README.md | 25 +++++++++--
data.tf | 34 +++++++++++---
examples/deployment/main.tf | 21 ++++++---
scale_set.tf | 14 +++---
subnet.tf | 2 +-
templates/sensor_init_with_enrichment.tpl | 33 ++++++++++++++
variables.tf | 55 ++++++++++++++++++-----
versions.tf | 12 +++++
8 files changed, 162 insertions(+), 34 deletions(-)
create mode 100644 templates/sensor_init_with_enrichment.tpl
create mode 100644 versions.tf
diff --git a/README.md b/README.md
index e1bc2a2..897cdcb 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,29 @@ Terraform for Corelight's Azure Cloud Sensor Deployment.
-## Getting Started
+## Usage
```hcl
resource "sensor" {
- source = "github.com/corelight/terraform-azure-sensor"
-
-
+ source = "github.com/corelight/terraform-azure-sensor"
+
+ license_key = ""
+ location = ""
+ resource_group_name = ""
+ virtual_network_name = ""
+ virtual_network_resource_group = ""
+ virtual_network_address_space = ""
+ corelight_sensor_image_id = ""
+ sensor_api_password = ""
+ sensor_ssh_public_key = ""
+
+ # (Optional) Cloud Enrichment Variables
+ enrichment_storage_account_name = ""
+ enrichment_storage_container_name = ""
+ tags = {
+ foo: bar,
+ terraform: true,
+ purpose: Corelight
+ }
}
```
diff --git a/data.tf b/data.tf
index 9be4b72..d94f9be 100644
--- a/data.tf
+++ b/data.tf
@@ -4,12 +4,34 @@ data "cloudinit_config" "config" {
part {
content_type = "text/cloud-config"
- content = templatefile("${path.module}/templates/sensor_init.tpl", {
- api_password = var.sensor_api_password
- sensor_license = var.license_key
- mgmt_int = "eth0"
- mon_int = "eth1"
- })
+ content = templatefile("${path.module}/templates/sensor_init.tpl",
+ {
+ api_password = var.sensor_api_password
+ sensor_license = var.license_key
+ mgmt_int = "eth0"
+ mon_int = "eth1"
+ }
+ )
+ filename = "sensor-build.yaml"
+ }
+}
+
+data "cloudinit_config" "config_with_enrichment" {
+ gzip = true
+ base64_encode = true
+
+ part {
+ content_type = "text/cloud-config"
+ content = templatefile("${path.module}/templates/sensor_init_with_enrichment.tpl",
+ {
+ api_password = var.sensor_api_password
+ sensor_license = var.license_key
+ mgmt_int = "eth0"
+ mon_int = "eth1"
+ container_name = var.enrichment_storage_container_name
+ storage_account_name = var.enrichment_storage_account_name
+ }
+ )
filename = "sensor-build.yaml"
}
}
\ No newline at end of file
diff --git a/examples/deployment/main.tf b/examples/deployment/main.tf
index 921432b..dfac70d 100644
--- a/examples/deployment/main.tf
+++ b/examples/deployment/main.tf
@@ -37,14 +37,23 @@ module "sensor" {
location = local.location
resource_group_name = azurerm_resource_group.sensor_rg.name
virtual_network_name = data.azurerm_virtual_network.existing_vnet.name
- corelight_sensor_image_id = "