-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added option for k8s collector deployment
- Loading branch information
Alan Nix
committed
Oct 6, 2022
1 parent
aae7adb
commit 04fa746
Showing
11 changed files
with
444 additions
and
49 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
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
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
%{ if lacework_server_url != "" } | ||
serverurl: ${lacework_server_url} | ||
%{ endif } | ||
%{ if lacework_cluster_type != "" || lacework_cluster_name != ""} | ||
clusterparams: | ||
%{ if lacework_cluster_type != "" } | ||
clustertype: ${lacework_cluster_type} | ||
%{ endif } | ||
%{ if lacework_cluster_name != "" } | ||
clustername: ${lacework_cluster_name} | ||
%{ endif } | ||
%{ endif } | ||
%{ if lacework_cluster_region != "" } | ||
cloudproviderparams: | ||
region: ${lacework_cluster_region} | ||
%{ endif } |
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,29 @@ | ||
{ | ||
%{ if ! lacework_agent_autoupgrade } | ||
"autoupgrade": "disable", | ||
%{ endif } | ||
%{ if lacework_agent_interface_connection_size != "" } | ||
"InterfaceConnectionSize": "${lacework_agent_interface_connection_size}", | ||
%{ endif } | ||
%{ if lacework_proxy_url != "" } | ||
"proxyurl": "${lacework_proxy_url}", | ||
%{ endif } | ||
%{ if lacework_server_url != "" } | ||
"serverurl": "${lacework_server_url}", | ||
%{ endif } | ||
%{ if lacework_cluster_type != "" && lacework_cluster_region != ""} | ||
"k8snodecollector": { | ||
%{ if lacework_cluster_type != "" } | ||
"k8sclustertype": "${lacework_cluster_type}", | ||
%{ endif } | ||
%{ if lacework_cluster_region != "" } | ||
"clusterregion": "${lacework_cluster_region}", | ||
%{ endif } | ||
%{ if lacework_cluster_exclusive } | ||
"exclusivemode": "true", | ||
%{ endif } | ||
"state": "enabled" | ||
}, | ||
%{ endif } | ||
"tags": ${lacework_agent_tags} | ||
} |
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,28 @@ | ||
# Kubernetes Deployment w/ Cluster Compliance Analysis | ||
|
||
This example shows how to use the Terraform Provider for Lacework to create | ||
a new Lacework Agent Token and use it to generate a Kubernetes DaemonSet and | ||
Secret configuration for deploying the Lacework Datacollector Agent. This | ||
example also enables Kubernetes Compliance analysis for the deployment. | ||
|
||
```hcl | ||
provider "kubernetes" {} | ||
provider "lacework" {} | ||
resource "lacework_agent_access_token" "k8s" { | ||
name = "prod" | ||
description = "k8s deployment for production env" | ||
} | ||
module "lacework_k8s_datacollector" { | ||
source = "lacework/agent/kubernetes" | ||
version = "~> 2.0" | ||
lacework_access_token = lacework_agent_access_token.k8s.token | ||
enable_cluster_agent = true | ||
lacework_cluster_name = "My-K8s-Cluster" | ||
lacework_cluster_type = "eks" | ||
} | ||
``` |
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,18 @@ | ||
provider "kubernetes" {} | ||
|
||
provider "lacework" {} | ||
|
||
resource "lacework_agent_access_token" "k8s" { | ||
name = "prod" | ||
description = "k8s deployment for production env" | ||
} | ||
|
||
module "lacework_k8s_datacollector" { | ||
source = "../../" | ||
|
||
lacework_access_token = lacework_agent_access_token.k8s.token | ||
|
||
enable_cluster_agent = true | ||
lacework_cluster_name = "My-K8s-Cluster" | ||
lacework_cluster_type = "eks" | ||
} |
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,11 @@ | ||
terraform { | ||
required_version = ">= 0.12.31" | ||
|
||
required_providers { | ||
kubernetes = "~> 2.2" | ||
lacework = { | ||
source = "lacework/lacework" | ||
version = "~> 0.4" | ||
} | ||
} | ||
} |
Oops, something went wrong.