Feature/security scanner enhancements#1
Merged
Conversation
- Change module name from github.com/stephenjarso/secure-push to secure-push - Update golang.org/x/sync to v0.5.0 for Go 1.22 compatibility
- Add basic Finding struct for future use - Prevent compilation errors from empty file
- Add basic package documentation - Prevent compilation errors from empty file
- Add basic package documentation - Prevent compilation errors from empty file
- Fix IsBinaryFile to handle files smaller than 512 bytes - Return correct number of bytes read to avoid false positives - Remove unused min function
- Remove unused map that was causing compilation warning - Clean up code to pass linter checks
- Add SeverityThreshold, IgnoreRules, IgnorePaths, Allowlist, CustomRules fields - Use detectors.Severity type for consistency - Add matchPath helper function for better path matching - Handle non-existent config files gracefully
- Update test cases to use new field names (SeverityThreshold, IgnorePaths) - Fix test expectations for severity filtering - Add detectors import for Severity type
- Convert configFilenames map keys to lowercase - Ensure consistent matching with strings.ToLower in Detect function
- Update empty filename test to expect 0 findings - Empty filename should not match any config file pattern
- Update TestIntegrationScanWithEnvFiles to expect 1 finding - EnvDetector only detects .env file, not secrets within - Update TestIntegrationScanWithSeverityFilter to use SeverityThreshold field
- Add subcommand support: scan, pre-commit, install, version, help - Add runPreCommit function to scan staged files - Add runInstall function to install git pre-commit hook - Add getStagedFiles placeholder for git integration - Improve usage output with command examples
- Add MaxConcurrentFiles constant for concurrency limit - Add DefaultWorkerCount for worker pool configuration - Document parallel scanning utilities
- Add tests for all log levels: Debug, Info, Warn, Error - Add tests for log level filtering - Add tests for custom output writer support
- Add tests for ConsoleReporter, JSONReporter, and GitHubReporter - Test output format and error handling
- Add tests for WalkDir, GetFileSize, FileExists, IsDir - Add tests for GetRelativePath and ValidatePath - Test error handling for edge cases
- Add tests for IsBinaryFile, IsBinary, GetFileExtension, IsTextFile - Test edge cases: small files, large files, files in subdirectories - Test error handling for nonexistent files
- Add all built-in detectors to the reference table - Add detector best practices section - Improve documentation formatting and examples
- Add max_file_size, enable_detectors, disable_detectors options - Add common configuration patterns section - Improve documentation structure and examples
- Add CSVReporter struct for CSV output format - Add NewCSVReporter constructor function - Output findings with Rule, Severity, File, Line, Message columns
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.
What does this PR do?
Describe the changes in this PR.
Which detectors does it affect?
Testing done
Checklist
Screenshots (if applicable)
Add screenshots to help explain your changes.