Commit fcd8264
feat(general): Add BC_CA_BUNDLE environment variable support for custom CA certificates (#7419)
* feat: Add BC_CA_BUNDLE environment variable support for custom CA certificates
This change adds support for the BC_CA_BUNDLE environment variable in the
GitGetter._clone() function. When set, it configures GIT_SSL_CAINFO to use
the specified CA bundle file, enabling git clone operations to work with
on-prem GitLab/GitHub instances that use self-signed or custom CA certificates.
Changes:
- Modified _clone() to check for BC_CA_BUNDLE env var
- When BC_CA_BUNDLE is set, GIT_SSL_CAINFO is configured with its value
- PROXY_URL settings take precedence over BC_CA_BUNDLE
- Added unit tests for the new functionality
Usage:
export BC_CA_BUNDLE=/path/to/ca-bundle.crt
checkov -d . --download-external-modules true
* refactor: Use env_vars_config instead of os.getenv for environment variables
Updated the code to use env_vars_config from checkov.common.util.env_vars_config
instead of directly calling os.getenv(). This follows the project's pattern for
handling environment variables.
Changes:
- Import env_vars_config instead of os
- Use env_vars_config.BC_CA_BUNDLE instead of os.getenv('BC_CA_BUNDLE')
- Use env_vars_config.PROXY_* instead of os.getenv('PROXY_*')
- Updated tests to mock env_vars_config instead of os.environ1 parent ec7a5e8 commit fcd8264
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments