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(policies): add policy flags to CLI #129

Merged
merged 3 commits into from
Nov 18, 2022

Conversation

elsapet
Copy link
Contributor

@elsapet elsapet commented Nov 17, 2022

Description

  • Add policy flags to flags
  • Add --skip-policy=my_policy,my_other_policy policy flag
  • Add --only-policy=my_policy,my_other_policy policy flag

Note: policy is singular to be consistent with the --skip-path=.. flag which I think can take multiple paths

Examples:

⇒  go run cmd/curio/main.go scan ~/Desktop/test --report=policies --only-policy=some_other_policy,detect_ruby_logger
Target /Users/elsapet/Desktop/test
Scanning target... 100% [========================================] (1/1, 31 files/s) [0s]
[{"result":[{"data_type":"Physical Address","filename":"temp.rb","line_number":1,"policy_description":"Logger leaks detected","policy_id":"detect_ruby_logger","policy_name":"Logger leaks","severity":"high"},{"data_type":"Unique Identifier","filename":"temp.rb","line_number":1,"policy_description":"Logger leaks detected","policy_id":"detect_ruby_logger","policy_name":"Logger leaks","severity":"critical"}]}]



⇒  go run cmd/curio/main.go scan ~/Desktop/test --report=policies --skip-policy=detect_ruby_logger
Target /Users/elsapet/Desktop/test
Scanning target... 100% [========================================] (1/1, 31 files/s) [0s]
null



⇒  go run cmd/curio/main.go scan ~/Desktop/test --report=policies --skip-policy=some_other_policy
Target /Users/elsapet/Desktop/test
Scanning target... 100% [========================================] (1/1, 32 files/s) [0s]
[{"result":[{"data_type":"Physical Address","filename":"temp.rb","line_number":1,"policy_description":"Logger leaks detected","policy_id":"detect_ruby_logger","policy_name":"Logger leaks","severity":"high"},{"data_type":"Unique Identifier","filename":"temp.rb","line_number":1,"policy_description":"Logger leaks detected","policy_id":"detect_ruby_logger","policy_name":"Logger leaks","severity":"critical"}]}]


⇒  go run cmd/curio/main.go scan ~/Desktop/test --report=policies --only-policy=some_other_policy
Target /Users/elsapet/Desktop/test
Scanning target... 100% [========================================] (1/1, 32 files/s) [0s]
null

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@swarmia
Copy link

swarmia bot commented Nov 17, 2022

@elsapet elsapet force-pushed the AMA-3206-add-policy-flags-to-cli branch from f9b6bf3 to ee32f5f Compare November 18, 2022 08:10
@elsapet elsapet force-pushed the AMA-3206-add-policy-flags-to-cli branch from ee32f5f to fa07035 Compare November 18, 2022 08:42
@elsapet elsapet marked this pull request as ready for review November 18, 2022 08:44
cfabianski
cfabianski previously approved these changes Nov 18, 2022
@elsapet elsapet merged commit 94d7c7e into main Nov 18, 2022
@elsapet elsapet deleted the AMA-3206-add-policy-flags-to-cli branch November 18, 2022 10:09
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.

None yet

2 participants