Skip to content

Commit 67b9841

Browse files
author
Jacob Fiola
committed
initial commit
1 parent afabab3 commit 67b9841

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

.github/workflows/scan:trivy.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Trivy Terraform Scan
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
schedule:
7+
- cron: '0 3 * * *' # Nightly at 03:00 UTC
8+
workflow_dispatch:
9+
10+
jobs:
11+
trivy:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
issues: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Trivy scan
22+
uses: corelight/shared-actions/trivy-terraform-scan@main

Taskfile.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ tasks:
1111
desc: Check if the input is formatted
1212
cmds:
1313
- terraform fmt -recursive -check -diff .
14+
15+
trivy:scan:
16+
desc: Scan Terraform files with Trivy
17+
cmds:
18+
- trivy fs --config scripts/trivy/trivy.yml .

modules/bastion/instance.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#trivy:ignore:AVD-GCP-0031 allow bastion instance to be created with public IP
12
resource "google_compute_instance" "bastion_instance" {
23
name = var.instance_resource_name
34
machine_type = var.instance_size

scripts/trivy/.trivyignore.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
misconfigurations:

scripts/trivy/trivy.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
scan:
2+
security-checks:
3+
- secret
4+
- config
5+
6+
ignorefile: scripts/trivy/.trivyignore.yml
7+
8+
severity:
9+
- HIGH
10+
- CRITICAL
11+
12+
misconfiguration:
13+
scanners:
14+
- terraform
15+
config:
16+
terraform:
17+
file_patterns:
18+
- "**/*.tf"
19+
ignore_unfixed: true

0 commit comments

Comments
 (0)