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

feat(general): Change behavior where if a config file is missing, run the scan as if there was no config file #6926

Merged
merged 10 commits into from
Jan 6, 2025

Conversation

tsmithv11
Copy link
Collaborator

@tsmithv11 tsmithv11 commented Dec 31, 2024

User description

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Change behavior where if a config file is missing, run the scan as if there was no config file

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

Generated description

Below is a concise technical summary of the changes proposed in this PR:

Implements a new feature to handle missing config files gracefully. Adds an environment variable ENABLE_CONFIG_FILE_VALIDATION to control this behavior. Updates the parse_config method in the Checkov class to validate the config file's existence before parsing. Adds new tests to verify this functionality and updates documentation to reflect the changes.

TopicDetails
Testing Adds new tests to verify the behavior of missing config file handling
Modified files (1)
  • integration_tests/test_checkov_config.py
Latest Contributors(2)
UserCommitDate
gruebelfix-testOctober 24, 2023
[email protected]...Fix-custom-guidelines-...November 12, 2021
Config File Handling Implements graceful handling of missing config files by adding a new environment variable and updating the config parsing logic
Modified files (3)
  • checkov/main.py
  • checkov/common/util/env_vars_config.py
  • docs/2.Basics/CLI Command Reference.md
Latest Contributors(2)
UserCommitDate
tsmithv11docs-general-docs-flag...December 03, 2024
OfekShimkofeat-sca-support-java-...November 18, 2024
This pull request is reviewed by Baz. Join @tsmithv11 and the rest of your team on (Baz).

@tsmithv11 tsmithv11 changed the title break(general): Change behavior where if a config file is missing, run the scan as if there was no config file feat(general): Change behavior where if a config file is missing, run the scan as if there was no config file Jan 3, 2025
@tsmithv11 tsmithv11 merged commit d28f6b5 into main Jan 6, 2025
34 of 35 checks passed
@tsmithv11 tsmithv11 deleted the handle-no-config branch January 6, 2025 07:55
Saarett pushed a commit that referenced this pull request Jan 6, 2025
… the scan as if there was no config file (#6926)

* Initial commit

* fix mock issue

* fix for windows

* Moving to env var

* fix flake8

* Update CLI Command Reference.md

* Add other variables
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