Skip to content

Commit

Permalink
ci: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
iru committed Jan 30, 2024
1 parent 81b4faf commit a8528c5
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 12 deletions.
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace


- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
hooks:
- id: terraform_fmt
- id: terraform_docs
args:
- '--args=--sort-by required'
- id: terraform_tflint
args:
- '--args=--only=terraform_deprecated_interpolation'
- '--args=--only=terraform_deprecated_index'
- '--args=--only=terraform_unused_declarations'
- '--args=--only=terraform_comment_syntax'
- '--args=--only=terraform_documented_outputs'
- '--args=--only=terraform_documented_variables'
- '--args=--only=terraform_typed_variables'
- '--args=--only=terraform_module_pinned_source'
- '--args=--only=terraform_naming_convention'
- '--args=--only=terraform_required_version'
- '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- id: terrascan
6 changes: 3 additions & 3 deletions modules/services/agentless-scan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ This module will deploy required resources for Sysdig to be able to scan hosts o


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

![permission-diagram.png](permission-diagram.png)
Expand Down Expand Up @@ -89,4 +89,4 @@ Module is maintained by [Sysdig](https://sysdig.com).

## License

Apache 2 Licensed. See LICENSE for full details.
Apache 2 Licensed. See LICENSE for full details.
2 changes: 1 addition & 1 deletion modules/services/agentless-scan/data.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data "google_project" "project" {
project_id = var.project_id
}
}
2 changes: 1 addition & 1 deletion modules/services/agentless-scan/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ locals {
resource "random_id" "suffix" {
count = var.suffix == null ? 1 : 0
byte_length = 3
}
}
2 changes: 1 addition & 1 deletion modules/services/agentless-scan/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ output "json_payload" {
error_message = "Cannot provide both sysdig_backend or sysdig_account_id"
}

description="Deprecated. JSON Payload to internally provision customer on Sysdig VM Host scan on Sysdig"
description = "Deprecated. JSON Payload to internally provision customer on Sysdig VM Host scan on Sysdig"
}
2 changes: 1 addition & 1 deletion modules/services/agentless-scan/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ terraform {
version = "~> 1.19.0"
}
}
}
}
6 changes: 3 additions & 3 deletions modules/services/agentless-scan/sysdig_provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ resource "sysdig_secure_cloud_auth_account" "gcp_project_" {
# - module output values
# - sysdig_provider outputs for API
gcp = {
authUri = var.sysdig_backend != null ? google_iam_workload_identity_pool_provider.agentless[0].name : var.sysdig_account_id != null ? google_iam_workload_identity_pool_provider.agentless_gcp[0].name : null
authUri = var.sysdig_backend != null ? google_iam_workload_identity_pool_provider.agentless[0].name : var.sysdig_account_id != null ? google_iam_workload_identity_pool_provider.agentless_gcp[0].name : null
clientEmail = google_service_account.controller.email
}
})
}
depends_on = [google_service_account.controller, var.sysdig_backend != null ? google_iam_workload_identity_pool_provider.agentless:google_iam_workload_identity_pool_provider.agentless_gcp]
}
depends_on = [google_service_account.controller, var.sysdig_backend != null ? google_iam_workload_identity_pool_provider.agentless : google_iam_workload_identity_pool_provider.agentless_gcp]
}
2 changes: 1 addition & 1 deletion modules/services/agentless-scan/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ variable "suffix" {
type = string
description = "By default a random value will be autogenerated.<br/>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)"
default = null
}
}
2 changes: 1 addition & 1 deletion modules/services/agentless-scan/worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ resource "google_project_iam_binding" "admin-account-iam" {
members = [
"serviceAccount:${var.worker_identity}",
]
}
}

0 comments on commit a8528c5

Please sign in to comment.