for #28118 # Checklist for submitter - [X] Manual QA for all new/changed functionality ## Details This PR adds an `overwrite` option to the "modify app config" API which, if set, causes the code to replace certain keys in the existing config with keys from the incoming config, without attempting any merge. This is then used by GitOps to allow it to easily clear settings that were otherwise being merged together or ignored entirely due to the PATCH semantics expected for the `fleetctl apply` use case. The new setting is utilized in this first pass for the following settings: * `sso_settings` * `smtp_settings` * `features` * `mdm.end_user_authentication` It could be expanded to several more keys that we currently handle piecemeal in the GitOps code by attempting to send empty values to the server (with varying success). Targeting `mdm.end_user_authentication` vs. all of `mdm` is based on [this bug](https://github.com/fleetdm/fleet/issues/26175) being opened. The concern with doing all of `mdm` would be that anyone who had e.g. VPP set up in their app and hadn't set it up in GitOps would have it wiped out. If we're comfortable with that risk I can update that here and update the warning accordingly. ### More detail **The way this code works _without_ Overwrite mode on** 1. We unmarshall the incoming JSON from GitOps into a fresh AppConfig struct `newAppConfig`. Anything keys not present in the incoming JSON will result in default values being set in `newAppConfig` 2. We unmarshall the incoming JSON from GitOps into the current `appConfig`. This uses an internal merge algorithm where keys not present in the JSON will generally leave the matching keys in `appConfig` untouched. We've been dealing with this by having GitOps find missing keys and explicitly set them to non-nil empty states. When arrays are encountered, they are _merged_, not replaced, which is problematic for the `features.additional_queries` use case and probably others. 3. We piecemeal replace certain data in `appConfig` with data from `newAppConfig`, and save it to the db. **The way this works _with_ Overwrite mode on** Between steps 1 and 2 above, we _copy_ certain keys from `newAppConfig` to `appConfig`. If the incoming JSON didn't have a key, the effect will be that `appConfig` now has default values for that key. For nested arrays like `features.additionalQueries`, the value in `appConfig` will be precisely what the user put in GitOps. ## Testing I tested adding/removing these settings with GitOps manually via `fleetctl gitops`. On the main branch I could reproduce the issue where omitting out these keys in my YAML did not lead to the settings being reset on my instance. With the Features settings, the issue was more granular, with inconsistent behavior when trying to remove individual nested settings. On this branch, the settings are cleared as expected at all levels of granularity. I also added some new automated tests to verify the expected behavior for these keys. All existing tests pass. If accepted this PR would supercede https://github.com/fleetdm/fleet/pull/29180 which approaches the issue from the GitOps side for sso, smtp and mdm. Adapting that approach for `features` would require custom logic to declare nested properties as "cleared". |
||
|---|---|---|
| .github | ||
| .storybook | ||
| .vscode | ||
| articles | ||
| assets | ||
| changes | ||
| charts | ||
| cmd | ||
| docs | ||
| ee | ||
| frontend | ||
| git-hooks | ||
| handbook | ||
| infrastructure | ||
| it-and-security | ||
| orbit | ||
| pkg | ||
| proposals | ||
| schema | ||
| security | ||
| server | ||
| terraform | ||
| test/upgrade | ||
| tools | ||
| website | ||
| .dockerignore | ||
| .eslintrc.js | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.yml | ||
| .golangci.yml | ||
| .goreleaser-snapshot.yml | ||
| .goreleaser.yml | ||
| .npmignore | ||
| .pre-commit-config.yaml | ||
| .prettierignore | ||
| .prettierrc.json | ||
| .yarnrc | ||
| babel.config.json | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| codecov.yml | ||
| CODEOWNERS | ||
| docker-compose-redis-cluster.yml | ||
| docker-compose.yml | ||
| Dockerfile-desktop-linux | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| manifest.yml.cloudgov.example | ||
| osv-scanner.toml | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| render.yaml | ||
| SECURITY.md | ||
| tsconfig.json | ||
| webpack.config.js | ||
| yarn.lock | ||
News · Report a bug · Handbook · Why open source? · Art
Open-source platform for IT and security teams with thousands of computers. Designed for APIs, GitOps, webhooks, YAML, and humans.
What's it for?
Organizations like Fastly and Gusto use Fleet for vulnerability reporting, detection engineering, device management (MDM), device health monitoring, posture-based access control, managing unused software licenses, and more.
Explore data
To see what kind of data you can use Fleet to gather, check out the table reference documentation.
Out-of-the-box policies
Fleet includes out-of-the box support for all CIS benchmarks for macOS and Windows, as well as many simpler queries.
Take as much or as little as you need for your organization.
Supported platforms
Here are the platforms Fleet currently supports:
- Linux (all distros)
- macOS
- Windows
- Chromebooks
- Amazon Web Services (AWS)
- Google Cloud (GCP)
- Azure (Microsoft cloud)
- Data centers
- Containers (kube, etc)
- Linux-based IoT devices
Lighter than air
Fleet is lightweight and modular. You can use it for security without using it for MDM, and vice versa. You can turn off features you are not using.
Openness
Fleet is dedicated to flexibility, accessibility, and clarity. We think everyone can contribute and that tools should be as easy as possible for everyone to understand.
Good neighbors
Fleet has no ambition to replace all of your other tools. (Though it might replace some, if you want it to.) Ready-to-use, enterprise-friendly integrations exist for Snowflake, Splunk, GitHub Actions, Vanta, Elastic Jira, Zendesk, and more.
Fleet plays well with Munki, Chef, Puppet, and Ansible, as well as with security tools like Crowdstrike and SentinelOne. For example, you can use the free version of Fleet to quickly report on what hosts are actually running your EDR agent.
Free as in free
The free version of Fleet will always be free. Fleet is independently backed and actively maintained with the help of many amazing contributors.
Longevity
The company behind Fleet is founded (and majority-owned) by true believers in open source. The company's business model is influenced by GitLab (NYSE: GTLB), with great investors, happy customers, and the capacity to become profitable at any time.
In keeping with Fleet's value of openness, Fleet Device Management's company handbook is public and open source. You can read about the history of Fleet and osquery and our commitment to improving the product.
Is it any good?
Fleet is used in production by IT and security teams with thousands of laptops and servers. Many deployments support tens of thousands of hosts, and a few large organizations manage deployments as large as 400,000+ hosts.
Chat
Please join us in MacAdmins Slack or in osquery Slack.
The Fleet community is full of kind and helpful people. Whether or not you are a paying customer, if you need help, just ask.
Contributing
The landscape of cybersecurity and IT is too complex. Let's open it up.
Contributions are welcome, whether you answer questions on Slack / GitHub / StackOverflow / LinkedIn / Twitter, improve the documentation or website, write a tutorial, give a talk at a conference or local meetup, give an interview on a podcast, troubleshoot reported issues, or submit a patch. The Fleet code of conduct is on GitHub.
What's next?
To see what Fleet can do, head over to fleetdm.com and try it out for yourself, grab time with one of the maintainers to discuss, or visit the docs and roll it out to your organization.
Production deployment
Fleet is simple enough to spin up for yourself. Or you can have us host it for you. Premium features are available either way.
Documentation
Complete documentation for Fleet can be found at https://fleetdm.com/docs.
License
The free version of Fleet is available under the MIT license. The commercial license is also designed to allow contributions to paid features for users whose employment agreements allow them to contribute to open source projects. (See LICENSE.md for details.)
Fleet is built on osquery, nanoMDM, Nudge, and swiftDialog.