Skip to content

Resolve security scan errors#7

Merged
PhilipMathieu merged 2 commits intomainfrom
claude/fix-security-scan-01Cu7daN9QJ2hWgk9dYoXB1H
Nov 16, 2025
Merged

Resolve security scan errors#7
PhilipMathieu merged 2 commits intomainfrom
claude/fix-security-scan-01Cu7daN9QJ2hWgk9dYoXB1H

Conversation

@PhilipMathieu
Copy link
Owner

Resolve security scanning errors

claude and others added 2 commits November 16, 2025 21:57
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.
@github-actions
Copy link

github-actions bot commented Nov 16, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-11-16 22:03 UTC

@PhilipMathieu PhilipMathieu merged commit 4ffa579 into main Nov 16, 2025
10 of 14 checks passed
@PhilipMathieu PhilipMathieu deleted the claude/fix-security-scan-01Cu7daN9QJ2hWgk9dYoXB1H branch November 16, 2025 22:02
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.

2 participants