Open device management
Find a file
Scott Gress 02c5026436
Allow ESCAPE in LIKE clauses to be valid SQL (#31222)
for #30109

# Details

This PR fixes an issue in our current SQL parsing library that was
causing queries like this to be marked invalid:

```
SELECT * FROM table_name WHERE column_name LIKE '\_%' ESCAPE '\'
```

This is valid in SQLite because the `\` is not considered an escape
character by default. From [the SQLite
docs](https://www.sqlite.org/lang_expr.html) (see section 3 "Literal
Values (Constants)"; emphasis mine):

> A string constant is formed by enclosing the string in single quotes
('). A single quote within the string can be encoded by putting two
single quotes in a row - as in Pascal. C-style escapes using the
backslash character are not supported because they are not standard SQL.

# Use of forked code

Part of the fix for this was [submitted as a PR to the node-sql-parser
library](https://github.com/taozhi8833998/node-sql-parser/pull/2496) we
now use, and merged. I then found that another fix was needed, which I
submitted as [a separate
PR](https://github.com/taozhi8833998/node-sql-parser/pull/2512). As
these fixes have yet to be made part of an official release of the
library, I made a fork off of the release we were using (5.3.10) and
bundled the necessary build artifacts with Fleet. We have an [ADR
proposing the use of submodules for this
purpose](https://github.com/fleetdm/fleet/pull/31079); I'm happy to
implement that instead if we approve that, although for a front-end
module with a build step it's a bit more complicated. Hopefully this
code will be released in `node-sql-parser` soon and we can revert back
to using the dependency.

Here is the [full set of
changes](https://github.com/taozhi8833998/node-sql-parser/compare/master...sgress454:node-sql-parser:5.3.10-plus).

# Checklist for submitter

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [X] Manual QA for all new/changed functionality
2025-07-25 10:13:55 -05:00
.github Group/reword PR template to more easily determine applicable changes, link to examples of host isolation testing via patterns doc (#31155) 2025-07-24 17:41:21 -05:00
.storybook Fleet Design: Add software icons into storybook (#27238) 2025-03-19 09:22:12 -04:00
.vscode Update policies page empty state (#25726) 2025-01-29 11:12:28 -06:00
articles Update roadmap-preview-july-2025.md (#31231) 2025-07-24 12:00:45 -04:00
assets Fleet UI: Add Self-service categories key and filtering (#28506) 2025-05-02 12:11:48 -04:00
changes Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
charts Adding changes for Fleet v4.71.0 (#30599) (#31198) 2025-07-23 16:04:33 -06:00
cmd Enable BYOD service discovery cron (#31228) 2025-07-24 13:28:36 -05:00
docs Group/reword PR template to more easily determine applicable changes, link to examples of host isolation testing via patterns doc (#31155) 2025-07-24 17:41:21 -05:00
ee Remove Context Save TPM command (#31241) 2025-07-25 06:16:00 -03:00
frontend Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
git-hooks Auto-generate and check Android schema.sql (#26720) 2025-02-28 16:30:40 -06:00
handbook Remove Savannah from digexp page (#31247) 2025-07-24 15:26:29 -05:00
infrastructure Dogfood - Enable Fleet TLS connectivity to MySQL (#31201) 2025-07-23 22:01:26 -04:00
it-and-security Configuration for Entra conditional access demo (#31161) 2025-07-22 20:47:02 -05:00
orbit Run fleet desktop with user SELinux context when applicable (#30882) 2025-07-25 08:44:13 -05:00
pkg Better gitops unmarshal type errors (#30647) 2025-07-24 13:49:17 -04:00
proposals Remove proposals (unused) (#26646) 2025-02-27 10:37:07 -06:00
schema Add ability to determine Bitlocker protectors (#31090) 2025-07-24 18:30:55 -04:00
security UI: Improve names, cleanup unused imports (#30434) 2025-06-30 16:00:22 -07:00
server Fix NVD feed generation (#31258) 2025-07-25 08:52:00 -06:00
terraform Clean up "click here" and "here" link anchors - part 1 (#29731) 2025-06-04 13:54:34 -06:00
test/upgrade Simplify DB test/upgrade tool (#27141) 2025-03-14 17:07:41 -03:00
third_party/httpsig-go Added a vendored version of httpsig-go. (#30820) 2025-07-14 20:26:50 +02:00
tools Add permanent errors to Fleet Desktop for TPM-backed httpsig work (#31220) 2025-07-24 19:06:04 -03:00
website added new integration (#31216) 2025-07-25 07:50:49 +09:00
.dockerignore Added support to read jwt and mysql password from a file (#141) 2021-01-04 07:58:43 -08:00
.eslintignore Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
.eslintrc.js update storybook to 8.4.7 (#25451) 2025-01-20 16:17:33 +00:00
.gitattributes Windows friendly changes after walking through getting started guide (#1441) 2021-07-21 20:49:44 -04:00
.gitignore Add arm64 support for fleetd extensions and fixes on test scripts (#31084) 2025-07-21 15:47:59 -03:00
.gitpod.yml Add gitpod yml (#2915) 2021-11-19 10:03:56 -03:00
.golangci.yml Moved fleetctl to fleetctl package. (#28932) 2025-05-07 15:53:35 -05:00
.goreleaser-snapshot.yml Use goreleaser v2 in CI (#23748) 2024-12-03 16:15:31 -06:00
.goreleaser.yml Fix tagging of fleetdm/fleet and fleetdm/fleetctl when releasing (#28251) 2025-04-16 15:48:47 -03:00
.npmignore Move fleetdm.com into main Fleet repo (#83) 2020-12-02 14:48:03 -06:00
.pre-commit-config.yaml bump golangci-lint to 1.55.2 (#18604) 2024-04-30 08:59:14 -06:00
.prettierignore Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
.prettierrc.json add prettier and have it format all fleet application code (#625) 2021-04-12 14:32:25 +01:00
.yarnrc New yarn configuration: Sets installing a dependency to a specific semantic versioning instead of latest stable (#17938) 2024-03-29 10:39:20 -04:00
babel.config.json Fleet Frontend: Create integration tests QuerySidePanel.tests.tsx (#12179) 2023-06-07 12:01:59 -04:00
CHANGELOG.md Adding changes for Fleet v4.71.0 (#30599) (#31198) 2025-07-23 16:04:33 -06:00
CODE_OF_CONDUCT.md Remove @fleetdm.com emails from fleetdm/fleet repo (#882) 2021-05-27 17:19:14 -04:00
codecov.yml Added migration test. 2024-09-09 15:28:15 -05:00
CODEOWNERS Add Rachael as codeowner for /docs/Contributing (#31254) 2025-07-24 16:32:10 -06:00
docker-compose-redis-cluster.yml Move Redis cluster docker yml to separate file (#11162) 2023-04-12 15:14:28 -04:00
docker-compose.yml Migrate from aws-sdk-go v1 to v2 (#30308) 2025-06-30 17:45:39 -03:00
Dockerfile-desktop-linux TPM osquery-perf support (#30994) 2025-07-18 10:19:05 -03:00
go.mod Use ASN.1 format to store TPM child key (#31131) 2025-07-22 21:15:03 -03:00
go.sum Use ASN.1 format to store TPM child key (#31131) 2025-07-22 21:15:03 -03:00
LICENSE Update LICENSE (#10) 2020-11-04 19:57:51 -06:00
Makefile Add SCEP endpoint for host identity. (#30589) 2025-07-11 11:44:07 -03:00
manifest.yml.cloudgov.example cloud.gov deployment (#7611) 2022-09-07 13:30:06 -05:00
osv-scanner.toml We have migrated from aws-sdk-go v1 to v2, remove scanner skip (#30469) 2025-07-02 13:33:31 -03:00
package.json Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
postcss.config.js Upgrade Bourbon to 5.1.0 and fix deprecation warnings (#1973) 2019-01-03 12:46:55 -08:00
README.md Update README.md (#27751) 2025-04-02 10:23:40 -05:00
render.yaml Use Render Redis service (#23056) 2025-01-02 10:07:54 -06:00
SECURITY.md Add scanning to released images and process to track vulnerabilities (#28087) 2025-04-16 11:50:10 -03:00
tsconfig.json Fleet UI: Fix policy software automation fail to report as failing (#26044) 2025-02-28 08:45:33 -05:00
webpack.config.js Add "Require BitLocker PIN" checkbox to disk encryption page (#31132) 2025-07-23 14:36:28 -05:00
yarn.lock Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00

Fleet logo, landscape, dark text, transparent background

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.

A glass city in the clouds

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   Run Tests   Go Report Card   CII Best Practices   Twitter Follow  

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.