Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlongcc committed Jul 8, 2024
1 parent 41684a0 commit 5ce6de2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
npm install -g @mitre/saf
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-auditor
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Clone Repository
uses: actions/checkout@v4

Expand Down
48 changes: 16 additions & 32 deletions mongo-validate.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,28 @@ build {
name = "validate"
sources = ["source.docker.hardened"]

# docker ps
provisioner "shell-local" {
inline = [
"docker ps -a",
"docker exec mongo-hardened sh -c 'ls'",
"cinc-auditor detect -t docker://mongo-hardened",
"docker ps -a"
]
}

### SCAN
// # docker ps
// provisioner "shell-local" {
// environment_vars = [
// "PROFILE=${var.scan.inspec_profile}",
// "CONTAINER_ID=${var.input_hardened_image.name}",
// "REPORT_DIR=${var.scan.report_dir}",
// "REPORT_FILE=${var.scan.inspec_report_filename}",
// "INPUT_FILE=${var.scan.inspec_input_file}",
// "TARGET_IMAGE=${var.input_hardened_image.name}",
// inline = [
// "docker ps -a",
// "docker exec mongo-hardened sh -c 'ls'",
// "inspec detect -t docker://mongo-hardened",
// "docker ps -a"
// ]
// valid_exit_codes = [0, 100, 101] # inspec has multiple valid exit codes
// script = "spec/scripts/scan.sh"
// }

# docker ps
### SCAN
provisioner "shell-local" {
inline = [
"docker ps -a",
"cinc-auditor detect -t docker://mongo-hardened",
"docker ps -a"
environment_vars = [
"PROFILE=${var.scan.inspec_profile}",
"CONTAINER_ID=${var.input_hardened_image.name}",
"REPORT_DIR=${var.scan.report_dir}",
"REPORT_FILE=${var.scan.inspec_report_filename}",
"INPUT_FILE=${var.scan.inspec_input_file}",
"TARGET_IMAGE=${var.input_hardened_image.name}",
]
valid_exit_codes = [0, 100, 101] # inspec has multiple valid exit codes
script = "spec/scripts/scan.sh"
}

### REPORT
Expand All @@ -103,13 +94,6 @@ build {
scripts = ["spec/scripts/report.sh"]
}

# docker ps
provisioner "shell-local" {
inline = [
"docker ps -a"
]
}

### VERIFY
provisioner "shell-local" {
environment_vars = [
Expand Down

0 comments on commit 5ce6de2

Please sign in to comment.