Skip to content

CNF-24706: Make scan timeouts configurable via CLI flags - #74

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
sebrandon1:configurable-scan-timeouts
Jun 8, 2026
Merged

CNF-24706: Make scan timeouts configurable via CLI flags#74
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
sebrandon1:configurable-scan-timeouts

Conversation

@sebrandon1

Copy link
Copy Markdown
Member

Summary

The batch scan timeout formula and testssl.sh connect/openssl timeouts were hardcoded, preventing users from tuning for large clusters or slow networks.

  • Add --scan-timeout-per-target (default 90s) — controls per-target component of the batch timeout formula
  • Add --connect-timeout (default 5s) — controls testssl.sh --connect-timeout and --openssl-timeout
  • Validate both flags are positive integers
  • Centralize pod exec timeout as a package constant (no flag — internal detail)

Test plan

  • make lint — 0 issues
  • go test ./... — all pass
  • --help shows new flags with correct defaults
  • --connect-timeout 0 rejected with exit code 2
  • Non-default values propagate to testssl.sh invocation (verify via --log-level debug)

Add --scan-timeout-per-target and --connect-timeout flags so users can
tune the batch scan timeout formula and testssl.sh connect/openssl
timeouts. Introduce ScanTimeouts struct with DefaultScanTimeouts for
centralized defaults. Centralize pod exec timeout as a package constant.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 8, 2026

Copy link
Copy Markdown

@sebrandon1: This pull request references CNF-24706 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.

Details

In response to this:

Summary

The batch scan timeout formula and testssl.sh connect/openssl timeouts were hardcoded, preventing users from tuning for large clusters or slow networks.

  • Add --scan-timeout-per-target (default 90s) — controls per-target component of the batch timeout formula
  • Add --connect-timeout (default 5s) — controls testssl.sh --connect-timeout and --openssl-timeout
  • Validate both flags are positive integers
  • Centralize pod exec timeout as a package constant (no flag — internal detail)

Test plan

  • make lint — 0 issues
  • go test ./... — all pass
  • --help shows new flags with correct defaults
  • --connect-timeout 0 rejected with exit code 2
  • Non-default values propagate to testssl.sh invocation (verify via --log-level debug)

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.

@openshift-ci
openshift-ci Bot requested review from rhmdnd and smith-xyz June 8, 2026 18:28
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

@sebrandon1: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@smith-xyz smith-xyz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall a good add - just one rec to keep the current defaults that were embedded in the exec

Comment thread internal/scanner/types.go
}

var DefaultScanTimeouts = ScanTimeouts{
PerTargetSeconds: 90,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should ensure that the jobs in prow aren't going to abruptly fail. Might be best to keep per target at 5 as well as a default to match the current behavior.

Just some background on this. Everytime we spin up a testssl pid its a blocking event for go. Ended up adding in the low timeouts because we would discover a good number of ips/ports that would timeout when we attempted tls. We were hitting 4+ hour runs and that wasn't feasible. testssl does a deep dive so it is also costly. It could be more performant but just haven't had a chance to look at it again.

I think for now probably just best to keep the default and allow others to override for their needs.

@sebrandon1 sebrandon1 Jun 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good context on the testssl timeout history, thanks for sharing that.

The defaults here match the existing hardcoded values exactly: PerTargetSeconds: 90 (from the len(targets)*90+120 formula) and ConnectTimeout: 5 (from the --connect-timeout 5 / --openssl-timeout 5 args). So current Prow jobs will behave identically without any flag overrides.

The flags are opt-in only. Users who need longer timeouts for specific environments can pass --connect-timeout 10 etc., but the out-of-the-box behavior is unchanged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice! thanks for keeping me honest I misread that "connectTimeoutStr" was used for both the flags down with testssl. Then I think this should be good to go

@smith-xyz

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 8, 2026
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 5dfdd6a into openshift:main Jun 8, 2026
4 checks passed
@sebrandon1
sebrandon1 deleted the configurable-scan-timeouts branch June 8, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants