Merged
Conversation
This commit addresses all 17 security warnings identified by Bandit: 1. Fixed B110 (try/except/pass) in probe_data_sources.py: - Added proper logging for caught exceptions instead of silently swallowing them - Now logs debug messages when date parsing or network errors occur 2. Fixed B101 (assert_used) across multiple files: - Replaced assert statements with proper runtime type checks - Changed asserts to raise TypeError with descriptive messages - Removed unnecessary type-narrowing asserts where code structure guarantees type 3. Fixed B404 (subprocess import) in process_updated_data.py: - Added nosec comment with justification - Subprocess is used safely with controlled command lists, not shell=True 4. Fixed B603 (subprocess call) in process_updated_data.py: - Added nosec comment to subprocess.run() call - Command is constructed from trusted sources only Files modified: - src/probe_data_sources.py: Fixed try/except/pass and assert statement - src/validate_data.py: Replaced all assert statements with proper checks - src/process_updated_data.py: Added nosec comments for safe subprocess usage - src/update_data_sources.py: Replaced assert statements with type checks Bandit scan now reports: No issues identified.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve security scanning errors