From 84dc9a9cab369e8ddafed29463a39f2876d55558 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Sun, 10 Mar 2024 11:16:55 +0200 Subject: [PATCH 01/18] add schema var --- images/entrypoint-oxeye-scan.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 9eca1df..1f9d06d 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -15,9 +15,15 @@ workspace_id=$5 release=$6 excludes=$7 partial=$8 +schema=$9 + + +if [ -z "$schema" ]; then + schema="https" +fi # Get Bearer ToKen -bearerToken=$(curl -s -X POST --location "https://${host}/api/auth/api-token" \ +bearerToken=$(curl -s -X POST --location "${schema}://${host}/api/auth/api-token" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data "{ @@ -48,7 +54,7 @@ fi git config --global --add safe.directory "*" # Download Script -curl -s -o /app/scm_scan.py --location "https://${host}/api/scm/script?provider=${cicd_tool}" \ +curl -s -o /app/scm_scan.py --location "${schema}://${host}/api/scm/script?provider=${cicd_tool}" \ --header "Content-Type: application/json" \ --header "Accept: application/octet-stream" \ --header "Authorization: Bearer ${bearerToken}" From 1cab5a6c62c5cd60d008c71e1c000a360285e672 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Sun, 10 Mar 2024 11:21:06 +0200 Subject: [PATCH 02/18] add schema var --- images/entrypoint-oxeye-scan.sh | 2 ++ oxeye-scan/action.yaml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 1f9d06d..85a86b7 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -22,6 +22,8 @@ if [ -z "$schema" ]; then schema="https" fi +echo "host: ${host}" +echo "schema: ${schema}" # Get Bearer ToKen bearerToken=$(curl -s -X POST --location "${schema}://${host}/api/auth/api-token" \ --header 'Content-Type: application/json' \ diff --git a/oxeye-scan/action.yaml b/oxeye-scan/action.yaml index f81161e..ce8c2ee 100644 --- a/oxeye-scan/action.yaml +++ b/oxeye-scan/action.yaml @@ -28,6 +28,10 @@ inputs: description: Scan only changes required: false default: 'false' + schema: + description: schema for host variable + required: false + default: 'https' runs: using: docker image: docker://ghcr.io/ox-eye/github-actions/oxeye-scan:v0.0.30 @@ -40,3 +44,4 @@ runs: - ${{ inputs.release }} - ${{ inputs.excludes }} - ${{ inputs.partial }} + - ${{ inputs.schema }} From 11c1c4e69fd528b20eb312e24cb5c3ebbfa59111 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Sun, 10 Mar 2024 13:48:39 +0200 Subject: [PATCH 03/18] add schema var to image tag --- oxeye-scan/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oxeye-scan/action.yaml b/oxeye-scan/action.yaml index ce8c2ee..186f0ca 100644 --- a/oxeye-scan/action.yaml +++ b/oxeye-scan/action.yaml @@ -34,7 +34,7 @@ inputs: default: 'https' runs: using: docker - image: docker://ghcr.io/ox-eye/github-actions/oxeye-scan:v0.0.30 + image: docker://ghcr.io/ox-eye/github-actions/oxeye-scan:scm-add_schema_var args: - ${{ inputs.token }} - ${{ inputs.host }} From ca9fc07a233f2b5d2c592dde85040ac7ce7f4671 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Sun, 10 Mar 2024 13:53:12 +0200 Subject: [PATCH 04/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 85a86b7..828a66e 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -e +set -ex if [ "$#" -lt 5 ]; then echo "Error - Missing argument. Please verify your configuration, or contact support@oxeye.io" From 06c9222ec25a81de1f72fc1a081e8722d46a4040 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 12:13:50 +0200 Subject: [PATCH 05/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 828a66e..99d8b21 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -62,7 +62,7 @@ curl -s -o /app/scm_scan.py --location "${schema}://${host}/api/scm/script?provi --header "Authorization: Bearer ${bearerToken}" # RUN SCM Scan Script -default_flags="--host $host +default_flags="--host $schema://$host --repo-token $token --client-id $client_id --secret $secret From 2e0aa02ff40a753589faf1cdfd88f8c6ac8cd901 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 14:20:03 +0200 Subject: [PATCH 06/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 99d8b21..8d1280f 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -15,17 +15,17 @@ workspace_id=$5 release=$6 excludes=$7 partial=$8 -schema=$9 +scheme=$9 -if [ -z "$schema" ]; then +if [ -z "$scheme" ]; then schema="https" +elif [ "$scheme" = "http" ]; then + echo "scheme: http" > "$HOME/.oxeye/config" fi -echo "host: ${host}" -echo "schema: ${schema}" # Get Bearer ToKen -bearerToken=$(curl -s -X POST --location "${schema}://${host}/api/auth/api-token" \ +bearerToken=$(curl -s -X POST --location "${scheme}://${host}/api/auth/api-token" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data "{ @@ -56,7 +56,7 @@ fi git config --global --add safe.directory "*" # Download Script -curl -s -o /app/scm_scan.py --location "${schema}://${host}/api/scm/script?provider=${cicd_tool}" \ +curl -s -o /app/scm_scan.py --location "${scheme}://${host}/api/scm/script?provider=${cicd_tool}" \ --header "Content-Type: application/json" \ --header "Accept: application/octet-stream" \ --header "Authorization: Bearer ${bearerToken}" From 5203548a7dd7c57cab5c988c6dd84322316d8223 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 14:31:18 +0200 Subject: [PATCH 07/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 8d1280f..5e65af9 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -19,11 +19,13 @@ scheme=$9 if [ -z "$scheme" ]; then - schema="https" + scheme="https" elif [ "$scheme" = "http" ]; then - echo "scheme: http" > "$HOME/.oxeye/config" + config_dir="$HOME/.oxeye" + config_file="$config_dir/config" + mkdir -p "$config_dir" + echo "scheme: http" > "$config_file" fi - # Get Bearer ToKen bearerToken=$(curl -s -X POST --location "${scheme}://${host}/api/auth/api-token" \ --header 'Content-Type: application/json' \ From 0300efbcb4a2899062b1f53b5bb73fec9f766b4b Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 14:42:35 +0200 Subject: [PATCH 08/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 5e65af9..a4eaba2 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -58,7 +58,7 @@ fi git config --global --add safe.directory "*" # Download Script -curl -s -o /app/scm_scan.py --location "${scheme}://${host}/api/scm/script?provider=${cicd_tool}" \ +curl -s -o /app/scm_scan.py --location "${host}/api/scm/script?provider=${cicd_tool}" \ --header "Content-Type: application/json" \ --header "Accept: application/octet-stream" \ --header "Authorization: Bearer ${bearerToken}" From 25f3f82e1f19714d0b264ff51e33d1009e3c37ba Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 14:56:36 +0200 Subject: [PATCH 09/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index a4eaba2..5e65af9 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -58,7 +58,7 @@ fi git config --global --add safe.directory "*" # Download Script -curl -s -o /app/scm_scan.py --location "${host}/api/scm/script?provider=${cicd_tool}" \ +curl -s -o /app/scm_scan.py --location "${scheme}://${host}/api/scm/script?provider=${cicd_tool}" \ --header "Content-Type: application/json" \ --header "Accept: application/octet-stream" \ --header "Authorization: Bearer ${bearerToken}" From 88cf5d1c0bd42ef2ad203cc042b223d56aab5451 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 15:07:28 +0200 Subject: [PATCH 10/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 5e65af9..95c15e4 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -17,14 +17,13 @@ excludes=$7 partial=$8 scheme=$9 - -if [ -z "$scheme" ]; then - scheme="https" -elif [ "$scheme" = "http" ]; then +if [ "$scheme" = "http" ]; then config_dir="$HOME/.oxeye" config_file="$config_dir/config" mkdir -p "$config_dir" echo "scheme: http" > "$config_file" +else + scheme="https" fi # Get Bearer ToKen bearerToken=$(curl -s -X POST --location "${scheme}://${host}/api/auth/api-token" \ From 3e03894ad61d072d4db0d79d8bb891b080f9ee9e Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:13:03 +0200 Subject: [PATCH 11/18] add schema var to image tag --- oxeye-scan/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oxeye-scan/action.yaml b/oxeye-scan/action.yaml index 186f0ca..8ecde91 100644 --- a/oxeye-scan/action.yaml +++ b/oxeye-scan/action.yaml @@ -28,7 +28,7 @@ inputs: description: Scan only changes required: false default: 'false' - schema: + scheme: description: schema for host variable required: false default: 'https' @@ -44,4 +44,4 @@ runs: - ${{ inputs.release }} - ${{ inputs.excludes }} - ${{ inputs.partial }} - - ${{ inputs.schema }} + - ${{ inputs.scheme }} From 4ccab4dba6cb05e098167e9fc36320a7c48035b9 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:37:25 +0200 Subject: [PATCH 12/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 1 + oxeye-scan/action.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 95c15e4..b1540ec 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -17,6 +17,7 @@ excludes=$7 partial=$8 scheme=$9 +echo "Home: $HOME" if [ "$scheme" = "http" ]; then config_dir="$HOME/.oxeye" config_file="$config_dir/config" diff --git a/oxeye-scan/action.yaml b/oxeye-scan/action.yaml index 8ecde91..e705d68 100644 --- a/oxeye-scan/action.yaml +++ b/oxeye-scan/action.yaml @@ -29,7 +29,7 @@ inputs: required: false default: 'false' scheme: - description: schema for host variable + description: scheme for host variable required: false default: 'https' runs: From 31e98ca8580b35ec0533f1459f018012c90a27f1 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:42:28 +0200 Subject: [PATCH 13/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index b1540ec..799f584 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -18,6 +18,15 @@ partial=$8 scheme=$9 echo "Home: $HOME" +if [ "$scheme" = "http" ]; then + config_dir="/root/.oxeye" + config_file="$config_dir/config" + mkdir -p "$config_dir" + echo "scheme: http" > "$config_file" +else + scheme="https" +fi + if [ "$scheme" = "http" ]; then config_dir="$HOME/.oxeye" config_file="$config_dir/config" @@ -26,6 +35,7 @@ if [ "$scheme" = "http" ]; then else scheme="https" fi + # Get Bearer ToKen bearerToken=$(curl -s -X POST --location "${scheme}://${host}/api/auth/api-token" \ --header 'Content-Type: application/json' \ From ad450e9678638b8c5162f39cf39ecf1ec769c70d Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:44:32 +0200 Subject: [PATCH 14/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 799f584..82cba8f 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -23,6 +23,7 @@ if [ "$scheme" = "http" ]; then config_file="$config_dir/config" mkdir -p "$config_dir" echo "scheme: http" > "$config_file" + cat $config_file else scheme="https" fi @@ -32,6 +33,7 @@ if [ "$scheme" = "http" ]; then config_file="$config_dir/config" mkdir -p "$config_dir" echo "scheme: http" > "$config_file" + cat $config_file else scheme="https" fi From c99af304be0ffea0968068c1048adb316124be7a Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:46:34 +0200 Subject: [PATCH 15/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 82cba8f..70451f6 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -76,7 +76,7 @@ curl -s -o /app/scm_scan.py --location "${scheme}://${host}/api/scm/script?provi --header "Authorization: Bearer ${bearerToken}" # RUN SCM Scan Script -default_flags="--host $schema://$host +default_flags="--host $scheme://$host --repo-token $token --client-id $client_id --secret $secret From 8c171ee11c6875e381241760819a169bc43828eb Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:56:03 +0200 Subject: [PATCH 16/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 70451f6..0f76ddd 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -96,4 +96,4 @@ if [ "$partial" == "false" ]; then scm_scan_flags="$scm_scan_flags --full" fi -python /app/scm_scan.py $scm_scan_flags +python /app/scm_scan.py $scm_scan_flags || cat "/tmp/scm.log" From 4ac7a7906862bd587c75ed20ff4f6ad87a4fb396 Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 16:59:11 +0200 Subject: [PATCH 17/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 0f76ddd..3612893 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -76,7 +76,7 @@ curl -s -o /app/scm_scan.py --location "${scheme}://${host}/api/scm/script?provi --header "Authorization: Bearer ${bearerToken}" # RUN SCM Scan Script -default_flags="--host $scheme://$host +default_flags="--host $host --repo-token $token --client-id $client_id --secret $secret From cb5aea8a57192c09c4707e76ab45c01be565c96c Mon Sep 17 00:00:00 2001 From: joeyhavia Date: Mon, 11 Mar 2024 17:16:33 +0200 Subject: [PATCH 18/18] add schema var to image tag --- images/entrypoint-oxeye-scan.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/entrypoint-oxeye-scan.sh b/images/entrypoint-oxeye-scan.sh index 3612893..fbdf227 100755 --- a/images/entrypoint-oxeye-scan.sh +++ b/images/entrypoint-oxeye-scan.sh @@ -80,7 +80,8 @@ default_flags="--host $host --repo-token $token --client-id $client_id --secret $secret - --workspace-id $workspace_id" + --workspace-id $workspace_id + --scheme $scheme" scm_scan_flags=$default_flags