Skip to content

Conversation

bufferoverflow
Copy link
Contributor

Description:

Sometimes it's easier to set an environment variable with the config file content instead of providing a file to the environment where gitleaks is used.
E.g., setting an instance variable on a self-hosted GitLab with the new option GITLEAKS_CONFIG_TOML containing the content of the Gitleaks toml file is much simpler then downloading a file or deploy a config file to all runners.

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

@bufferoverflow bufferoverflow force-pushed the feat/toml-file-content-as-env branch from b9ea1be to 415ea16 Compare January 15, 2025 10:00
@bufferoverflow
Copy link
Contributor Author

@zricethezav this would simplify a lot for us, WDYT?

@bufferoverflow
Copy link
Contributor Author

@rgmz What do you think about this feature? Anything missing?

Copy link
Contributor

@rgmz rgmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments; seems like a straightforward change.

@bufferoverflow bufferoverflow force-pushed the feat/toml-file-content-as-env branch from 94ee348 to 6321dca Compare March 9, 2025 17:01
@rgmz
Copy link
Contributor

rgmz commented Mar 9, 2025

Everything looks good to me. Ball is in @zricethezav's court now to merge.

README.md Outdated
@@ -73,6 +73,31 @@ cd gitleaks
make build
```

### Load Configuration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bufferoverflow this section should go after the Pre-commit section and before the Configuration section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zricethezav I just changed accordingly with a9074dd

@bufferoverflow bufferoverflow force-pushed the feat/toml-file-content-as-env branch from 34c9cd8 to a9074dd Compare March 20, 2025 08:16
@zricethezav zricethezav merged commit a503b58 into gitleaks:master Mar 22, 2025
2 checks passed
sirakav pushed a commit to sirakav/gitleaks that referenced this pull request Apr 25, 2025
…ks#1662)

* feat: add option to set config from env var with toml content

* Update README.md

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* fix: check if config provided by GITLEAKS_CONFIG_TOML can be loaded

* docs: move load configuration section to have it before configuration

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
alayne222 pushed a commit to alayne222/gitleaks that referenced this pull request May 28, 2025
…ks#1662)

* feat: add option to set config from env var with toml content

* Update README.md

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* fix: check if config provided by GITLEAKS_CONFIG_TOML can be loaded

* docs: move load configuration section to have it before configuration

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
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.

3 participants