CNF-23786: Add --dry-run flag to preview scan targets without scanning#51
Conversation
6585541 to
46b22bd
Compare
smith-xyz
left a comment
There was a problem hiding this comment.
this is a good feature, I think just a few things to clean up would be great before we merge. Let me know if I missed anything
ccd7158 to
4d0705e
Compare
|
/retest |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sebrandon1, smith-xyz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@sebrandon1: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
- Extract discovery phase from PerformClusterScan() into reusable DiscoverTargets() function - Add --dry-run flag that runs pod/port discovery only and prints a tabular summary of scan targets and skipped ports - Works with --all-pods, --targets, and single-host modes - Skip testssl.sh installation check when --dry-run is set
4d0705e to
ab28e2e
Compare
|
@sebrandon1: This pull request references CNF-23786 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/lgtm |
Summary
PerformClusterScan()into reusableDiscoverTargets()function--dry-runflag that runs pod/port discovery only and prints a tabular summary of scan targets and skipped ports--all-pods,--targets, and single-host modes--dry-runis set since it is not needed for discoveryJira: CNF-23786
Example output
Test plan
go build ./...passesgo test ./...passesgo vet ./...passestls-scanner --all-pods --dry-runprints target table and exits without scanningtls-scanner --all-pods --dry-run --namespace-filter openshift-etcdfilters correctlytls-scanner --targets 10.0.0.1:443 --dry-runprints target listtls-scanner --dry-run(single host default) prints single target--dry-runstill works identically