-
Notifications
You must be signed in to change notification settings - Fork 427
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
Add GitOps docs for "No team" #22273
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.
Couple tweaks, but largely LGTM
platform: linux | ||
description: "This policy checks that Firefox is installed and up to date." | ||
resolution: "Install Firefox version 129.0.2 or higher." | ||
query: "SELECT 1 FROM deb_packages WHERE name = 'firefox' AND version_compare(version, '129.0.2') >= 0;" |
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.
Let's use 129.0.3 here; I know the query for 129.0.2 is bugged based on the rest of the build string Mozilla provides, so this is a bad example 😬
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 don't follow sorry, this example has been working for me on my Ubuntu VM.
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.
So, I tested an upgrade path from Firefox 129.0.0, as https://ftp.mozilla.org/pub/firefox/releases/129.0/linux-x86_64/en-US/firefox-129.0.deb. The version string on that .deb is 129.0~build2
, which appears to pass the version_compare call against 129.0.2, so it wouldn't register as outdated and the upgrade wouldn't be pushed.
It looks like this isn't a one-off either, as e.g. the current 129.0.2 for amd64 is build1.
I was able to repro this in my QA of #20895 / #19551. Let me know if you need help repro'ing this.
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.
Oh gotcha. Makes sense.
Isn't this broken for 129.0.3 too?
osquery> select version_compare('129.0~build2', '129.0.3') >= 0;
+-------------------------------------------------+
| version_compare('129.0~build2', '129.0.3') >= 0 |
+-------------------------------------------------+
| 1 |
+-------------------------------------------------+
We could amend the query to remove any build
suffixes or add a patch version 0
when it isn't present.
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.
Ah, yep.
And yeah, we should take that into account on the query if we're using FF as an example. I'm sure it's not the only package with an issue like this.
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.
Yes, very hard to detect all edge cases with all apps, but... that's the point of this feature, you write a query per app (trade off ease of use vs flexibility). For most cases the compare_version SQL will work, if it doesn't you can modify it for your custom app/scripts.
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.
Yep. Having this for FF May be a good way to show "if you need to customize for edge cases, this is how you could"
Co-authored-by: Ian Littman <[email protected]>
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.
This is looking good! Added a couple commits to make examples consistent w/ how we're handling them in current reference docs.
@lucasmrod when you get the chance, can you please open a PR against the fleetdm/fleet-gitops repo to add a template teams/no-team.yml
file?
Will do. (Once we release 4.57.0 because the action uses the last released |
Hey @lucasmrod heads up, I closed this PR and opened a new one here (w/ same changes) against the docs-v4.57.0 branch. As of 4.57.0, each minor release has it's own reference docs branch as part of a new process to make sure that every change to how Fleet is used is reflected live on the website in reference documentation at release day: https://github.com/fleetdm/fleet/pull/22284/files#diff-d426c2ae6cac2a2baffd54adae00ad7bb936dbb17a873f93a327d5763f7fb574R141 |
Gotcha. I thought we were starting this new process on v4.58.0 given there was just one PR against |
I decided to start it this release (4.57) to give it a test drive :) |
As of 4.57.0, each minor release has it's own reference docs branch as part of a new process to make sure that every change to how Fleet is used is reflected live on the website in reference documentation at release day: https://github.com/fleetdm/fleet/pull/22284/files#diff-d426c2ae6cac2a2baffd54adae00ad7bb936dbb17a873f93a327d5763f7fb574R141
Docs for #21790.