Skip to content

Conversation

rtrofimenkov-ssdlc
Copy link
Contributor

@rtrofimenkov-ssdlc rtrofimenkov-ssdlc commented Oct 7, 2025

What's added:

  • New gitleaks.gitlab-ci.yml template for automatic secret detection in code
  • Support for two scan modes: diff (PR changes only) and full (entire repository)
  • Automatic Gitleaks v8.28.0 installation with Linux x64/ARM64 support
  • GitLab CI integration via three jobs:
    • gitleaks_diff - for MRs (automatic)
    • gitleaks_full_manual - for manual runs
    • gitleaks_full_scheduled - for scheduled scans
  • Custom configuration support via gitleaks.toml
  • Detailed results output with links to problematic code locations
  • JSON report artifacts for further analysis

Usage:

include:
  - remote: 'https://raw.githubusercontent.com/deckhouse/modules-gitlab-ci/refs/heads/main/templates/gitleaks.gitlab-ci.yml'

This template complements the existing Deckhouse CI template ecosystem, providing additional security for module development.

Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
Signed-off-by: Roman Trofimenkov <[email protected]>
…pt for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>
@himax1991 himax1991 self-requested a review October 15, 2025 08:20
@Nikolay1224 Nikolay1224 merged commit ce2b7c3 into main Oct 17, 2025
1 check passed
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
rtrofimenkov-ssdlc added a commit that referenced this pull request Oct 17, 2025
* gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* path fix, added stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* added docker runner tag

Signed-off-by: Roman Trofimenkov <[email protected]>

* tags fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* pipeline refactor for shell executor

Signed-off-by: Roman Trofimenkov <[email protected]>

* gitleaks pipe refactor

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add empty before_script to gitleaks CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* PATH fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Add gitleaks cleanup stage to CI template

Signed-off-by: Roman Trofimenkov <[email protected]>

* Update gitleaks CI template to include optional dependencies and rules for cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* updated error parsind and printing to stdout

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* output fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* stdout fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* fixed cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* cleanup stage fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* depth fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* deleted cleanup stage

Signed-off-by: Roman Trofimenkov <[email protected]>

* report fix

Signed-off-by: Roman Trofimenkov <[email protected]>

* Refactor cleanup process in GitLab CI configuration to use after_script for better clarity and organization.

Signed-off-by: Roman Trofimenkov <[email protected]>

* Remove redundant stages declaration from gitleaks template

Signed-off-by: Roman Trofimenkov <[email protected]>

* fix: add GitLab server host to gitleaks blob URLs

Signed-off-by: Roman Trofimenkov <[email protected]>

---------

Signed-off-by: Roman Trofimenkov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants