fleet/docs/01-Using-Fleet/standard-query-library
Brock Walters b3acc96c4f
Update standard-query-library.yml (#16271)
It is very easy for data collection like this to veer into double /
triple negative mulitverse of madness stuff...

That said, I may have a lack of understanding about how the product
works, i.e., that a query literally must return a 0 value & not null in
order to "pass" in a policy. If so, then this works as expected.

However, if a query just needs to return empty (null) & 0 is implied in
the logic that sets a policy flag to green or red, then, as a rule,
queries like this should be always be simplified & should default to
using "positive" as opposed to "negative" logic, i.e., check if
something exists, never check if a thing does NOT exist.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

- [x] Added/updated tests: Tested by adding dummy Emergency Kit.pdf
files to Desktop & Downloads, running query, then, removing files &
running query.
2024-02-06 16:27:21 -05:00
..
README.md Update standard query library docs w link (#15131) 2023-11-29 17:15:40 -06:00
standard-query-library.yml Update standard-query-library.yml (#16271) 2024-02-06 16:27:21 -05:00

Standard query library

Fleet's standard query library includes a growing collection of useful policies and miscellaneous queries for organizations deploying Fleet and osquery.

Importing the queries in Fleet

After cloning the fleetdm/fleet repo, import the queries and policies found in docs/01-Using-Fleet/standard-query-library/standard-query-library.yml using fleetctl:

fleetctl apply -f docs/01-Using-Fleet/standard-query-library/standard-query-library.yml

Contributors

Do you want to add your own query?

  1. Please copy the following YAML section and paste it at the bottom of the standard-query-library.yml file.
---
apiVersion: v1
kind: query
spec:
  name: What is your query called? Please use a human-readable query name.
  platforms: What operating systems support your query? This can usually be determined by the osquery tables included in your query. Heading to the https://osquery.io/schema webpage to see which operating systems are supported by the tables you include.
  description: Describe your query. What information does your query reveal? (optional)
  query: Insert query here
  purpose: What is the goal of running your query? Ex. Detection
  remediation: Are there any remediation steps to resolve the detection triggered by your query? If not, insert "N/A."
  contributors: zwass,mike-j-thomas
  tags: Keywords that can help users find other relevant queries; a comma should separate each tag. (e.g., "foo, bar")
  1. Replace each field and submit a pull request to the fleetdm/fleet GitHub repository.

  2. If you want to contribute multiple queries, please open one pull request that includes all your queries.

For instructions on submitting pull requests to Fleet, check out the Committing Changes section in the Contributors documentation.

Additional resources

Listed below are great resources that contain additional queries.