kube-bench CI/CD integration with Snapsec VM
Use kube-bench in your CI pipeline (or as part of your cluster security checks) to run Kubernetes CIS benchmark tests and then push the findings into Snapsec VM using a simple webhook. This guide shows you, step by step, how to:- Run kube-bench in your GitHub Actions or GitLab CI pipeline.
- Generate a JSON report.
- Send that JSON report directly to Snapsec VM using a webhook.
1. Prerequisites
- Access to a Kubernetes cluster or node where kube-bench can run.
- kube-bench available in your CI or cluster environment (container image or binary).
- Snapsec:
- An Assessment in Snapsec VM where kube-bench findings will be stored.
- Assessment ID (
<assessment-id>) - API key (
<your-api-key>)
curlavailable in the environment running kube-bench.
2. Create an assessment in Snapsec VM
Before you send any results, create a dedicated assessment in Snapsec VM that will hold the kube-bench findings:- Log in to the Snapsec UI.
- Go to the VM / Assessments section.
- Click New Assessment and give it a clear name, for example:
kube-bench - Cluster A
- Save the assessment and copy its Assessment ID value.
3. Generate kube-bench JSON report
On a node (or in CI) where Kubernetes config is available:kube-bench.json.
You can try this locally first to confirm it works before adding it to your CI.
4. Push kube-bench JSON directly to Snapsec VM via webhook
Important: ReplaceBelow are example CI configurations.<assessment-id>with your actual Assessment ID and<your-api-key>with your API key. Note on the-kflag: This flag tellscurlto perform an “insecure” SSL transfer, which bypasses certificate validation. You may need this for local or development environments. Remove it if your endpoint has a valid SSL certificate.
5. GitHub Actions example
6. GitLab CI example
*** Add File: /Users/imran/Desktop/suite-docs/integrations/vm/cloudsploit.mdx
title: CloudSploit description: Step-by-step guide to run CloudSploit in GitHub or GitLab CI and push findings into Snapsec VM via webhook. mode: wide
CloudSploit CI/CD integration with Snapsec VM
Use CloudSploit to scan your cloud accounts for misconfigurations and then push the findings into Snapsec VM using a webhook. This guide shows you, step by step, how to:- Run CloudSploit in your GitHub Actions or GitLab CI pipeline.
- Generate a JSON report.
- Send that JSON report directly to Snapsec VM using a webhook.
1. Prerequisites
- CloudSploit CLI (or Docker image) available in your CI environment.
- Cloud provider credentials configured for CloudSploit (AWS, Azure, GCP, etc.).
- Snapsec:
- An Assessment in Snapsec VM where CloudSploit findings will be stored.
- Assessment ID (
<assessment-id>) - API key (
<your-api-key>)
curlavailable.
2. Create an assessment in Snapsec VM
Create an assessment such asCloudSploit - Cloud Posture and copy its Assessment ID.
3. Generate CloudSploit JSON report
Example using the CloudSploit CLI:4. Push CloudSploit JSON directly to Snapsec VM via webhook
Important: Replace<assessment-id>and<your-api-key>with real values.
The-kflag allows insecure SSL in dev; remove it for production.
5. GitHub Actions example
6. GitLab CI example
*** Add File: /Users/imran/Desktop/suite-docs/integrations/vm/kics.mdx
title: KICS description: Step-by-step guide to run KICS in GitHub or GitLab CI and push findings into Snapsec VM via webhook. mode: wide
KICS CI/CD integration with Snapsec VM
Use KICS (Keeping Infrastructure as Code Secure) to scan Terraform, Kubernetes, Docker, and other IaC files, then push the findings into Snapsec VM. This guide shows you, step by step, how to:- Run KICS in your GitHub Actions or GitLab CI pipeline.
- Generate a JSON report.
- Send that JSON report directly to Snapsec VM using a webhook.
1. Prerequisites
- Repositories containing IaC files (Terraform, CloudFormation, Kubernetes manifests, etc.).
- KICS available in CI (Docker image or binary).
- Snapsec:
- An Assessment in Snapsec VM where KICS findings will be stored.
- Assessment ID (
<assessment-id>) - API key (
<your-api-key>)
curlavailable.
2. Create an assessment in Snapsec VM
Create an assessment likeKICS - IaC and copy its Assessment ID.
3. Generate KICS JSON report
Example using the official KICS Docker image scanning the current repo:kics.json in the current directory.
4. Push KICS JSON directly to Snapsec VM via webhook
Replace<assessment-id>/<your-api-key>and remove-konce SSL is properly configured.
5. GitHub Actions example
6. GitLab CI example
*** Add File: /Users/imran/Desktop/suite-docs/integrations/vm/tfsec.mdx
title: TFSec description: Step-by-step guide to run TFSec in GitHub or GitLab CI and push findings into Snapsec VM via webhook. mode: wide
TFSec CI/CD integration with Snapsec VM
Use TFSec to statically analyze Terraform code for security misconfigurations and then push findings into Snapsec VM. This guide shows you, step by step, how to:- Run TFSec in your GitHub Actions or GitLab CI pipeline.
- Generate a JSON report.
- Send that JSON report directly to Snapsec VM using a webhook.
1. Prerequisites
- Terraform code in your repository.
- TFSec installed (CLI or Docker image).
- Snapsec:
- An Assessment in Snapsec VM where TFSec findings will be stored.
- Assessment ID (
<assessment-id>) - API key (
<your-api-key>)
curlavailable.
2. Create an assessment in Snapsec VM
Create an assessment likeTFSec - Terraform and copy its Assessment ID.
3. Generate TFSec JSON report
4. Push TFSec JSON directly to Snapsec VM via webhook
Replace placeholders and remove -k once SSL is fully trusted.