Skip to content

Commit 487b2ad

Browse files
author
iru
authored
test(vm, cloud-scan): single-project use-case (#18)
1 parent 66e6f78 commit 487b2ad

File tree

18 files changed

+124
-21
lines changed

18 files changed

+124
-21
lines changed

.github/workflows/ci-pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- "secure_config_posture_identity_access/organization/main.tf"
4141
- "secure_threat_detection/single/main.tf"
4242
- "secure_threat_detection/organization/main.tf"
43+
- "agentless-scan/single/main.tf"
4344
- "agentless-scan/organization/main.tf"
4445
steps:
4546
- name: Set up Go

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
9+
10+
- repo: https://github.com/antonbabenko/pre-commit-terraform
11+
rev: v1.86.0
12+
hooks:
13+
- id: terraform_fmt
14+
- id: terraform_docs
15+
args:
16+
- '--args=--sort-by required'
17+
- id: terraform_tflint
18+
args:
19+
- '--args=--only=terraform_deprecated_interpolation'
20+
- '--args=--only=terraform_deprecated_index'
21+
- '--args=--only=terraform_unused_declarations'
22+
- '--args=--only=terraform_comment_syntax'
23+
- '--args=--only=terraform_documented_outputs'
24+
- '--args=--only=terraform_documented_variables'
25+
- '--args=--only=terraform_typed_variables'
26+
- '--args=--only=terraform_module_pinned_source'
27+
- '--args=--only=terraform_naming_convention'
28+
- '--args=--only=terraform_required_version'
29+
- '--args=--only=terraform_required_providers'
30+
- '--args=--only=terraform_standard_module_structure'
31+
- '--args=--only=terraform_workspace_remote'
32+
- id: terrascan

modules/services/agentless-scan/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ This module will deploy required resources for Sysdig to be able to scan hosts o
77

88

99
The following resources will be created on each instrumented project:
10-
- For the **Resource Discovery**: Enable Sysdig to authenticate through a Workload Identity Pool (requires provider,
10+
- For the **Resource Discovery**: Enable Sysdig to authenticate through a Workload Identity Pool (requires provider,
1111
service account, role, and related bindings) in order to be able to discover the VPC/Instance/Volumes
12-
- For the **Host Data Extraction**: Enable Sysdig to create a disk copy on our SaaS platform, to be able to extract
12+
- For the **Host Data Extraction**: Enable Sysdig to create a disk copy on our SaaS platform, to be able to extract
1313
the data required for security assessment.
1414

1515

@@ -103,4 +103,4 @@ Module is maintained by [Sysdig](https://sysdig.com).
103103

104104
## License
105105

106-
Apache 2 Licensed. See LICENSE for full details.
106+
Apache 2 Licensed. See LICENSE for full details.

modules/services/agentless-scan/controller_org.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ resource "google_organization_iam_binding" "controller_custom" {
1515
members = [
1616
"serviceAccount:${google_service_account.controller.email}",
1717
]
18-
}
18+
}

modules/services/agentless-scan/controller_single.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ resource "google_project_iam_binding" "controller_custom" {
1515
members = [
1616
"serviceAccount:${google_service_account.controller.email}",
1717
]
18-
}
18+
}

modules/services/agentless-scan/data.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ data "google_project" "project" {
55
data "google_organization" "org" {
66
count = local.is_organizational ? 1 : 0
77
domain = var.organization_domain
8-
}
8+
}

modules/services/agentless-scan/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ locals {
3030
resource "random_id" "suffix" {
3131
count = var.suffix == null ? 1 : 0
3232
byte_length = 3
33-
}
33+
}

modules/services/agentless-scan/outputs.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
output "project_id" {
2-
value = var.project_id
2+
value = var.project_id
3+
description = "Target project_id"
34
}
45

56
output "project_number" {
6-
value = data.google_project.project.number
7+
value = data.google_project.project.number
8+
description = "Target project_number"
79
}
810

911
output "controller_service_account" {
1012
value = google_service_account.controller.email
13+
14+
description = "Service Account (email) for Sysdig host Discovery to use"
1115
}
1216

1317
output "workload_identity_pool_provider" {
@@ -16,6 +20,8 @@ output "workload_identity_pool_provider" {
1620
condition = (var.sysdig_backend != null && var.sysdig_account_id == null) || (var.sysdig_backend == null && var.sysdig_account_id != null)
1721
error_message = "Cannot provide both sysdig_backend or sysdig_account_id"
1822
}
23+
24+
description = "Workload Identity Pool Provider URL for Sysdig host Discovery to use"
1925
}
2026

2127
output "json_payload" {
@@ -29,4 +35,6 @@ output "json_payload" {
2935
condition = (var.sysdig_backend != null && var.sysdig_account_id == null) || (var.sysdig_backend == null && var.sysdig_account_id != null)
3036
error_message = "Cannot provide both sysdig_backend or sysdig_account_id"
3137
}
38+
39+
description = "Deprecated. JSON Payload to internally provision customer on Sysdig VM Host scan on Sysdig"
3240
}

modules/services/agentless-scan/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ terraform {
1111
version = ">= 3.1, < 4.0"
1212
}
1313
}
14-
}
14+
}

modules/services/agentless-scan/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ variable "worker_identity" {
99
description = "Sysdig provided Identity for the Service Account in charge of performing the host disk analysis"
1010
}
1111

12+
# mandatory; one of `sysdig_backend` or `sysdig_account_id`
1213
variable "sysdig_backend" {
1314
type = string
1415
description = "Sysdig provided AWS Account designated for the host scan.<br/>One of `sysdig_backend` or `sysdig_account_id`must be provided"
@@ -29,6 +30,7 @@ variable "role_name" {
2930
}
3031

3132

33+
3234
variable "suffix" {
3335
type = string
3436
description = "Optional. Suffix word to enable multiple deployments with different naming<br/>(Workload Identity Pool and Providers have a soft deletion on Google Platform that will disallow name re-utilization)<br/>By default a random value will be autogenerated."

0 commit comments

Comments
 (0)