Deploy Sysdig Secure for Cloud in a provided existing Kubernetes Cluster.
- Sysdig Helm cloud-connector chart will be used to deploy threat-detection and scanning features
Because these charts require specific AWS credentials to be passed by parameter, a new user + access key will be created within account. Seecredentials.tf
- Used architecture is similar to single-account but changing ECS <---> with an existing K8s cluster (EKS or vanilla)
- All the required resources and workloads will be run under the same AWS account.
- All Sysdig Secure for Cloud features but Image Scanning are enabled by default. You can enable it through
deploy_image_scanning_ecr
anddeploy_image_scanning_ecs
input variable parameters. - Resource creation inventory Find all the resources created by Sysdig examples in the resource-group
sysdig-secure-for-cloud
(AWS Resource Group & Tag Editor) - Deployment cost This example will create resources that cost money.
Runterraform destroy
when you don't need them anymore
Minimum requirements:
- Configure Terraform AWS Provider
- Configure Helm Provider for Kubernetes cluster
- Sysdig Secure requirements, as input variable value
sysdig_secure_api_token=<SECURE_API_TOKEN>
For quick testing, use this snippet on your terraform files
terraform {
required_providers {
sysdig = {
source = "sysdiglabs/sysdig"
}
}
}
provider "sysdig" {
sysdig_secure_url = "<SYSDIG_SECURE_URL>"
sysdig_secure_api_token = "<SYSDIG_SECURE_API_TOKEN>"
}
provider "aws" {
region = "<AWS-REGION>; ex. us-east-1"
}
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
module "secure_for_cloud_aws_single_account_k8s" {
source = "sysdiglabs/secure-for-cloud/aws//examples/single-account-k8s"
}
See inputs summary or module module variables.tf
file for more optional configuration.
To run this example you need have your aws account profile configured in CLI and to execute:
$ terraform init
$ terraform plan
$ terraform apply
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 4.0.0 |
helm | >=2.3.0 |
sysdig | >= 0.5.33 |
Name | Version |
---|---|
aws | 4.26.0 |
helm | 2.6.0 |
sysdig | 0.5.39 |
Name | Source | Version |
---|---|---|
cloud_bench | ../../modules/services/cloud-bench | n/a |
cloud_connector_sqs | ../../modules/infrastructure/sqs-sns-subscription | n/a |
cloudtrail | ../../modules/infrastructure/cloudtrail | n/a |
codebuild | ../../modules/infrastructure/codebuild | n/a |
iam_user | ../../modules/infrastructure/permissions/iam-user | n/a |
resource_group | ../../modules/infrastructure/resource-group | n/a |
ssm | ../../modules/infrastructure/ssm | n/a |
Name | Type |
---|---|
helm_release.cloud_connector | resource |
aws_region.current | data source |
sysdig_secure_connection.current | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
benchmark_regions | List of regions in which to run the benchmark. If empty, the task will contain all aws regions by default. | list(string) |
[] |
no |
cloudtrail_is_multi_region_trail | true/false whether cloudtrail will ingest multiregional events. testing/economization purpose. | bool |
true |
no |
cloudtrail_kms_enable | true/false whether s3 should be encrypted. testing/economization purpose. | bool |
true |
no |
cloudtrail_sns_arn | ARN of a pre-existing cloudtrail_sns. If defaulted, a new cloudtrail will be created. If specified, deployment region must match Cloudtrail S3 bucket region | string |
"create" |
no |
deploy_benchmark | Whether to deploy or not the cloud benchmarking | bool |
true |
no |
deploy_image_scanning_ecr | true/false whether to deploy the image scanning on ECR pushed images | bool |
false |
no |
deploy_image_scanning_ecs | true/false whether to deploy the image scanning on ECS running images | bool |
false |
no |
name | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | string |
"sfc" |
no |
tags | sysdig secure-for-cloud tags. always include 'product' default tag for resource-group proper functioning | map(string) |
{ |
no |
No outputs.
Module is maintained and supported by Sysdig.
Apache 2 Licensed. See LICENSE for full details.