Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SP-2457): private or public runner check #164

Merged
merged 5 commits into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions scripts/secrets-scan/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

GITLEAKS_VERSION="v8.16.1"

get_gitleaks_container() {
repo_name="zricethezav/gitleaks"
mirror_repo_name="mirror/${repo_name}"
image_ids="imageTag=${gitleaks_version}"
image_ids="imageTag=${GITLEAKS_VERSION}"
registry_id="567716553783"

mirrored_gitleaks="${registry_id}.dkr.ecr.us-east-1.amazonaws.com/${mirror_repo_name}"
Expand Down Expand Up @@ -53,7 +55,6 @@ final_config="$tmp_dir/gitleaks_config.toml"
commits_file="$tmp_dir/commit_list.txt"
gitleaks_config_container="${DOCKERREGISTRY}/typeform/gitleaks-config"
gitleaks_container=$(get_gitleaks_container)
gitleaks_version="v8.16.1"
gitleaks_config_cmd="python gitleaks_config_generator.py"

# Generate the final gitleaks config file. If the repo has a local config, merge both
Expand Down Expand Up @@ -88,7 +89,7 @@ fi
# Do not exit if the gitleaks run fails. This way we can display some custom messages.
set +e

echo "Using the following gitleaks container image: ${gitleaks_container}:${gitleaks_version}"
echo "Using the following gitleaks container image: ${gitleaks_container}:${GITLEAKS_VERSION}"

# Run gitleaks with the generated config
gitleaks_cmd="detect \
Expand All @@ -102,7 +103,7 @@ docker container run --rm --name=gitleaks \
-v $final_config:$final_config \
-v $commits_file:$commits_file \
-v $repo_dir:/tmp/$repo_name \
$gitleaks_container:$gitleaks_version ${gitleaks_cmd}
$gitleaks_container:$GITLEAKS_VERSION ${gitleaks_cmd}

# Keep the exit code of the gitleaks run
exit_code=$?
Expand Down
Loading