Machine ID: Handle Kernel Version check failing more gracefully#34780
Merged
strideynet merged 3 commits intomasterfrom Nov 21, 2023
Merged
Conversation
bl-nero
reviewed
Nov 21, 2023
espadolini
approved these changes
Nov 21, 2023
| version, err := utils.KernelVersion() | ||
| if err != nil { | ||
| return false, trace.Wrap(err) | ||
| log.WithError(err).Info("Failed to determine kernel version. It will be assumed secure write support is not available.") |
Contributor
There was a problem hiding this comment.
Do we only ever call this once? It's gonna be annoying if we end up accidentally calling this in a loop.
Contributor
Author
There was a problem hiding this comment.
Yup - this is only called on initialisation at the mo.
tigrato
approved these changes
Nov 21, 2023
bl-nero
approved these changes
Nov 21, 2023
|
@strideynet See the table below for backport results.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, if this check failed,
tbotwould crash out, e.g:This occurred in a restricted container environment where much of
/proc/sysis not available (Spacelift).It makes more sense to gracefully degrade to not using kernel features we expect from newer versions.
Closes #34390
changelog: fix
tbotcrashing when used in environments where the kernel version cannot be queried.