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

VA: Check that maxRemoteValidationFailures is non-negative #7150

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

pgporada
Copy link
Member

@pgporada pgporada commented Nov 8, 2023

Prevents a panic when the VA config field maxRemoteValidationFailures is set to a negative number by adding validation tags

Fixes #7149

@pgporada pgporada requested a review from a team as a code owner November 8, 2023 22:23
@aarongable
Copy link
Contributor

Couldn't this also be done as a config validation tag here?

@pgporada
Copy link
Member Author

pgporada commented Nov 9, 2023

Couldn't this also be done as a config validation tag here?

That's a much better plan. The select validation tags now treat the field as optional due to omitempty which allows it to take its zero value. If the field is present, it will check that it's non-negative with min=0. It appears the only time this field is necessary is when on-prem VA has RemoteVAs configured so I added a required_with=RemoteVAs.

@pgporada
Copy link
Member Author

pgporada commented Nov 9, 2023

Govulncheck is failing because we're running on go1.21.3 which contains a CVE for Windows file path parsing - which we don't build for.

@beautifulentropy beautifulentropy requested a review from a team November 13, 2023 17:13
@pgporada pgporada merged commit 104c393 into main Nov 15, 2023
12 checks passed
@pgporada pgporada deleted the fix-va-config-panic branch November 15, 2023 16:03
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.

VA panics when maxRemoteValidationFailures is a negative value
3 participants