From 4db5301a24cb7f7f87d040be3e3234d13b4b7754 Mon Sep 17 00:00:00 2001 From: Pierre Smeyers <pierre.smeyers@gmail.com> Date: Sun, 31 Mar 2024 11:42:47 +0200 Subject: [PATCH] feat(verbose): verbose is no longer the default fixes #17 - verbose is no longer the default - automatically enabled when $TRACE is set - removed unused quick parameters (no longer supported) --- README.md | 2 +- kicker.json | 14 -------------- templates/gitlab-ci-gitleaks.yml | 13 ++----------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 05355e9..d67f81c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ They use the following configuration. | --------------------- | -------------------------------------- | ----------------- | | `image` / `GITLEAKS_IMAGE` | The Docker image used to run Gitleaks | `registry.hub.docker.com/zricethezav/gitleaks:latest` | | `rules` / `GITLEAKS_RULES` | Gitleaks [configuration rules](https://github.com/zricethezav/gitleaks#configuration) to use (you may also provide your own `.gitleaks.toml` configuration file in your project). | _none_ (uses default rules) | -| `args` / `GITLEAKS_ARGS` | [Options](https://github.com/zricethezav/gitleaks/wiki/Options) for a full Gitleaks analysis (on master or develop branches) | `--verbose` | +| `args` / `GITLEAKS_ARGS` | [Options](https://github.com/zricethezav/gitleaks/wiki/Options) for a full Gitleaks analysis (on master or develop branches) | _none_ | ### Configuring Gitleaks rules diff --git a/kicker.json b/kicker.json index 6856fba..09b9027 100644 --- a/kicker.json +++ b/kicker.json @@ -19,20 +19,6 @@ { "name": "GITLEAKS_ARGS", "description": "[Options](https://github.com/zricethezav/gitleaks/wiki/Options) for a full Gitleaks analysis (on master or develop branches)", - "default": "--verbose", - "advanced": true - }, - { - "name": "GITLEAKS_QUICK_ARGS", - "description": "[Options](https://github.com/zricethezav/gitleaks/wiki/Options) for a quick Gitleaks analysis (on feature branches)", - "default": "--verbose", - "advanced": true - }, - { - "name": "GITLEAKS_QUICK_DEPTH", - "description": "Number of commits to scan (on feature branches)", - "type": "number", - "default": "10", "advanced": true } ] diff --git a/templates/gitlab-ci-gitleaks.yml b/templates/gitlab-ci-gitleaks.yml index f17bdb6..c8489eb 100644 --- a/templates/gitlab-ci-gitleaks.yml +++ b/templates/gitlab-ci-gitleaks.yml @@ -24,14 +24,7 @@ spec: default: '' args: description: '[Options](https://github.com/zricethezav/gitleaks/wiki/Options) for a full Gitleaks analysis (on master or develop branches)' - default: --verbose - quick-args: - description: '[Options](https://github.com/zricethezav/gitleaks/wiki/Options) for a quick Gitleaks analysis (on feature branches)' - default: --verbose - quick-depth: - description: Number of commits to scan (on feature branches) - type: number - default: 10 + default: '' --- workflow: rules: @@ -81,8 +74,6 @@ variables: GITLEAKS_IMAGE: $[[ inputs.image ]] GITLEAKS_ARGS: $[[ inputs.args ]] GITLEAKS_RULES: $[[ inputs.rules ]] - GITLEAKS_QUICK_ARGS: $[[ inputs.quick-args ]] - GITLEAKS_QUICK_DEPTH: $[[ inputs.quick-depth ]] # default production ref name (pattern) PROD_REF: /^(master|main)$/ @@ -242,7 +233,7 @@ gitleaks: - install_gitleaks_rules - git config --global --add safe.directory "${CI_PROJECT_DIR}" script: - - gitleaks detect ${TRACE+--log-level debug} --source . $gitleaks_rule_opts --report-path reports/gitleaks.native.json $GITLEAKS_ARGS + - gitleaks detect ${TRACE+--verbose} --source . $gitleaks_rule_opts --report-path reports/gitleaks.native.json $GITLEAKS_ARGS artifacts: name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" when: always -- GitLab