slalombuild / secureli

seCureLI is a tool that enables you to experience the delight of building products by helping you get ideas from your head into working software as frictionlessly as possible, in a reliable, secure, scalable, and observable way.
Apache License 2.0
29 stars 3 forks source link

feat: Added functionality to specify a custom scan when using the scan command #565

Closed ian-bowden-slalom closed 3 weeks ago

ian-bowden-slalom commented 3 weeks ago

secureli-XXX

Changes

This PR improves the scan action by adding new functionality allowing users to specify a custom scan id instead of only being able to specify pre-commit hook ids. For example, you can now do secureli scan -t check-pii to run the pii scan.

A new service was introduced, CustomScannersService to help orchestrate which custom scans should be run. Either a specific scan if an Id is specified, all custom scans if no id is specified, or a None result is returned if the specified id doesn't match a value in the new CustomScanId enum. 

There was also some refactoring done. modules/core/core_services/scanner.py is now modules/core/core_services/hook_scanner.py to more accurately describe its function. The pii scanner and custom_regex_scanner directories have been moved into a new directory; secureli/modules/custom_scanners/

Testing

Added unit tests and performed manual testing to confirm that pre-commit hooks can be specified, custom scans can be specified, and when no id is specified, then all scans are done

Clean Code Checklist