Skip to content

Commit

Permalink
automated commit
Browse files Browse the repository at this point in the history
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Sep 20, 2024
1 parent 8095c9d commit fdf9442
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 3 deletions.
2 changes: 1 addition & 1 deletion images/stakater-reloader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--monopod:end-->

<!--overview:start-->
Minimal image with Keda, a Kubernetes-based Event Driven Autoscaler.
Minimal image with stakater Reloader, a Kubernetes controller to watch changes in ConfigMap and Secrets
<!--overview:end-->

<!--getting:start-->
Expand Down
4 changes: 2 additions & 2 deletions images/stakater-reloader/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ image: cgr.dev/chainguard/stakater-reloader
logo: https://storage.googleapis.com/chainguard-academy/logos/stakater-reloader.svg
endoflife: ""
console_summary: ""
short_description: Minimal image with Keda, a Kubernetes-based Event Driven Autoscaler.
short_description: Minimal image with stakater Reloader, a Kubernetes controller to watch changes in ConfigMap and Secrets
compatibility_notes: ""
readme_file: README.md
upstream_url: https://keda.sh
upstream_url: https://docs.stakater.com/reloader
keywords:
- application
- kubernetes
77 changes: 77 additions & 0 deletions tflib/imagetest/checks/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
data "imagetest_inventory" "this" {}

resource "imagetest_harness_docker" "this" {
name = "cli"
inventory = data.imagetest_inventory.this

privileged = false
}

resource "imagetest_feature" "openssl_fips" {
count = var.check_openssl_fips ? 1 : 0

name = "openssl-fips"
description = "Test OpenSSL FIPS"
harness = imagetest_harness_docker.this

steps = [
{
name = "Testing if FIPS module is available"
cmd = <<EOT
set -euxo pipefail
docker run --rm --entrypoint openssl ${var.image_ref} list -providers | grep -q 'fips'
EOT
},
{
name = "Testing if legacy module is unavailable"
cmd = <<EOT
set -euxo pipefail
! docker run --rm --entrypoint openssl ${var.image_ref} list -providers | grep -q 'legacy'
EOT
},
{
name = "Testing if MD5 hashing fails"
cmd = <<EOT
set -euxo pipefail
! docker run --rm --entrypoint openssl ${var.image_ref} dgst -md5 /dev/null
EOT
},
{
name = "Testing if SHA2-512 hashing succeeds"
cmd = <<EOT
set -euxo pipefail
docker run --rm --entrypoint openssl ${var.image_ref} dgst -sha512 /dev/null
EOT
},
]

labels = { type = "container" }
}

resource "imagetest_feature" "md5" {
count = var.check_openssl_md5 ? 1 : 0

name = "md5"
description = "Test md5"
harness = imagetest_harness_docker.this

steps = [
{
name = "Testing if md5 as hash function is available"
cmd = <<EOT
set -euxo pipefail
docker run --rm --entrypoint openssl ${var.image_ref} dgst -list | grep -q md5
EOT
},
{
name = "Testing md5 by computing digest"
cmd = <<EOT
set -euxo pipefail
docker run --rm --entrypoint openssl ${var.image_ref} dgst -md5 /dev/null
EOT
},
]

labels = { type = "container" }
}

5 changes: 5 additions & 0 deletions tflib/imagetest/checks/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
terraform {
required_providers {
imagetest = { source = "chainguard-dev/imagetest" }
}
}
17 changes: 17 additions & 0 deletions tflib/imagetest/checks/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "check_openssl_fips" {
type = bool
description = "Whether to test openssl to be FIPS hardenened"
default = false
}

variable "check_openssl_md5" {
type = bool
description = "Whether to test if md5 is supported with openssl CLI"
default = false
}

variable "image_ref" {
type = string
description = "The image reference to run checks over"
}

0 comments on commit fdf9442

Please sign in to comment.