-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Define timeout for vulnerabilities scan and platform detection #414
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the option names, please.
-timeout → -timeout-scan
-timeout-detect-platform → -timeout
@@ -776,6 +776,8 @@ scan: | |||
[-ask-key-password] | |||
[-debug] | |||
[-pipe] | |||
[-timeout] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-timeout → -timeout-scan
README.md
Outdated
@@ -776,6 +776,8 @@ scan: | |||
[-ask-key-password] | |||
[-debug] | |||
[-pipe] | |||
[-timeout] | |||
[-timeout-detect-platform] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-timeout-detect-platform → -timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this suggestion, since we are in context of Scan, should be -timeout
as main option related to it instead of platform detection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what you mean.
However, timeout
option is required not only for DetectPlatforms
but also for InitServers
.
So, we have three choices.
-timeout(for scan)
,-timeout-detect-platform
,-timeout-init-servers
-timeout(for scan)
,-timeout-except-scan
(forDetectPlatforms
andInitServers
)-timeout
(forDetectPlatforms
andInitServers
),-timeout-scan(for scan)
I think No.3 is good, because InitServers
is called in configtest
.
It seems to be better to align the option name to -timeout
with configtest
and scan
.
Line 167 in 33b2aa2
if err := scan.InitServers(); err != nil { |
Do you have any other good idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After you summarised it, I guess your are right and options 3 looks good. We should try to minimise number of options to not make CLI to complex and chaotic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for understanding!
After you fix the option names, I will merge PR!
Fixed and rebased. |
Many Thanks!! |
What did you implement:
I added configuration for timeouts inside of scan command, which were hard-coded until now. I came across issue with timeouts for platform detection when testing with servers in Europe.
How did you implement it:
By adding two new flags for scan command.
How can we verify it:
Either try connect to servers in opposite side of world with default configuration or decrease timeouts configuration to see that values are used.
Todos:
You don't have to satisfy all of the following.
make fmt
make test
Is this ready for review?: Yes
Is it a breaking change?: No