Contributors
Want to add your own query? Please submit a pull request
-
+
over on GitHub
.
From d9b2f4a6fbe1c03aeafdfb598f8db481a5e6d9be Mon Sep 17 00:00:00 2001
From: Zach Wasserman
Date: Tue, 21 Sep 2021 17:08:58 -0700
Subject: [PATCH 49/82] Add --tag flag to fleetctl preview (#2171)
Allows specifying a version of the Fleet image to run.
---
changes/preview-tag | 1 +
cmd/fleetctl/preview.go | 10 ++++++++++
2 files changed, 11 insertions(+)
create mode 100644 changes/preview-tag
diff --git a/changes/preview-tag b/changes/preview-tag
new file mode 100644
index 0000000000..29f11331dd
--- /dev/null
+++ b/changes/preview-tag
@@ -0,0 +1 @@
+* Allow specifying Fleet version in `fleetctl preview` with `--tag` flag.
diff --git a/cmd/fleetctl/preview.go b/cmd/fleetctl/preview.go
index c55750bca4..7afc3d9bf2 100644
--- a/cmd/fleetctl/preview.go
+++ b/cmd/fleetctl/preview.go
@@ -24,6 +24,7 @@ const (
downloadUrl = "https://github.com/fleetdm/osquery-in-a-box/archive/master.zip"
standardQueryLibraryUrl = "https://raw.githubusercontent.com/fleetdm/fleet/main/docs/01-Using-Fleet/standard-query-library/standard-query-library.yml"
licenseKeyFlagName = "license-key"
+ tagFlagName = "tag"
)
func previewCommand() *cli.Command {
@@ -45,6 +46,11 @@ Use the stop and reset subcommands to manage the server and dependencies once st
Name: licenseKeyFlagName,
Usage: "License key to enable Fleet Premium (optional)",
},
+ &cli.StringFlag{
+ Name: tagFlagName,
+ Usage: "Run a specific version of Fleet",
+ Value: "latest",
+ },
},
Action: func(c *cli.Context) error {
if err := checkDocker(); err != nil {
@@ -72,6 +78,10 @@ Use the stop and reset subcommands to manage the server and dependencies once st
return errors.Wrap(err, "make logs writable")
}
+ if err := os.Setenv("FLEET_VERSION", c.String(tagFlagName)); err != nil {
+ return errors.Wrap(err, "failed to set Fleet version")
+ }
+
fmt.Println("Pulling Docker dependencies...")
out, err := exec.Command("docker-compose", "pull").CombinedOutput()
if err != nil {
From 4d36400fe5b1aab56e37b0a6e6c096a32dd11efa Mon Sep 17 00:00:00 2001
From: Zach Wasserman
Date: Tue, 21 Sep 2021 18:23:11 -0700
Subject: [PATCH 50/82] Prepare for 4.3.1 release (#2177)
---
CHANGELOG.md | 53 ++++++++++++++++---
changes/2107-sidebar-style | 1 -
changes/2112-flaky-observer-hosts | 1 -
changes/add-jitter-percent | 1 -
changes/ensure-only-one-row-disk-space | 1 -
changes/improve-speed-of-migration | 1 -
changes/issue-1512-filter-queries | 1 -
changes/issue-1893-team-policies | 1 -
.../issue-1950-logging-filesystem-fail-early | 1 -
changes/issue-1963-vulnerabilities-no-sync | 2 -
changes/issue-1964-list-software | 1 -
changes/issue-1969-redis-config | 2 -
changes/issue-2062-team-maintainer-run-new | 1 -
changes/preview-tag | 1 -
changes/remove-fk-label-membership | 1 -
changes/skip-save-users-if-disabled | 1 -
charts/fleet/Chart.yaml | 4 +-
charts/fleet/values.yaml | 2 +-
.../deploy/terraform-aws-fargate/database.tf | 12 +++++
.../deploy/terraform-aws-fargate/variables.tf | 1 +
tools/docker-fleetctl-awscli/Dockerfile | 4 ++
tools/fleetctl-npm/package.json | 2 +-
22 files changed, 67 insertions(+), 28 deletions(-)
delete mode 100644 changes/2107-sidebar-style
delete mode 100644 changes/2112-flaky-observer-hosts
delete mode 100644 changes/add-jitter-percent
delete mode 100644 changes/ensure-only-one-row-disk-space
delete mode 100644 changes/improve-speed-of-migration
delete mode 100644 changes/issue-1512-filter-queries
delete mode 100644 changes/issue-1893-team-policies
delete mode 100644 changes/issue-1950-logging-filesystem-fail-early
delete mode 100644 changes/issue-1963-vulnerabilities-no-sync
delete mode 100644 changes/issue-1964-list-software
delete mode 100644 changes/issue-1969-redis-config
delete mode 100644 changes/issue-2062-team-maintainer-run-new
delete mode 100644 changes/preview-tag
delete mode 100644 changes/remove-fk-label-membership
delete mode 100644 changes/skip-save-users-if-disabled
create mode 100644 tools/deploy/terraform-aws-fargate/database.tf
create mode 100644 tools/deploy/terraform-aws-fargate/variables.tf
create mode 100644 tools/docker-fleetctl-awscli/Dockerfile
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 010e4736e1..8551a049a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,42 @@
+## Fleet 4.3.1 (Sept 21, 2021)
+
+* Add `fleetctl get software` to list all software and the detected vulnerabilities.
+
+* Add `fleetctl vulnerability-data-stream` command to sync the vulnerabilities processing data streams by hand.
+
+* Add `vulnerabilities.disable_data_sync` config to fleet serve to avoid downloading the data streams.
+
+* Allow specifying Fleet version in `fleetctl preview` with `--tag` flag.
+
+* Allow team maintainers to run new queries in the team hosts.
+
+* Only show observers queries they can run.
+
+* Add redis configuration option to retry failed connections.
+
+* Add redis configuration option to follow cluster redirections.
+
+* Add jitter percent for osquery update intervals to prevent all hosts from returning data at
+ roughly the same time. Note that this improves the Fleet server performance, but it will now take
+ longer for new labels to populate.
+
+* Improve the performance of certain database migrations that were preventing users from updating to
+ 4.3.0.
+
+* Reduce database load for label membership recording.
+
+* Add team policies.
+
+* Fix intermittent blank screen for observers on manage hosts page
+
+* Fix sidebar style on query page.
+
+* Fix a bug detecting disk space for hosts.
+
+* Fail early if the process does not have permissions to write to the logging file.
+
+* Completely skip trying to save host users and software inventory if it's disabled.
+
## Fleet 4.3.0 (Sept 13, 2021)
* Add Policies feature for detecting device compliance with organizational policies.
@@ -138,7 +177,7 @@
* Add ability to create a Team schedule in Fleet. The Schedule feature was released in Fleet 4.1.0. For more information on the new Schedule feature, check out the [Fleet 4.1.0 release blog post](https://blog.fleetdm.com/fleet-4-1-0-57dfa25e89c1). *Available for Fleet Basic customers*.
-* Add Beta Vulnerable software feature which surfaces vulnerable software on the **Host details** page and the `GET /api/v1/fleet/hosts/{id}` API route. For information on how to configure the Vulnerable software feature and how exactly Fleet processes vulnerabilities, check out the [Vulnerability processing documentation](https://github.com/fleetdm/fleet/blob/main/docs/1-Using-Fleet/13-Vulnerability-Processing.md#vulnerability-processing).
+* Add Beta Vulnerable software feature which surfaces vulnerable software on the **Host details** page and the `GET /api/v1/fleet/hosts/{id}` API route. For information on how to configure the Vulnerable software feature and how exactly Fleet processes vulnerabilities, check out the [Vulnerability processing documentation](https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/13-Vulnerability-Processing.md#vulnerability-processing).
* Add ability to see which logging destination is configured for Fleet in the Fleet UI. To see this information, head to the **Schedule** page and then select "Schedule a query." Configured logging destination information is also available in the `GET api/v1/fleet/config` API route.
@@ -148,9 +187,9 @@
* Add ability to modify scheduled queries in your Schedule in Fleet. The Schedule feature was released in Fleet 4.1.0. For more information on the new Schedule feature, check out the [Fleet 4.1.0 release blog post](https://blog.fleetdm.com/fleet-4-1-0-57dfa25e89c1).
-* Add ability to disable the Users feature in Fleet by setting the new `enable_host_users` key to `true` in the `config` yaml, configuration file. For documentation on using configuration files in yaml syntax, check out the [Using yaml files in Fleet](https://github.com/fleetdm/fleet/tree/main/docs/1-Using-Fleet/configuration-files#using-yaml-files-in-fleet) documentation.
+* Add ability to disable the Users feature in Fleet by setting the new `enable_host_users` key to `true` in the `config` yaml, configuration file. For documentation on using configuration files in yaml syntax, check out the [Using yaml files in Fleet](https://github.com/fleetdm/fleet/tree/main/docs/01-Using-Fleet/configuration-files#using-yaml-files-in-fleet) documentation.
-* Improve performance of the Software inventory feature. Software inventory is currently under a feature flag. To enable this feature flag, check out the [feature flag documentation](https://github.com/fleetdm/fleet/blob/main/docs/2-Deploying/2-Configuration.md#feature-flags).
+* Improve performance of the Software inventory feature. Software inventory is currently under a feature flag. To enable this feature flag, check out the [feature flag documentation](https://github.com/fleetdm/fleet/blob/main/docs/02-Deploying/02-Configuration.md#feature-flags).
* Improve performance of inserting `pack_stats` in the database. The `pack_stats` information is used to display "Frequency" and "Last run" information for a specific host's scheduled queries. You can find this information on the **Host details** page.
@@ -329,9 +368,9 @@ There are currently no known issues in this release. However, we recommend only
The primary additions in Fleet 4.0.0 are the new Role-based access control (RBAC) and Teams features.
-RBAC adds the ability to define a user's access to information and features in Fleet. This way, more individuals in an organization can utilize Fleet with appropriate levels of access. Check out the [permissions documentation](https://github.com/fleetdm/fleet/blob/main/docs/1-Using-Fleet/9-Permissions.md) for a breakdown of the new user roles and their respective capabilities.
+RBAC adds the ability to define a user's access to information and features in Fleet. This way, more individuals in an organization can utilize Fleet with appropriate levels of access. Check out the [permissions documentation](https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/09-Permissions.md) for a breakdown of the new user roles and their respective capabilities.
-Teams adds the ability to separate hosts into exclusive groups. This way, users can easily observe and apply operations to consistent groups of hosts. Read more about the Teams feature in [the documentation here](https://github.com/fleetdm/fleet/blob/main/docs/1-Using-Fleet/10-Teams.md).
+Teams adds the ability to separate hosts into exclusive groups. This way, users can easily observe and apply operations to consistent groups of hosts. Read more about the Teams feature in [the documentation here](https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/10-Teams.md).
There are several known issues that will be fixed for the stable release of Fleet 4.0.0. Therefore, we recommend only upgrading to Fleet 4.0.0 RC1 for testing purposes. Please file a GitHub issue for any issues discovered when testing Fleet 4.0.0!
@@ -399,7 +438,7 @@ Fleet 4.0.0 is a major release and introduces several breaking changes and datab
* Improve Fleet performance by batch updating host seen time instead of updating synchronously. This improvement reduces MySQL CPU usage by ~33% with 4,000 simulated hosts and MySQL running in Docker.
-* Add support for software inventory, introducing a list of installed software items on each host's respective _Host details_ page. This feature is flagged off by default (for now). Check out [the feature flag documentation for instructions on how to turn this feature on](./docs/2-Deploying/2-Configuration.md#software-inventory).
+* Add support for software inventory, introducing a list of installed software items on each host's respective _Host details_ page. This feature is flagged off by default (for now). Check out [the feature flag documentation for instructions on how to turn this feature on](./docs/02-Deploying/02-Configuration.md#software-inventory).
* Add Windows support for `fleetctl` agent autoupdates. The `fleetctl updates` command provides the ability to self-manage an agent update server. Available for Fleet Basic customers.
@@ -867,7 +906,7 @@ to 2.0.0.
## Kolide Fleet 2.0.0 (currently preparing for release)
-The primary new addition in Fleet 2 is the new `fleetctl` CLI and file-format, which dramatically increases the flexibility and control that administrators have over their osquery deployment. The CLI and the file format are documented [in the Fleet documentation](https://github.com/fleetdm/fleet/blob/main/docs/1-Using-Fleet/2-fleetctl-CLI.md).
+The primary new addition in Fleet 2 is the new `fleetctl` CLI and file-format, which dramatically increases the flexibility and control that administrators have over their osquery deployment. The CLI and the file format are documented [in the Fleet documentation](https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/02-fleetctl-CLI.md).
### New Features
diff --git a/changes/2107-sidebar-style b/changes/2107-sidebar-style
deleted file mode 100644
index 0a50d56a17..0000000000
--- a/changes/2107-sidebar-style
+++ /dev/null
@@ -1 +0,0 @@
-- Fixed sidebar style
\ No newline at end of file
diff --git a/changes/2112-flaky-observer-hosts b/changes/2112-flaky-observer-hosts
deleted file mode 100644
index 8017ebafb2..0000000000
--- a/changes/2112-flaky-observer-hosts
+++ /dev/null
@@ -1 +0,0 @@
-- Fixed intermittent blank screen for observers on manage hosts page
\ No newline at end of file
diff --git a/changes/add-jitter-percent b/changes/add-jitter-percent
deleted file mode 100644
index 7bc0e30d32..0000000000
--- a/changes/add-jitter-percent
+++ /dev/null
@@ -1 +0,0 @@
-* Add jitter percent for osquery update intervals to prevent all hosts from returning data at roughly the same time.
diff --git a/changes/ensure-only-one-row-disk-space b/changes/ensure-only-one-row-disk-space
deleted file mode 100644
index 1e23bec84e..0000000000
--- a/changes/ensure-only-one-row-disk-space
+++ /dev/null
@@ -1 +0,0 @@
-* Ensure only one row is returned when checking for disk space in hosts.
diff --git a/changes/improve-speed-of-migration b/changes/improve-speed-of-migration
deleted file mode 100644
index 203c2faa3d..0000000000
--- a/changes/improve-speed-of-migration
+++ /dev/null
@@ -1 +0,0 @@
-* Improve the performance of certain database migrations that were preventing users from updating.
diff --git a/changes/issue-1512-filter-queries b/changes/issue-1512-filter-queries
deleted file mode 100644
index 4ed072c52b..0000000000
--- a/changes/issue-1512-filter-queries
+++ /dev/null
@@ -1 +0,0 @@
-* Only show observers queries they can run.
diff --git a/changes/issue-1893-team-policies b/changes/issue-1893-team-policies
deleted file mode 100644
index 62e8b159ad..0000000000
--- a/changes/issue-1893-team-policies
+++ /dev/null
@@ -1 +0,0 @@
-* Add team policies.
diff --git a/changes/issue-1950-logging-filesystem-fail-early b/changes/issue-1950-logging-filesystem-fail-early
deleted file mode 100644
index 306f88436e..0000000000
--- a/changes/issue-1950-logging-filesystem-fail-early
+++ /dev/null
@@ -1 +0,0 @@
-* Fail early if the process does not have permissions to write to the logging file.
diff --git a/changes/issue-1963-vulnerabilities-no-sync b/changes/issue-1963-vulnerabilities-no-sync
deleted file mode 100644
index c99dd2d4a7..0000000000
--- a/changes/issue-1963-vulnerabilities-no-sync
+++ /dev/null
@@ -1,2 +0,0 @@
-* Add fleetctl vulnerability-data-stream command to sync the vulnerabilities processing data streams by hand.
-* Add vulnerabilities.disable_data_sync config to fleet serve to avoid downloading the data streams.
diff --git a/changes/issue-1964-list-software b/changes/issue-1964-list-software
deleted file mode 100644
index c6607ea255..0000000000
--- a/changes/issue-1964-list-software
+++ /dev/null
@@ -1 +0,0 @@
-* Add `fleetctl get software` to list all software and the detected vulnerabilities.
diff --git a/changes/issue-1969-redis-config b/changes/issue-1969-redis-config
deleted file mode 100644
index dbbbcf214e..0000000000
--- a/changes/issue-1969-redis-config
+++ /dev/null
@@ -1,2 +0,0 @@
-* Add redis configuration option to retry failed connections.
-* Add redis configuration option to follow cluster redirections.
diff --git a/changes/issue-2062-team-maintainer-run-new b/changes/issue-2062-team-maintainer-run-new
deleted file mode 100644
index eed0492a76..0000000000
--- a/changes/issue-2062-team-maintainer-run-new
+++ /dev/null
@@ -1 +0,0 @@
-* Allow team maintainers to run new queries in the team hosts.
diff --git a/changes/preview-tag b/changes/preview-tag
deleted file mode 100644
index 29f11331dd..0000000000
--- a/changes/preview-tag
+++ /dev/null
@@ -1 +0,0 @@
-* Allow specifying Fleet version in `fleetctl preview` with `--tag` flag.
diff --git a/changes/remove-fk-label-membership b/changes/remove-fk-label-membership
deleted file mode 100644
index d908e4f0f4..0000000000
--- a/changes/remove-fk-label-membership
+++ /dev/null
@@ -1 +0,0 @@
-* Make label membership insertions less stressful for the database.
diff --git a/changes/skip-save-users-if-disabled b/changes/skip-save-users-if-disabled
deleted file mode 100644
index 9c3f084555..0000000000
--- a/changes/skip-save-users-if-disabled
+++ /dev/null
@@ -1 +0,0 @@
-* Completely skip trying to save host users and software inventory if it's disabled.
diff --git a/charts/fleet/Chart.yaml b/charts/fleet/Chart.yaml
index 8f238ae4dd..66d0884e07 100644
--- a/charts/fleet/Chart.yaml
+++ b/charts/fleet/Chart.yaml
@@ -4,8 +4,8 @@ name: fleet
keywords:
- fleet
- osquery
-version: v4.3.0
+version: v4.3.1
home: https://github.com/fleetdm/fleet
sources:
- https://github.com/fleetdm/fleet.git
-appVersion: v4.3.0
+appVersion: v4.3.1
diff --git a/charts/fleet/values.yaml b/charts/fleet/values.yaml
index 7dc1636ab2..3e9d3fdee8 100644
--- a/charts/fleet/values.yaml
+++ b/charts/fleet/values.yaml
@@ -2,7 +2,7 @@
# All settings related to how Fleet is deployed in Kubernetes
hostName: fleet.localhost
replicas: 3 # The number of Fleet instances to deploy
-imageTag: v4.3.0 # Version of Fleet to deploy
+imageTag: v4.3.1 # Version of Fleet to deploy
createIngress: true # Whether or not to automatically create an Ingress
ingressAnnotations: {} # Additional annotation to add to the Ingress
podAnnotations: {} # Additional annotations to add to the Fleet pod
diff --git a/tools/deploy/terraform-aws-fargate/database.tf b/tools/deploy/terraform-aws-fargate/database.tf
new file mode 100644
index 0000000000..c87da3ade7
--- /dev/null
+++ b/tools/deploy/terraform-aws-fargate/database.tf
@@ -0,0 +1,12 @@
+resource "aws_db_instance" "default" {
+ allocated_storage = 10
+ engine = "mysql"
+ engine_version = "5.7"
+ instance_class = "db.t3.micro"
+ identifier_prefix = "fleet"
+ name = "fleet"
+ username = "foo"
+ password = "foobarbaz"
+ parameter_group_name = "default.mysql5.7"
+ skip_final_snapshot = true
+}
\ No newline at end of file
diff --git a/tools/deploy/terraform-aws-fargate/variables.tf b/tools/deploy/terraform-aws-fargate/variables.tf
new file mode 100644
index 0000000000..b7bf843b5d
--- /dev/null
+++ b/tools/deploy/terraform-aws-fargate/variables.tf
@@ -0,0 +1 @@
+variable "vpc_id" {}
\ No newline at end of file
diff --git a/tools/docker-fleetctl-awscli/Dockerfile b/tools/docker-fleetctl-awscli/Dockerfile
new file mode 100644
index 0000000000..ff1fed9368
--- /dev/null
+++ b/tools/docker-fleetctl-awscli/Dockerfile
@@ -0,0 +1,4 @@
+FROM amazon/aws-cli
+MAINTAINER Fleet Developers
+
+RUN curl https://github.com/fleetdm/fleet/releases/latest/download/fleetctl-linux.tar.gz | tar -xf
diff --git a/tools/fleetctl-npm/package.json b/tools/fleetctl-npm/package.json
index 3d03c517c5..8634b01ca6 100644
--- a/tools/fleetctl-npm/package.json
+++ b/tools/fleetctl-npm/package.json
@@ -1,6 +1,6 @@
{
"name": "fleetctl",
- "version": "v4.3.0",
+ "version": "v4.3.1",
"description": "Installer for the fleetctl CLI tool",
"bin": {
"fleetctl": "./run.js"
From 6413befdd182b2b64f8b5077246295a558fdd3bb Mon Sep 17 00:00:00 2001
From: eashaw
Date: Wed, 22 Sep 2021 00:05:53 -0500
Subject: [PATCH 51/82] Add edit page button to the top of documentation pages
on fleetdm.com/docs (#2165)
* floating edit button on hover
* update class name
* adjust padding and border-radius
* fix failing lint test
* Update website/assets/styles/pages/docs/basic-documentation.less
* Update website/assets/styles/pages/docs/basic-documentation.less
* Update website/assets/styles/pages/docs/basic-documentation.less
* Update website/assets/styles/pages/docs/basic-documentation.less
Co-authored-by: Mike Thomas <78363703+mike-j-thomas@users.noreply.github.com>
---
.../pages/docs/basic-documentation.less | 50 +++++++++++++++++++
.../views/pages/docs/basic-documentation.ejs | 7 +++
2 files changed, 57 insertions(+)
diff --git a/website/assets/styles/pages/docs/basic-documentation.less b/website/assets/styles/pages/docs/basic-documentation.less
index 66a990dd03..4d9956c5dd 100644
--- a/website/assets/styles/pages/docs/basic-documentation.less
+++ b/website/assets/styles/pages/docs/basic-documentation.less
@@ -198,6 +198,56 @@
color: @core-fleet-black;
}
+ }
+ .edit-button-container {
+ position: relative;
+
+ .edit-button {
+ color: @core-vibrant-blue;
+ opacity: 0;
+ font-size: 12px;
+ position: absolute;
+ right: 4px;
+ top: 8px;
+ cursor: pointer;
+ border: 1px solid @core-vibrant-blue;
+ border-radius: 4px;
+ padding: 4px 8px;
+ text-decoration: none;
+
+ .edit-link {
+ color: @core-vibrant-blue;
+
+ }
+ .edit-pencil {
+ height: 16px;
+ padding-right: 5px;
+ }
+
+ }
+
+ .edit-button:hover {
+
+ background: @core-vibrant-blue;
+
+ a {
+ text-decoration: none;
+ }
+ .edit-link {
+ color: @accent-white;
+
+ }
+ }
+
+ }
+
+ &:hover {
+
+ .edit-button {
+ opacity: 1;
+
+ }
+
}
[purpose='search'] {
diff --git a/website/views/pages/docs/basic-documentation.ejs b/website/views/pages/docs/basic-documentation.ejs
index 56c97246b3..7cc744d5d3 100644
--- a/website/views/pages/docs/basic-documentation.ejs
+++ b/website/views/pages/docs/basic-documentation.ejs
@@ -189,6 +189,13 @@
+
+
+
<%- partial(
path.relative(
path.dirname(__filename),
From bc3d7fbe2b57cb8b6277aa786d6c4a07f0b970fa Mon Sep 17 00:00:00 2001
From: Zach Wasserman
Date: Wed, 22 Sep 2021 07:29:43 -0700
Subject: [PATCH 52/82] Always check doc links in CI (#2178)
- Check all links on every PR to better avoid broken links.
---
.github/workflows/docs.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index ed33f31b81..313c7e37d2 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -9,7 +9,6 @@ jobs:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
- check-modified-files-only: 'yes'
use-quiet-mode: 'yes'
config-file: .github/workflows/markdown-link-check-config.json
base-branch: ${{ github.base_ref }}
From 948e5ca943c23d2cbc12773a7ebed460995d9883 Mon Sep 17 00:00:00 2001
From: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
Date: Wed, 22 Sep 2021 11:37:03 -0400
Subject: [PATCH 53/82] No clicking on new query (#2186)
---
frontend/components/forms/queries/QueryForm/QueryForm.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontend/components/forms/queries/QueryForm/QueryForm.tsx b/frontend/components/forms/queries/QueryForm/QueryForm.tsx
index e23531d07e..e6b28ec340 100644
--- a/frontend/components/forms/queries/QueryForm/QueryForm.tsx
+++ b/frontend/components/forms/queries/QueryForm/QueryForm.tsx
@@ -311,7 +311,7 @@ const QueryForm = ({
}
/>
) : (
- New query
+ New query
)}
{isEditMode && (
Date: Wed, 22 Sep 2021 12:25:09 -0400
Subject: [PATCH 54/82] Update CHANGELOG entry for Fleet 4.3.1 (#2185)
---
CHANGELOG.md | 37 ++++++++++++++-----------------------
1 file changed, 14 insertions(+), 23 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8551a049a9..31bb2f8748 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,41 +1,32 @@
## Fleet 4.3.1 (Sept 21, 2021)
-* Add `fleetctl get software` to list all software and the detected vulnerabilities.
+* Add `fleetctl get software` command to list all software and the detected vulnerabilities. The Vulnerable software feature is currently in Beta. For information on how to configure the Vulnerable software feature and how exactly Fleet processes vulnerabilities, check out the [Vulnerability processing documentation](https://fleetdm.com/docs/using-fleet/vulnerability-processing).
* Add `fleetctl vulnerability-data-stream` command to sync the vulnerabilities processing data streams by hand.
-* Add `vulnerabilities.disable_data_sync` config to fleet serve to avoid downloading the data streams.
+* Add `disable_data_sync` vulnerabilities configuration option to avoid downloading the data streams. Documentation for this configuration option can be found [here on fleetdm.com/docs](https://fleetdm.com/docs/deploying/configuration#disable-data-sync).
-* Allow specifying Fleet version in `fleetctl preview` with `--tag` flag.
+* Only show observers the queries they have permissions to run on the **Queries** page. In, Fleet 4.0.0, the Admin, Maintainer, and Observer user roles were introduced. Documentation for the permissions associated with each role can be found [here on fleetdm.com/docs](https://fleetdm.com/docs/using-fleet/permissions).
-* Allow team maintainers to run new queries in the team hosts.
+* Add `connect_retry_attempts` Redis configuration option to retry failed connections. Documentation for this configuration option can be found [here on fleetdm.com/docs](https://fleetdm.com/docs/deploying/configuration#redis-connect-retry-attempts).
-* Only show observers queries they can run.
+* Add `cluster_follow_redirections` Redis configuration option to follow cluster redirections. Documentation for this configuration option can be found [here on fleetdm.com/docs](https://fleetdm.com/docs/deploying/configuration#redis-cluster-follow-redirections).
-* Add redis configuration option to retry failed connections.
+* Add `max_jitter_percent` osquery configuration option to prevent all hosts from returning data at roughly the same time. Note that this improves the Fleet server performance, but it will now take longer for new labels to populate. Documentation for this configuration option can be found [here on fleetdm.com/docs](https://fleetdm.com/docs/deploying/configuration#osquery-max-jitter-percent).
-* Add redis configuration option to follow cluster redirections.
-
-* Add jitter percent for osquery update intervals to prevent all hosts from returning data at
- roughly the same time. Note that this improves the Fleet server performance, but it will now take
- longer for new labels to populate.
-
-* Improve the performance of certain database migrations that were preventing users from updating to
- 4.3.0.
+* Improve the performance of database migrations.
* Reduce database load for label membership recording.
-* Add team policies.
-
-* Fix intermittent blank screen for observers on manage hosts page
-
-* Fix sidebar style on query page.
-
-* Fix a bug detecting disk space for hosts.
-
* Fail early if the process does not have permissions to write to the logging file.
-* Completely skip trying to save host users and software inventory if it's disabled.
+* Completely skip trying to save a host's users and software inventory if it's disabled to reduce database load.
+
+* Fix a bug in which team maintainers were unable to run live queries against the hosts assigned to their team(s).
+
+* Fix a bug in which a blank screen would intermittently appear on the **Hosts** page.
+
+* Fix a bug detecting disk space for hosts.
## Fleet 4.3.0 (Sept 13, 2021)
From ca27bd9d5c1b11eff474b4f8b0924f09636bda06 Mon Sep 17 00:00:00 2001
From: Renee Jackson <44620612+rlynnj11@users.noreply.github.com>
Date: Wed, 22 Sep 2021 13:28:25 -0300
Subject: [PATCH 55/82] fix broken links by adding missing 0 (#2187)
* fix broken links by adding missing 0
* fix broken links take 2
gather links missed in first pass
---
README.md | 2 +-
cypress/README.md | 4 +--
docs/01-Using-Fleet/01-Fleet-UI.md | 2 +-
docs/01-Using-Fleet/02-fleetctl-CLI.md | 4 +--
docs/01-Using-Fleet/04-Adding-hosts.md | 2 +-
docs/01-Using-Fleet/05-Osquery-logs.md | 14 +++++-----
docs/01-Using-Fleet/06-Monitoring-Fleet.md | 4 +--
.../07-Security-best-practices.md | 2 +-
docs/01-Using-Fleet/08-Updating-Fleet.md | 4 +--
docs/01-Using-Fleet/10-Teams.md | 2 +-
.../13-Vulnerability-Processing.md | 2 +-
docs/01-Using-Fleet/FAQ.md | 28 +++++++++----------
docs/01-Using-Fleet/README.md | 16 +++++------
docs/02-Deploying/01-Installation.md | 10 +++----
.../03-Example-deployment-scenarios.md | 18 ++++++------
docs/02-Deploying/FAQ.md | 8 +++---
docs/02-Deploying/README.md | 8 +++---
docs/03-Contributing/02-Testing.md | 4 +--
docs/03-Contributing/04-Committing-Changes.md | 2 +-
docs/03-Contributing/FAQ.md | 2 +-
docs/03-Contributing/README.md | 10 +++----
docs/README.md | 6 ++--
frontend/README.md | 2 +-
frontend/README_deprecated.md | 2 +-
handbook/README.md | 2 +-
handbook/manual-qa.md | 4 +--
handbook/release-process.md | 4 +--
handbook/support-process.md | 2 +-
orbit/README.md | 2 +-
tools/backup_db/README.md | 2 +-
tools/fleetctl-npm/README.md | 2 +-
31 files changed, 88 insertions(+), 88 deletions(-)
diff --git a/README.md b/README.md
index 6b622672a9..c3f8ce93e4 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ The Fleet UI is now available at http://localhost:1337.
#### Now what?
-Check out the [Ask questions about your devices tutorial](./docs/1-Using-Fleet/tutorials/Ask-questions-about-your-devices.md) to learn where to see your devices in Fleet, how to add Fleet's standard query library, and how to ask questions about your devices by running queries.
+Check out the [Ask questions about your devices tutorial](./docs/01-Using-Fleet/00-Learn-how-to-use-Fleet.md#how-to-ask-questions-about-your-devices) to learn where to see your devices in Fleet, how to add Fleet's standard query library, and how to ask questions about your devices by running queries.
## Team
Fleet is [independently backed](https://linkedin.com/company/fleetdm) and actively maintained with the help of many amazing [contributors](https://github.com/fleetdm/fleet/graphs/contributors).
diff --git a/cypress/README.md b/cypress/README.md
index c67e59da62..ab80dd2069 100644
--- a/cypress/README.md
+++ b/cypress/README.md
@@ -1,6 +1,6 @@
# Cypress Testing
-Cypress tests are designed solely for end-to-end testing. If this is your first time developing or running end-to-end tests, [Fleet testing documentation](../docs/3-Contributing/2-Testing.md) includes git instructions for test preparation and running tests.
+Cypress tests are designed solely for end-to-end testing. If this is your first time developing or running end-to-end tests, [Fleet testing documentation](../docs/03-Contributing/02-Testing.md) includes git instructions for test preparation and running tests.
## Fleet Cypress directories
@@ -37,6 +37,6 @@ As much as possible, assert that the code is only selecting 1 item or that the f
## Resources
-- [Fleet testing documentation](../docs/3-Contributing/2-Testing.md)
+- [Fleet testing documentation](../docs/03-Contributing/02-Testing.md)
- [Cypress documentation](https://docs.cypress.io/api/table-of-contents)
- [React testing-library query documentation](https://testing-library.com/docs/queries/about)
diff --git a/docs/01-Using-Fleet/01-Fleet-UI.md b/docs/01-Using-Fleet/01-Fleet-UI.md
index e6e0c68954..b90b2b2e89 100644
--- a/docs/01-Using-Fleet/01-Fleet-UI.md
+++ b/docs/01-Using-Fleet/01-Fleet-UI.md
@@ -27,7 +27,7 @@ To add queries to a pack, use the right-hand sidebar. You can take an existing s

-Once you've scheduled queries and curated your packs, you can read our guide to [Working With Osquery Logs](../1-Using-Fleet/5-Osquery-logs.md).
+Once you've scheduled queries and curated your packs, you can read our guide to [Working With Osquery Logs](../01-Using-Fleet/05-Osquery-logs.md).
## Configuring agent options
diff --git a/docs/01-Using-Fleet/02-fleetctl-CLI.md b/docs/01-Using-Fleet/02-fleetctl-CLI.md
index 396280f346..9e7ef885ae 100644
--- a/docs/01-Using-Fleet/02-fleetctl-CLI.md
+++ b/docs/01-Using-Fleet/02-fleetctl-CLI.md
@@ -24,7 +24,7 @@ This guide illustrates:
### Running Fleet
-For the sake of this tutorial, we will be using the local development Docker Compose infrastructure to run Fleet locally. This is documented in some detail in the [developer documentation](../3-Contributing/1-Building-Fleet.md#development-infrastructure), but the following are the minimal set of commands that you can run from the root of the repository (assuming that you have a working Go/JavaScript toolchain installed along with Docker Compose):
+For the sake of this tutorial, we will be using the local development Docker Compose infrastructure to run Fleet locally. This is documented in some detail in the [developer documentation](../03-Contributing/01-Building-Fleet.md#development-infrastructure), but the following are the minimal set of commands that you can run from the root of the repository (assuming that you have a working Go/JavaScript toolchain installed along with Docker Compose):
```
docker-compose up -d
@@ -186,7 +186,7 @@ spec:
Fleet supports osquery's file carving functionality as of Fleet 3.3.0. This allows the Fleet server to request files (and sets of files) from osquery agents, returning the full contents to Fleet.
-File carving data can be either stored in Fleet's database or to an external S3 bucket. For information on how to configure the latter, consult the [configuration docs](../2-Deploying/2-Configuration.md#s3-file-carving-backend).
+File carving data can be either stored in Fleet's database or to an external S3 bucket. For information on how to configure the latter, consult the [configuration docs](../02-Deploying/02-Configuration.md#s3-file-carving-backend).
### Configuration
diff --git a/docs/01-Using-Fleet/04-Adding-hosts.md b/docs/01-Using-Fleet/04-Adding-hosts.md
index 4872b7a204..9ea6e02e39 100644
--- a/docs/01-Using-Fleet/04-Adding-hosts.md
+++ b/docs/01-Using-Fleet/04-Adding-hosts.md
@@ -135,4 +135,4 @@ Multiple enroll secrets can be set to allow different groups of hosts to
authenticate with Fleet. When a host enrolls, the corresponding enroll secret is
recorded and can be used to segment hosts.
-To set the enroll secret, use the `fleetctl` tool to apply an [enroll secret spec](../1-Using-Fleet/2-fleetctl-CLI.md#enroll-secrets)
+To set the enroll secret, use the `fleetctl` tool to apply an [enroll secret spec](../01-Using-Fleet/02-fleetctl-CLI.md#enroll-secrets)
diff --git a/docs/01-Using-Fleet/05-Osquery-logs.md b/docs/01-Using-Fleet/05-Osquery-logs.md
index 96109f95c2..48223c68c6 100644
--- a/docs/01-Using-Fleet/05-Osquery-logs.md
+++ b/docs/01-Using-Fleet/05-Osquery-logs.md
@@ -22,21 +22,21 @@ Fleet supports the following logging plugins for osquery logs:
- [PubSub](#pubsub) - Logs are written to Google Cloud PubSub topics.
- [Stdout](#stdout) - Logs are written to stdout.
-To set the osquery logging plugins, use the `--osquery_result_log_plugin` and `--osquery_status_log_plugin` flags (or [equivalents for environment variables or configuration files](../2-Deploying/2-Configuration.md#options)).
+To set the osquery logging plugins, use the `--osquery_result_log_plugin` and `--osquery_status_log_plugin` flags (or [equivalents for environment variables or configuration files](../02-Deploying/02-Configuration.md#options)).
### Filesystem
The default logging plugin.
- Plugin name: `filesystem`
-- Flag namespace: [filesystem](../2-Deploying/2-Configuration.md#filesystem)
+- Flag namespace: [filesystem](../02-Deploying/02-Configuration.md#filesystem)
With the filesystem plugin, osquery result and/or status logs are written to the local filesystem on the Fleet server. This is typically used with a log forwarding agent on the Fleet server that will push the logs into a logging pipeline. Note that if multiple load-balanced Fleet servers are used, the logs will be load-balanced across those servers (not duplicated).
### Firehose
- Plugin name: `firehose`
-- Flag namespace: [firehose](../2-Deploying/2-Configuration.md#firehose)
+- Flag namespace: [firehose](../02-Deploying/02-Configuration.md#firehose)
With the Firehose plugin, osquery result and/or status logs are written to [AWS Firehose](https://aws.amazon.com/kinesis/data-firehose/) streams. This is a very good method for aggregating osquery logs into AWS S3 storage.
@@ -45,7 +45,7 @@ Note that Firehose logging has limits [discussed in the documentation](https://d
### Kinesis
- Plugin name: `kinesis`
-- Flag namespace: [kinesis](../2-Deploying/2-Configuration.md#kinesis)
+- Flag namespace: [kinesis](../02-Deploying/02-Configuration.md#kinesis)
With the Kinesis plugin, osquery result and/or status logs are written to
[AWS Kinesis](https://aws.amazon.com/kinesis/data-streams) streams.
@@ -58,7 +58,7 @@ output in the Fleet logs and those logs _will not_ be sent to Kinesis.
### Lambda
- Plugin name: `lambda`
-- Flag namespace: [lambda](../2-Deploying/2-Configuration.md#lambda)
+- Flag namespace: [lambda](../02-Deploying/02-Configuration.md#lambda)
With the Lambda plugin, osquery result and/or status logs are written to
[AWS Lambda](https://aws.amazon.com/lambda/) functions.
@@ -79,7 +79,7 @@ Keep this in mind when using Lambda, as you're charged based on the number of re
### PubSub
- Plugin name: `pubsub`
-- Flag namespace: [pubsub](../2-Deploying/2-Configuration.md#pubsub)
+- Flag namespace: [pubsub](../02-Deploying/02-Configuration.md#pubsub)
With the PubSub plugin, osquery result and/or status logs are written to [PubSub](https://cloud.google.com/pubsub/) topics.
@@ -88,7 +88,7 @@ Note that messages over 10MB will be dropped, with a notification sent to the fl
### Stdout
- Plugin name: `stdout`
-- Flag namespace: [stdout](../2-Deploying/2-Configuration.md#stdout)
+- Flag namespace: [stdout](../02-Deploying/02-Configuration.md#stdout)
With the stdout plugin, osquery result and/or status logs are written to stdout
on the Fleet server. This is typically used for debugging or with a log
diff --git a/docs/01-Using-Fleet/06-Monitoring-Fleet.md b/docs/01-Using-Fleet/06-Monitoring-Fleet.md
index 99d1ac1ef2..391db88122 100644
--- a/docs/01-Using-Fleet/06-Monitoring-Fleet.md
+++ b/docs/01-Using-Fleet/06-Monitoring-Fleet.md
@@ -54,7 +54,7 @@ Scaling Fleet horizontally is as simple as running more Fleet server processes c
The Fleet/osquery system is resilient to loss of availability. Osquery agents will continue executing the existing configuration and buffering result logs during downtime due to lack of network connectivity, server maintenance, or any other reason. Buffering in osquery can be configured with the `--buffered_log_max` flag.
-Note that short downtimes are expected during [Fleet server upgrades](./8-Updating-Fleet.md)-fleet.md) that require database migrations.
+Note that short downtimes are expected during [Fleet server upgrades](./08-Updating-Fleet.md)-fleet.md) that require database migrations.
### Debugging performance issues
@@ -68,7 +68,7 @@ For performance issues in the Fleet server process, please [file an issue](https
##### Generate debug archive (Fleet 3.4.0+)
-Use the `fleetctl archive` command to generate an archive of Fleet's full suite of debug profiles. See the [fleetctl setup guide](./2-fleetctl-CLI.md)) for details on configuring `fleetctl`.
+Use the `fleetctl archive` command to generate an archive of Fleet's full suite of debug profiles. See the [fleetctl setup guide](./02-fleetctl-CLI.md)) for details on configuring `fleetctl`.
The generated `.tar.gz` archive will be available in the current directory.
diff --git a/docs/01-Using-Fleet/07-Security-best-practices.md b/docs/01-Using-Fleet/07-Security-best-practices.md
index 4311907ce2..caa13d02b2 100644
--- a/docs/01-Using-Fleet/07-Security-best-practices.md
+++ b/docs/01-Using-Fleet/07-Security-best-practices.md
@@ -33,7 +33,7 @@ Passwords are never stored in plaintext in the database. We store a `bcrypt`ed h
### Authentication tokens
-The size and expiration time of session tokens is admin-configurable. See [The documentation on session duration](../2-Deploying/2-Configuration.md#session_duration).
+The size and expiration time of session tokens is admin-configurable. See [The documentation on session duration](../02-Deploying/02-Configuration.md#session_duration).
It is possible to revoke all session tokens for a user by forcing a password reset.
diff --git a/docs/01-Using-Fleet/08-Updating-Fleet.md b/docs/01-Using-Fleet/08-Updating-Fleet.md
index af41724025..65d9c6e49c 100644
--- a/docs/01-Using-Fleet/08-Updating-Fleet.md
+++ b/docs/01-Using-Fleet/08-Updating-Fleet.md
@@ -7,7 +7,7 @@
## Overview
-This guide explains how to update and run new versions of Fleet. For initial installation instructions, see [Installing Fleet](../2-Deploying/1-Installation.md).
+This guide explains how to update and run new versions of Fleet. For initial installation instructions, see [Installing Fleet](../02-Deploying/01-Installation.md).
There are two steps to perform a typical Fleet update. If any other steps are required, they will be noted in the release notes.
@@ -18,7 +18,7 @@ As with any enterprise software update, it's a good idea to back up your MySQL d
## Updating the Fleet binary
-To update to a new version of Fleet, follow the [same binary install instructions](../2-Deploying/1-Installation.md) from the original installation method you used to install Fleet.
+To update to a new version of Fleet, follow the [same binary install instructions](../02-Deploying/01-Installation.md) from the original installation method you used to install Fleet.
### Raw binaries
diff --git a/docs/01-Using-Fleet/10-Teams.md b/docs/01-Using-Fleet/10-Teams.md
index 86591f1055..4904e900db 100644
--- a/docs/01-Using-Fleet/10-Teams.md
+++ b/docs/01-Using-Fleet/10-Teams.md
@@ -94,7 +94,7 @@ To add users to a team:
4. Select one or more users by searching for their full name and confirm the action.
-Users will be given the [Observer role](./9-Permissions.md#team-member-permissions) when added to the team. The [Edit a member's role](#edit-a-members-role) provides instructions on changing the permission level of users on a team.
+Users will be given the [Observer role](./09-Permissions.md#team-member-permissions) when added to the team. The [Edit a member's role](#edit-a-members-role) provides instructions on changing the permission level of users on a team.
## Edit a member's role
diff --git a/docs/01-Using-Fleet/13-Vulnerability-Processing.md b/docs/01-Using-Fleet/13-Vulnerability-Processing.md
index 70092798c5..acb02e5a87 100644
--- a/docs/01-Using-Fleet/13-Vulnerability-Processing.md
+++ b/docs/01-Using-Fleet/13-Vulnerability-Processing.md
@@ -69,6 +69,6 @@ FLEET_VULNERABILITIES_DATABASES_PATH=/some/path
The path specified needs to exist and Fleet needs to be able to read and write to and from it. This is the only mandatory
configuration needed for vulnerability processing to work. Additional options, like vulnerability check frequency, can be
-found in the [configuration documentation](../2-Deploying/2-Configuration.md#vulnerabilities).
+found in the [configuration documentation](../02-Deploying/02-Configuration.md#vulnerabilities).
You'll need to restart the Fleet instances after changing these settings.
\ No newline at end of file
diff --git a/docs/01-Using-Fleet/FAQ.md b/docs/01-Using-Fleet/FAQ.md
index 99e0b69318..62771ea3e3 100644
--- a/docs/01-Using-Fleet/FAQ.md
+++ b/docs/01-Using-Fleet/FAQ.md
@@ -21,7 +21,7 @@ The upgrade from kolide/fleet to fleetdm/fleet works the same as any minor versi
Minor version upgrades in Kolide Fleet often included database migrations and the recommendation to back up the database before migrating. The same goes for FleetDM Fleet versions.
-To migrate from Kolide Fleet to FleetDM Fleet, please follow the steps outlined in the [Updating Fleet section](./8-Updating-Fleet.md) of the documentation.
+To migrate from Kolide Fleet to FleetDM Fleet, please follow the steps outlined in the [Updating Fleet section](./08-Updating-Fleet.md) of the documentation.
## Has anyone stress tested Fleet? How many clients can the Fleet server handle?
@@ -33,13 +33,13 @@ It’s standard deployment practice to have multiple Fleet servers behind a load
No, currently, there’s no way to retrieve the name of the enroll secret with a query. This means that there's no way to create a label using your hosts' enroll secrets and then use this label as a target for queries or query packs.
-Typically folks will use some other unique identifier to create labels that distinguish each type of device. As a workaround, [Fleet's manual labels](./2-fleetctl-CLI.md#host-labels) provide a way to create groups of hosts without a query. These manual labels can then be used as targets for queries or query packs.
+Typically folks will use some other unique identifier to create labels that distinguish each type of device. As a workaround, [Fleet's manual labels](./02-fleetctl-CLI.md#host-labels) provide a way to create groups of hosts without a query. These manual labels can then be used as targets for queries or query packs.
There is, however, a way to accomplish this even though the answer to the question remains "no": Teams. As of Fleet v4.0.0, you can group hosts in Teams either by enrolling them with a team specific secret, or by transferring hosts to a team. One the hosts you want to target are part of a team, you can create a query and target the team in question.
## How often do labels refresh? Is the refresh frequency configurable?
-The update frequency for labels is configurable with the [—osquery_label_update_interval](../2-Deploying/2-Configuration.md#osquery_label_update_interval) flag (default 1 hour).
+The update frequency for labels is configurable with the [—osquery_label_update_interval](../02-Deploying/02-Configuration.md#osquery_label_update_interval) flag (default 1 hour).
## How do I revoke the authorization tokens for a user?
@@ -51,7 +51,7 @@ Fleet can live query the `osquery_schedule` table. Performing this live query al
## How do I monitor a Fleet server?
-Fleet provides standard interfaces for monitoring and alerting. See the [Monitoring Fleet](./6-Monitoring-Fleet.md) documentation for details.
+Fleet provides standard interfaces for monitoring and alerting. See the [Monitoring Fleet](./06-Monitoring-Fleet.md) documentation for details.
## Why is the “Add User” button disabled?
@@ -76,7 +76,7 @@ Live query results (executed in the web UI or `fleetctl query`) are pushed direc
### Scheduled Queries
-Scheduled query results (queries that are scheduled to run in Packs) are typically sent to the Fleet server, and will be available on the filesystem of the server at the path configurable by [`--osquery_result_log_file`](../2-Deploying/2-Configuration.md#osquery_result_log_file). This defaults to `/tmp/osquery_result`.
+Scheduled query results (queries that are scheduled to run in Packs) are typically sent to the Fleet server, and will be available on the filesystem of the server at the path configurable by [`--osquery_result_log_file`](../02-Deploying/02-Configuration.md#osquery_result_log_file). This defaults to `/tmp/osquery_result`.
It is possible to configure osqueryd to log query results outside of Fleet. For results to go to Fleet, the `--logger_plugin` flag must be set to `tls`.
@@ -84,7 +84,7 @@ It is possible to configure osqueryd to log query results outside of Fleet. For
Folks typically use Fleet to ship logs to data aggregation systems like Splunk, the ELK stack, and Graylog.
-The [logger configuration options](../2-Deploying/2-Configuration.md#osquery_status_log_plugin) allow you to select the log output plugin. Using the log outputs you can route the logs to your chosen aggregation system.
+The [logger configuration options](../02-Deploying/02-Configuration.md#osquery_status_log_plugin) allow you to select the log output plugin. Using the log outputs you can route the logs to your chosen aggregation system.
### Troubleshooting
@@ -94,7 +94,7 @@ Expecting results, but not seeing anything in the logs?
- Check whether the query is scheduled in differential mode. If so, new results will only be logged when the result set changes.
- Ensure that the query is scheduled to run on the intended platforms, and that the tables queried are supported by those platforms.
- Use live query to `SELECT * FROM osquery_schedule` to check whether the query has been scheduled on the host.
-- Look at the status logs provided by osquery. In a standard configuration these are available on the filesystem of the Fleet server at the path configurable by [`--filesystem_status_log_file`](../2-Deploying/2-Configuration.md#filesystem_status_log_file). This defaults to `/tmp/osquery_status`. The host will output a status log each time it executes the query.
+- Look at the status logs provided by osquery. In a standard configuration these are available on the filesystem of the Fleet server at the path configurable by [`--filesystem_status_log_file`](../02-Deploying/02-Configuration.md#filesystem_status_log_file). This defaults to `/tmp/osquery_status`. The host will output a status log each time it executes the query.
## Why aren’t my live queries being logged?
@@ -104,17 +104,17 @@ Live query results are never logged to the filesystem of the Fleet server. See [
You cannot. Scheduled query results are logged to whatever logging plugin you have configured and are not stored in the Fleet DB.
-However, the Fleet API exposes a significant amount of host information via the [`api/v1/fleet/hosts`](./3-REST-API.md#list-hosts) and the [`api/v1/fleet/hosts/{id}`](./3-REST-API.md#get-host) API endpoints. The `api/v1/fleet/hosts` [can even be configured to return additional host information](https://github.com/fleetdm/fleet/blob/9fb9da31f5462fa7dda4819a114bbdbc0252c347/docs/1-Using-Fleet/2-fleetctl-CLI.md#fleet-configuration-options).
+However, the Fleet API exposes a significant amount of host information via the [`api/v1/fleet/hosts`](./03-REST-API.md#list-hosts) and the [`api/v1/fleet/hosts/{id}`](./03-REST-API.md#get-host) API endpoints. The `api/v1/fleet/hosts` [can even be configured to return additional host information](https://github.com/fleetdm/fleet/blob/9fb9da31f5462fa7dda4819a114bbdbc0252c347/docs/1-Using-Fleet/2-fleetctl-CLI.md#fleet-configuration-options).
As an example, let's say you want to retrieve a host's OS version, installed software, and kernel version:
-Each host’s OS version is available using the `api/v1/fleet/hosts` API endpoint. [Check out the API documentation for this endpoint](./3-REST-API.md#list-hosts).
+Each host’s OS version is available using the `api/v1/fleet/hosts` API endpoint. [Check out the API documentation for this endpoint](./03-REST-API.md#list-hosts).
-The ability to view each host’s installed software was released behind a feature flag in Fleet 3.11.0 and called Software inventory. [Check out the feature flag documentation for instructions on turning on Software inventory in Fleet](../2-Deploying/2-Configuration.md#feature-flags).
+The ability to view each host’s installed software was released behind a feature flag in Fleet 3.11.0 and called Software inventory. [Check out the feature flag documentation for instructions on turning on Software inventory in Fleet](../02-Deploying/02-Configuration.md#feature-flags).
-Once the Software inventory feature is turned on, a list of a specific host’s installed software is available using the `api/v1/fleet/hosts/{id}` endpoint. [Check out the documentation for this endpoint](./3-REST-API.md#get-host).
+Once the Software inventory feature is turned on, a list of a specific host’s installed software is available using the `api/v1/fleet/hosts/{id}` endpoint. [Check out the documentation for this endpoint](./03-REST-API.md#get-host).
-It’s possible in Fleet to retrieve each host’s kernel version, using the Fleet API, through `additional_queries`. The Fleet configuration options yaml file includes an `additional_queries` property that allows you to append custom query results to the host details returned by the `api/v1/fleet/hosts` endpoint. [Check out an example configuration file with the additional_queries field](./2-fleetctl-CLI.md#fleet-configuration-options).
+It’s possible in Fleet to retrieve each host’s kernel version, using the Fleet API, through `additional_queries`. The Fleet configuration options yaml file includes an `additional_queries` property that allows you to append custom query results to the host details returned by the `api/v1/fleet/hosts` endpoint. [Check out an example configuration file with the additional_queries field](./02-fleetctl-CLI.md#fleet-configuration-options).
## How do I automatically add hosts to packs when the hosts enroll to Fleet?
@@ -122,10 +122,10 @@ You can accomplish this by adding specific labels as targets of your pack. First
When your hosts enroll to Fleet, they will become a member of the label and, because the label is a target of your pack, these hosts will automatically become targets of the pack.
-You can also do this by setting the `targets` field in the [YAML configuration file](./2-fleetctl-CLI.md#query-packs) that manages the packs that are added to your Fleet instance.
+You can also do this by setting the `targets` field in the [YAML configuration file](./02-fleetctl-CLI.md#query-packs) that manages the packs that are added to your Fleet instance.
## How do I resolve an "unknown column" error when upgrading Fleet?
The `unknown column` error typically occurs when the database migrations haven't been run during the upgrade process.
-Check out the [documentation on running database migrations](./8-Updating-Fleet.md#running-database-migrations) to resolve this issue.
+Check out the [documentation on running database migrations](./08-Updating-Fleet.md#running-database-migrations) to resolve this issue.
diff --git a/docs/01-Using-Fleet/README.md b/docs/01-Using-Fleet/README.md
index 9dbd331a0b..1edfbc95e9 100644
--- a/docs/01-Using-Fleet/README.md
+++ b/docs/01-Using-Fleet/README.md
@@ -1,27 +1,27 @@
# Using Fleet
-### [Fleet UI](./1-Fleet-UI.md)
+### [Fleet UI](./01-Fleet-UI.md)
Provides documentation about running and scheduling queries from within the Fleet UI
-### [fleetctl CLI](./2-fleetctl-CLI.md)
+### [fleetctl CLI](./02-fleetctl-CLI.md)
Includes resources for setting up and configuring Fleet via the fleetctl CLI
-### [REST API](./3-REST-API.md)
+### [REST API](./03-REST-API.md)
Provides resources for working with Fleet's API and includes example code for endpoints
-### [Adding hosts](./4-Adding-hosts.md)
+### [Adding hosts](./04-Adding-hosts.md)
Provides resources for enrolling your hosts to Fleet
-### [Osquery logs](./5-Osquery-logs.md)
+### [Osquery logs](./05-Osquery-logs.md)
Includes documentation on the plugin options for working with osquery logs
-### [Monitoring Fleet](./6-Monitoring-Fleet.md)
+### [Monitoring Fleet](./06-Monitoring-Fleet.md)
Provides documentation for load balancer health checks and working with Fleet server metrics and performance
-### [Security best practices](./7-Security-best-practices.md)
+### [Security best practices](./07-Security-best-practices.md)
Includes resources for ways to mitigate against the OWASP top 10 issues
-### [Updating Fleet](./8-Updating-Fleet.md)
+### [Updating Fleet](./08-Updating-Fleet.md)
Includes a guide for how to update and run new versions of Fleet
### [FAQ](./FAQ.md)
diff --git a/docs/02-Deploying/01-Installation.md b/docs/02-Deploying/01-Installation.md
index 7a1f0f89c7..d59018f353 100644
--- a/docs/02-Deploying/01-Installation.md
+++ b/docs/02-Deploying/01-Installation.md
@@ -15,7 +15,7 @@ The Fleet application is distributed as a single static binary. This binary serv
- The Fleet application API endpoints
- The osquery TLS server API endpoints
-All of these are served via a built-in HTTP server, so there is no need for complex web server configurations. Once you've installed the `fleet` binary and it's infrastructure dependencies as illustrated below, refer to the [Configuration](./2-Configuration.md) documentation for information on how to use and configure the Fleet application.
+All of these are served via a built-in HTTP server, so there is no need for complex web server configurations. Once you've installed the `fleet` binary and it's infrastructure dependencies as illustrated below, refer to the [Configuration](./02-Configuration.md) documentation for information on how to use and configure the Fleet application.
## Installing the Fleet binary
@@ -29,7 +29,7 @@ Pull the latest Fleet docker image:
docker pull fleetdm/fleet
```
-For more information on using Fleet, refer to the [Configuration](./2-Configuration.md) documentation.
+For more information on using Fleet, refer to the [Configuration](./02-Configuration.md) documentation.
### Raw binaries
@@ -47,7 +47,7 @@ unzip fleet.zip 'linux/*' -d fleet
./fleet/linux/fleet_linux_amd64 --help
```
-For more information on using Fleet, refer to the [Configuration](./2-Configuration.md) documentation.
+For more information on using Fleet, refer to the [Configuration](./02-Configuration.md) documentation.
## TLS configuration
@@ -65,7 +65,7 @@ Fleet currently has two infrastructure dependencies in addition to the `fleet` w
### MySQL
-Fleet uses MySQL extensively as its main database. Many cloud providers (such as [AWS](https://aws.amazon.com/rds/mysql/) and [GCP](https://cloud.google.com/sql/)) host reliable MySQL services which you may consider for this purpose. A well supported MySQL [Docker container](https://hub.docker.com/_/mysql/) also exists if you would rather run MySQL in a container. For more information on how to configure the `fleet` binary to use the correct MySQL instance, see the [Configuration](./2-Configuration.md) document.
+Fleet uses MySQL extensively as its main database. Many cloud providers (such as [AWS](https://aws.amazon.com/rds/mysql/) and [GCP](https://cloud.google.com/sql/)) host reliable MySQL services which you may consider for this purpose. A well supported MySQL [Docker container](https://hub.docker.com/_/mysql/) also exists if you would rather run MySQL in a container. For more information on how to configure the `fleet` binary to use the correct MySQL instance, see the [Configuration](./02-Configuration.md) document.
Fleet requires at least MySQL version 5.7.
@@ -73,4 +73,4 @@ For host expiry configuration, the [event scheduler](https://dev.mysql.com/doc/r
### Redis
-Fleet uses Redis to ingest and queue the results of distributed queries, cache data, etc. Many cloud providers (such as [AWS](https://aws.amazon.com/elasticache/) and [GCP](https://console.cloud.google.com/launcher/details/click-to-deploy-images/redis)) host reliable Redis services which you may consider for this purpose. A well supported Redis [Docker container](https://hub.docker.com/_/redis/) also exists if you would rather run Redis in a container. For more information on how to configure the `fleet` binary to use the correct Redis instance, see the [Configuration](./2-Configuration.md) document.
+Fleet uses Redis to ingest and queue the results of distributed queries, cache data, etc. Many cloud providers (such as [AWS](https://aws.amazon.com/elasticache/) and [GCP](https://console.cloud.google.com/launcher/details/click-to-deploy-images/redis)) host reliable Redis services which you may consider for this purpose. A well supported Redis [Docker container](https://hub.docker.com/_/redis/) also exists if you would rather run Redis in a container. For more information on how to configure the `fleet` binary to use the correct Redis instance, see the [Configuration](./02-Configuration.md) document.
diff --git a/docs/02-Deploying/03-Example-deployment-scenarios.md b/docs/02-Deploying/03-Example-deployment-scenarios.md
index b1b004859e..7dde2f46d7 100644
--- a/docs/02-Deploying/03-Example-deployment-scenarios.md
+++ b/docs/02-Deploying/03-Example-deployment-scenarios.md
@@ -48,7 +48,7 @@ vagrant ssh
### Installing Fleet
-To [install Fleet](https://github.com/fleetdm/fleet/blob/main/docs/2-Deploying/1-Installation.md), download, unzip, and move the latest Fleet binary to your desired install location.
+To [install Fleet](https://github.com/fleetdm/fleet/blob/main/docs/02-Deploying/01-Installation.md), download, unzip, and move the latest Fleet binary to your desired install location.
For example, after downloading:
```sh
@@ -190,11 +190,11 @@ Now, if you go to [https://localhost:8080](https://localhost:8080) in your local
### Running Fleet with systemd
-See [Running with systemd](./2-Configuration.md#running-with-systemd) for documentation on running fleet as a background process and managing the fleet server logs.
+See [Running with systemd](./02-Configuration.md#running-with-systemd) for documentation on running fleet as a background process and managing the fleet server logs.
### Installing and running osquery
-> Note that this whole process is outlined in more detail in the [Adding Hosts To Fleet](../1-Using-Fleet/4-Adding-hosts.md) document. The steps are repeated here for the sake of a continuous tutorial.
+> Note that this whole process is outlined in more detail in the [Adding Hosts To Fleet](../01-Using-Fleet/04-Adding-hosts.md) document. The steps are repeated here for the sake of a continuous tutorial.
To install osquery on CentOS, you can run the following:
@@ -357,11 +357,11 @@ Now, if you go to [https://localhost:8080](https://localhost:8080) in your local
### Running Fleet with systemd
-See [Running with systemd](./2-Configuration.md#running-with-systemd) for documentation on running fleet as a background process and managing the fleet server logs.
+See [Running with systemd](./02-Configuration.md#running-with-systemd) for documentation on running fleet as a background process and managing the fleet server logs.
### Installing and running osquery
-> Note that this whole process is outlined in more detail in the [Adding Hosts To Fleet](../1-Using-Fleet/4-Adding-hosts.md) document. The steps are repeated here for the sake of a continuous tutorial.
+> Note that this whole process is outlined in more detail in the [Adding Hosts To Fleet](../01-Using-Fleet/04-Adding-hosts.md) document. The steps are repeated here for the sake of a continuous tutorial.
To install osquery on Ubuntu, you can run the following:
@@ -453,14 +453,14 @@ We will use this address when we configure the Kubernetes deployment and databas
The last step is to run the Fleet database migrations on your new MySQL server. To do this, run the following:
```
-kubectl create -f ./docs/1-Using-Fleet/configuration-files/kubernetes/fleet-migrations.yml
+kubectl create -f ./docs/01-Using-Fleet/configuration-files/kubernetes/fleet-migrations.yml
```
In Kubernetes, you can only run a job once. If you'd like to run it again (i.e.: you'd like to run the migrations again using the same file), you must delete the job before re-creating it. To delete the job and re-run it, you can run the following commands:
```
-kubectl delete -f ./docs/1-Using-Fleet/configuration-files/kubernetes/fleet-migrations.yml
-kubectl create -f ./docs/1-Using-Fleet/configuration-files/kubernetes/fleet-migrations.yml
+kubectl delete -f ./docs/01-Using-Fleet/configuration-files/kubernetes/fleet-migrations.yml
+kubectl create -f ./docs/01-Using-Fleet/configuration-files/kubernetes/fleet-migrations.yml
```
#### Redis
@@ -536,7 +536,7 @@ ts=2017-11-16T02:48:38.441148166Z transport=https address=0.0.0.0:443 msg=listen
Now that the Fleet server is running on our cluster, we have to expose the Fleet webservers to the internet via a load balancer. To create a Kubernetes `Service` of type `LoadBalancer`, run the following:
```
-kubectl apply -f ./docs/1-Using-Fleet/configuration-files/kubernetes/fleet-service.yml
+kubectl apply -f ./docs/01-Using-Fleet/configuration-files/kubernetes/fleet-service.yml
```
#### Configure DNS
diff --git a/docs/02-Deploying/FAQ.md b/docs/02-Deploying/FAQ.md
index 4514a88d9b..f9580cbb68 100644
--- a/docs/02-Deploying/FAQ.md
+++ b/docs/02-Deploying/FAQ.md
@@ -25,7 +25,7 @@ Yes. Fleet scales horizontally out of the box as long as all of the Fleet server
Note that osquery logs will be distributed across the Fleet servers.
-Read the [performance documentation](../1-Using-Fleet/6-Monitoring-Fleet.md#fleet-server-performance) for more.
+Read the [performance documentation](../01-Using-Fleet/06-Monitoring-Fleet.md#fleet-server-performance) for more.
## Why aren't my osquery agents connecting to Fleet?
@@ -71,15 +71,15 @@ These configurations cannot be managed centrally from Fleet.
## What do I do about "too many open files" errors?
-This error usually indicates that the Fleet server has run out of file descriptors. Fix this by increasing the `ulimit` on the Fleet process. See the `LimitNOFILE` setting in the [example systemd unit file](./2-Configuration.md#runing-with-systemd) for an example of how to do this with systemd.
+This error usually indicates that the Fleet server has run out of file descriptors. Fix this by increasing the `ulimit` on the Fleet process. See the `LimitNOFILE` setting in the [example systemd unit file](./02-Configuration.md#runing-with-systemd) for an example of how to do this with systemd.
-Some deployments may benefit by setting the [`--server_keepalive`](./2-Configuration.md#server_keepalive) flag to false.
+Some deployments may benefit by setting the [`--server_keepalive`](./02-Configuration.md#server_keepalive) flag to false.
This was also seen as a symptom of a different issue: if you're deploying on AWS on T type instances, there are different scenarios where the activity can increase and the instances will burst. If they run out of credits, then they'll stop processing leaving the file descriptors open.
## I upgraded my database, but Fleet is still running slowly. What could be going on?
-This could be caused by a mismatched connection limit between the Fleet server and the MySQL server that prevents Fleet from fully utilizing the database. First [determine how many open connections your MySQL server supports](https://dev.mysql.com/doc/refman/8.0/en/too-many-connections.html). Now set the [`--mysql_max_open_conns`](./2-Configuration.md#mysql_max_open_conns) and [`--mysql_max_idle_conns`](./2-Configuration.md#mysql_max_idle_conns) flags appropriately.
+This could be caused by a mismatched connection limit between the Fleet server and the MySQL server that prevents Fleet from fully utilizing the database. First [determine how many open connections your MySQL server supports](https://dev.mysql.com/doc/refman/8.0/en/too-many-connections.html). Now set the [`--mysql_max_open_conns`](./02-Configuration.md#mysql_max_open_conns) and [`--mysql_max_idle_conns`](./02-Configuration.md#mysql_max_idle_conns) flags appropriately.
## Why am I receiving a database connection error when attempting to "prepare" the database?
diff --git a/docs/02-Deploying/README.md b/docs/02-Deploying/README.md
index 19ad6389e1..5b62992f4b 100644
--- a/docs/02-Deploying/README.md
+++ b/docs/02-Deploying/README.md
@@ -1,15 +1,15 @@
# Deployment
-### [Installation](./1-Installation.md)
+### [Installation](./01-Installation.md)
Provides documentation on installing the Fleet binary and Fleet’s infrastructure dependencies
-### [Configuration](./2-Configuration.md)
+### [Configuration](./02-Configuration.md)
Includes resources for configuring the Fleet binary, managing osquery configurations, and running with systemd
-### [Example deployment scenarios](./3-Example-deployment-scenarios.md)
+### [Example deployment scenarios](./03-Example-deployment-scenarios.md)
Includes deployment walkthroughs for Fleet on CentOS, Ubuntu, and Kubernetes.
-### [Self-managed agent updates](./4-fleetctl-agent-updates.md)
+### [Self-managed agent updates](./04-fleetctl-agent-updates.md)
Information about running an update server with fleetctl.
### [FAQ](./FAQ.md)
diff --git a/docs/03-Contributing/02-Testing.md b/docs/03-Contributing/02-Testing.md
index 21e880f35d..1aae17579d 100644
--- a/docs/03-Contributing/02-Testing.md
+++ b/docs/03-Contributing/02-Testing.md
@@ -7,7 +7,7 @@
- [Test hosts](#test-hosts)
- [Email](#email)
- [Database backup/restore](#database-backuprestore)
-- [Seeding Data](./6-Seeding-Data.md)
+- [Seeding Data](./06-Seeding-Data.md)
- [MySQL shell](#mysql-shell)
- [Testing SSO](#testing-sso)
@@ -137,7 +137,7 @@ E2E tests are run using Docker and Cypress.
#### Preparation
-Make sure dependencies are up to date and the [Fleet binaries are built locally](./1-Building-Fleet.md).
+Make sure dependencies are up to date and the [Fleet binaries are built locally](./01-Building-Fleet.md).
For Fleet Free tests:
diff --git a/docs/03-Contributing/04-Committing-Changes.md b/docs/03-Contributing/04-Committing-Changes.md
index 88694c9b38..73ed37ff02 100644
--- a/docs/03-Contributing/04-Committing-Changes.md
+++ b/docs/03-Contributing/04-Committing-Changes.md
@@ -19,7 +19,7 @@ Fleet Device Management team members may not copy queries from external sources
Each developer (internal or external) creates a fork of the Fleet repository, committing changes to a branch within their fork. Changes are submitted by PR to be merged into Fleet.
-GitHub Actions automatically runs testers and linters on each PR. Please ensure that these checks pass. Checks can be run locally as described in [2-Testing.md](./2-Testing.md).
+GitHub Actions automatically runs testers and linters on each PR. Please ensure that these checks pass. Checks can be run locally as described in [02-Testing.md](./02-Testing.md).
For features that are still in-progress, the Pull Request can be marked as a "Draft". This helps make it clear which PRs are ready for review and merge.
diff --git a/docs/03-Contributing/FAQ.md b/docs/03-Contributing/FAQ.md
index 4020cd0854..68c8d53b1b 100644
--- a/docs/03-Contributing/FAQ.md
+++ b/docs/03-Contributing/FAQ.md
@@ -25,7 +25,7 @@ server/fleet/emails.go:90:23: undefined: Asset
make: *** [fleet] Error 2
```
-If you get an `undefined: Asset` error it is likely because you did not run `make generate` before `make build`. See [Building Fleet](./1-Building-Fleet.md) for additional documentation on compiling the `fleet` binary.
+If you get an `undefined: Asset` error it is likely because you did not run `make generate` before `make build`. See [Building Fleet](./01-Building-Fleet.md) for additional documentation on compiling the `fleet` binary.
## Adding hosts for testing
diff --git a/docs/03-Contributing/README.md b/docs/03-Contributing/README.md
index 159d3045b4..98a9b38856 100644
--- a/docs/03-Contributing/README.md
+++ b/docs/03-Contributing/README.md
@@ -1,18 +1,18 @@
# Contribution
-### [Building Fleet](./1-Building-Fleet.md)
+### [Building Fleet](./01-Building-Fleet.md)
Provides documentation about building the code, development infrastructure, and database migrations
-### [Testing](./2-Testing.md)
+### [Testing](./02-Testing.md)
Includes documentation about Fleet's full test suite and integration tests
-### [Migrations](./3-Migrations.md)
+### [Migrations](./03-Migrations.md)
Information about creating and updating database migrations
-### [Committing Changes](./4-Committing-Changes.md)
+### [Committing Changes](./04-Committing-Changes.md)
Contains information about how to merge changes into the codebase
-### [Releasing Fleet](./5-Releasing-Fleet.md)
+### [Releasing Fleet](./05-Releasing-Fleet.md)
Provides a guide for Fleet's release process
### [FAQ](./FAQ.md)
diff --git a/docs/README.md b/docs/README.md
index 3da7649ef8..5e29c0c967 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -2,13 +2,13 @@
Welcome to the documentation for the Fleet osquery fleet manager.
-### [Using Fleet](./1-Using-Fleet/README.md)
+### [Using Fleet](./01-Using-Fleet/README.md)
Resources for using the Fleet UI, fleetctl CLI, and Fleet REST API.
-### [Deploying](./2-Deploying/README.md)
+### [Deploying](./02-Deploying/README.md)
Resources for installing Fleet's infrastructure dependencies, configuring Fleet, deploying osquery to hosts, and viewing example deployment scenarios.
-### [Contributing](./3-Contributing/README.md)
+### [Contributing](./03-Contributing/README.md)
If you're interested in interacting with the Fleet source code, you'll find information on modifying and building the code here.
---
diff --git a/frontend/README.md b/frontend/README.md
index e7770abd47..147b24000f 100644
--- a/frontend/README.md
+++ b/frontend/README.md
@@ -17,7 +17,7 @@ The Fleet front-end is a Single Page Application using React with Typescript and
## Running the Fleet web app
For details instruction on building and serving the Fleet web application
-consult the [Contributing documentation](../docs/3-Contributing/README.md).
+consult the [Contributing documentation](../docs/03-Contributing/README.md).
## Directory Structure
diff --git a/frontend/README_deprecated.md b/frontend/README_deprecated.md
index 4b1360d1da..79ac72db76 100644
--- a/frontend/README_deprecated.md
+++ b/frontend/README_deprecated.md
@@ -9,7 +9,7 @@ The Fleet front-end is a Single Page Application using React and Redux.
## Running the Fleet web app
For details instruction on building and serving the Fleet web application
-consult the [Contributing documentation](../docs/3-Contributing/README.md).
+consult the [Contributing documentation](../docs/03-Contributing/README.md).
## Directory Structure
diff --git a/handbook/README.md b/handbook/README.md
index 3ea51a385e..d33d6ed6f6 100644
--- a/handbook/README.md
+++ b/handbook/README.md
@@ -98,7 +98,7 @@ If the action fails, please complete the following steps:
##### Browser compatibility checking
-A browser compatibility check of [fleetdm.com](https://fleetdm.com/) should be carried out monthly to verify that the website looks, and functions as expected across all [supported browsers](../docs/1-Using-Fleet/12-Supported-browsers.md).
+A browser compatibility check of [fleetdm.com](https://fleetdm.com/) should be carried out monthly to verify that the website looks, and functions as expected across all [supported browsers](../docs/01-Using-Fleet/12-Supported-browsers.md).
- We use [BrowserStack](https://www.browserstack.com/users/sign_in) (logins can be found in [1Password](https://start.1password.com/open/i?a=N3F7LHAKQ5G3JPFPX234EC4ZDQ&v=3ycqkai6naxhqsylmsos6vairu&i=nwnxrrbpcwkuzaazh3rywzoh6e&h=fleetdevicemanagement.1password.com)) for our cross-browser checks.
- Check for issues against the latest version of Google Chrome (macOS). We use this as our baseline for quality assurance.
diff --git a/handbook/manual-qa.md b/handbook/manual-qa.md
index 6af722b196..0c769e22e2 100644
--- a/handbook/manual-qa.md
+++ b/handbook/manual-qa.md
@@ -94,13 +94,13 @@ Add a query as a saved query to the pack. Remove this query. Delete the pack.
As an admin user, select the "Settings" tab in the top navigation and then select "Organization settings".
-Follow [the instructions outlined in the Testing documentation](../docs/3-Contributing/2-Testing.md#email) to set up a local SMTP server.
+Follow [the instructions outlined in the Testing documentation](../docs/03-Contributing/02-Testing.md#email) to set up a local SMTP server.
Successfully edit your organization's name in Fleet.
### Manage users flow
-Invite a new user. To be able to invite users, you must have your local SMTP server configured. Instructions for setting up a local SMTP server are outlined in [the Testing documentation](../docs/3-Contributing/2-Testing.md#email)
+Invite a new user. To be able to invite users, you must have your local SMTP server configured. Instructions for setting up a local SMTP server are outlined in [the Testing documentation](../docs/03-Contributing/02-Testing.md#email)
Logout of your current admin user and accept the invitation for the newly invited user. With your local SMTP server configured, head to https://localhost:8025 to view and select the invitation link.
diff --git a/handbook/release-process.md b/handbook/release-process.md
index 52b5c6aaec..9e7d01f262 100644
--- a/handbook/release-process.md
+++ b/handbook/release-process.md
@@ -28,7 +28,7 @@ Check out the [Fleet 4.1.0 blog post](https://blog.fleetdm.com/fleet-4-1-0-57dfa
**More improvements** - Includes each additional feature's name, availability (Free v. Premium), and 1-2 sentences that answer the 'why should the user care?' questions.
-**Upgrade plan** - Once sentence that links to user to the upgrading Fleet documentation here: https://github.com/fleetdm/fleet/blob/main/docs/1-Using-Fleet/8-Updating-Fleet.md
+**Upgrade plan** - Once sentence that links to user to the upgrading Fleet documentation here: https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/08-Updating-Fleet.md
### Manual QA
@@ -38,4 +38,4 @@ Documentation on conducting the manual QA pass can be found [here](./manual-qa.m
## Release day
-Documentation on completing the release process can be found [here](../docs/3-Contributing/5-Releasing-Fleet.md).
+Documentation on completing the release process can be found [here](../docs/03-Contributing/05-Releasing-Fleet.md).
diff --git a/handbook/support-process.md b/handbook/support-process.md
index cbacf8587c..58d09e964e 100644
--- a/handbook/support-process.md
+++ b/handbook/support-process.md
@@ -90,6 +90,6 @@ There are four sources that the individual on-call should monitor for activity:
There are several locations in Fleet's public and internal documentation that can be helpful when answering questions raised by the community:
-1. The frequently asked question (FAQ) documents in each section found in the `/docs` folder. These documents are the [Using Fleet FAQ](../docs/1-Using-Fleet/FAQ.md), [Deploying FAQ](../docs/2-Deploying/FAQ.md), and [Contributing FAQ](../docs/3-Contributing/FAQ.md).
+1. The frequently asked question (FAQ) documents in each section found in the `/docs` folder. These documents are the [Using Fleet FAQ](../docs/01-Using-Fleet/FAQ.md), [Deploying FAQ](../docs/02-Deploying/FAQ.md), and [Contributing FAQ](../docs/03-Contributing/FAQ.md).
2. The [Internal FAQ](https://docs.google.com/document/d/1I6pJ3vz0EE-qE13VmpE2G3gd5zA1m3bb_u8Q2G3Gmp0/edit#heading=h.ltavvjy511qv) document.
diff --git a/orbit/README.md b/orbit/README.md
index 18cd740e52..3b3d1da3be 100644
--- a/orbit/README.md
+++ b/orbit/README.md
@@ -192,7 +192,7 @@ Yes! Orbit is licensed under an MIT license and all uses are encouraged.
### How does orbit update osquery? And how do the stable and edge channels get triggered to update osquery on a self hosted Fleet instance?
-Orbit uses a configurable update server. We expect that many folks will just use the update server we manage (similar to what Kolide does with Launcher's update server). We are also offering [tooling for self-managing an update server](https://github.com/fleetdm/fleet/blob/main/docs/2-Deploying/4-fleetctl-agent-updates.md) as part of Fleet Premium (the subscription offering).
+Orbit uses a configurable update server. We expect that many folks will just use the update server we manage (similar to what Kolide does with Launcher's update server). We are also offering [tooling for self-managing an update server](https://github.com/fleetdm/fleet/blob/main/docs/02-Deploying/04-fleetctl-agent-updates.md) as part of Fleet Premium (the subscription offering).
## Community
diff --git a/tools/backup_db/README.md b/tools/backup_db/README.md
index 39f52ea042..11d7ad61a8 100644
--- a/tools/backup_db/README.md
+++ b/tools/backup_db/README.md
@@ -1,3 +1,3 @@
These scripts are for backing up and restore the Docker development MySQL database.
-Usage is documented [here](../../docs/3-Contributing/2-Testing.md#database-backuprestore).
+Usage is documented [here](../../docs/03-Contributing/02-Testing.md#database-backuprestore).
diff --git a/tools/fleetctl-npm/README.md b/tools/fleetctl-npm/README.md
index 52ff50a021..e303e10c50 100644
--- a/tools/fleetctl-npm/README.md
+++ b/tools/fleetctl-npm/README.md
@@ -10,4 +10,4 @@ Simply install `fleetctl` with `npm install -g fleetctl`.
## Usage
-See the [fleetctl documentation](https://github.com/fleetdm/fleet/blob/main/docs/1-Using-Fleet/2-fleetctl-CLI.md) or `fleetctl --help` for usage instructions.
+See the [fleetctl documentation](https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/02-fleetctl-CLI.md) or `fleetctl --help` for usage instructions.
From e03b2c7ee32e54155be14bcfbd9ad566abbe7187 Mon Sep 17 00:00:00 2001
From: Zach Wasserman
Date: Wed, 22 Sep 2021 09:53:41 -0700
Subject: [PATCH 56/82] Remove erroneously included infra files (#2179)
Nothing sensitive was included.
---
tools/deploy/terraform-aws-fargate/database.tf | 12 ------------
tools/deploy/terraform-aws-fargate/variables.tf | 1 -
tools/docker-fleetctl-awscli/Dockerfile | 4 ----
3 files changed, 17 deletions(-)
delete mode 100644 tools/deploy/terraform-aws-fargate/database.tf
delete mode 100644 tools/deploy/terraform-aws-fargate/variables.tf
delete mode 100644 tools/docker-fleetctl-awscli/Dockerfile
diff --git a/tools/deploy/terraform-aws-fargate/database.tf b/tools/deploy/terraform-aws-fargate/database.tf
deleted file mode 100644
index c87da3ade7..0000000000
--- a/tools/deploy/terraform-aws-fargate/database.tf
+++ /dev/null
@@ -1,12 +0,0 @@
-resource "aws_db_instance" "default" {
- allocated_storage = 10
- engine = "mysql"
- engine_version = "5.7"
- instance_class = "db.t3.micro"
- identifier_prefix = "fleet"
- name = "fleet"
- username = "foo"
- password = "foobarbaz"
- parameter_group_name = "default.mysql5.7"
- skip_final_snapshot = true
-}
\ No newline at end of file
diff --git a/tools/deploy/terraform-aws-fargate/variables.tf b/tools/deploy/terraform-aws-fargate/variables.tf
deleted file mode 100644
index b7bf843b5d..0000000000
--- a/tools/deploy/terraform-aws-fargate/variables.tf
+++ /dev/null
@@ -1 +0,0 @@
-variable "vpc_id" {}
\ No newline at end of file
diff --git a/tools/docker-fleetctl-awscli/Dockerfile b/tools/docker-fleetctl-awscli/Dockerfile
deleted file mode 100644
index ff1fed9368..0000000000
--- a/tools/docker-fleetctl-awscli/Dockerfile
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM amazon/aws-cli
-MAINTAINER Fleet Developers
-
-RUN curl https://github.com/fleetdm/fleet/releases/latest/download/fleetctl-linux.tar.gz | tar -xf
From 3ea0439cf03736af8f5f7122d87fec8c2945c282 Mon Sep 17 00:00:00 2001
From: Martin Angers
Date: Wed, 22 Sep 2021 14:44:45 -0400
Subject: [PATCH 57/82] Document the recommended max lifetime config for read
replicas (#2189)
---
docs/02-Deploying/02-Configuration.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/02-Deploying/02-Configuration.md b/docs/02-Deploying/02-Configuration.md
index 0b2f95938f..c959381768 100644
--- a/docs/02-Deploying/02-Configuration.md
+++ b/docs/02-Deploying/02-Configuration.md
@@ -131,7 +131,9 @@ All duration-based settings accept valid time units of `s`, `m`, `h`.
##### MySQL
-This section describes the configuration options for the primary - if you also want to setup a read replica, the options are the same, except that the yaml section is `mysql_read_replica`, and the flags have the `mysql_read_replica_` prefix instead of `mysql_` (the corresponding environment variables follow the same transformation). Note that there is no default value for `mysql_read_replica_address`, it must be set explicitly for fleet to use a read replica.
+This section describes the configuration options for the primary - if you also want to setup a read replica, the options are the same, except that the yaml section is `mysql_read_replica`, and the flags have the `mysql_read_replica_` prefix instead of `mysql_` (the corresponding environment variables follow the same transformation). Note that there is no default value for `mysql_read_replica_address`, it must be set explicitly for fleet to use a read replica, and it is recommended in that case to set a non-zero value for `mysql_read_replica_conn_max_lifetime` as in some environments, the replica's address may dynamically change to point
+from the primary to an actual distinct replica based on auto-scaling options, so existing idle connections need to be recycled
+periodically.
###### mysql_address
From 8600d71d353b67992712cbce54fd9edffc4ca1a8 Mon Sep 17 00:00:00 2001
From: Tomas Touceda
Date: Wed, 22 Sep 2021 17:18:55 -0300
Subject: [PATCH 58/82] Add osquery perf (#2190)
* Add osquery perf
* Update dockerfile and gh action
---
.../workflows/push-osquery-perf-to-ecr.yml | 39 +++
Dockerfile.osquery-perf | 16 +
cmd/osquery-perf/README.md | 82 +++++
cmd/osquery-perf/agent.go | 285 ++++++++++++++++
cmd/osquery-perf/mac10.14.6.tmpl | 309 ++++++++++++++++++
go.mod | 2 +-
go.sum | 2 +
7 files changed, 734 insertions(+), 1 deletion(-)
create mode 100644 .github/workflows/push-osquery-perf-to-ecr.yml
create mode 100644 Dockerfile.osquery-perf
create mode 100644 cmd/osquery-perf/README.md
create mode 100644 cmd/osquery-perf/agent.go
create mode 100644 cmd/osquery-perf/mac10.14.6.tmpl
diff --git a/.github/workflows/push-osquery-perf-to-ecr.yml b/.github/workflows/push-osquery-perf-to-ecr.yml
new file mode 100644
index 0000000000..9ac308d0bb
--- /dev/null
+++ b/.github/workflows/push-osquery-perf-to-ecr.yml
@@ -0,0 +1,39 @@
+name: Build docker image and publish to ECR
+
+on:
+ workflow_dispatch:
+ inputs:
+ enroll_secret:
+ description: 'Enroll Secret'
+ required: true
+ url:
+ description: 'Fleet server URL'
+ required: true
+ tag:
+ description: 'docker image tag'
+ required: true
+ default: latest
+
+jobs:
+ build-docker:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Configure AWS credentials
+ uses: aws-actions/configure-aws-credentials@v1
+ with:
+ aws-access-key-id: ${{ secrets.LOADTEST_AWS_ACCESS_KEY_ID }}
+ aws-secret-access-key: ${{ secrets.LOADTEST_AWS_SECRET_ACCESS_KEY }}
+ aws-region: us-east-2
+
+ - name: Login to Amazon ECR
+ id: login-ecr
+ uses: aws-actions/amazon-ecr-login@v1
+
+ - name: Build, tag, and push image to Amazon ECR
+ env:
+ ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
+ ECR_REPOSITORY: osquery-perf
+ IMAGE_TAG: ${{ github.event.inputs.tag }}
+ run: |
+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --build-arg ENROLL_SECRET=${{ github.event.inputs.enroll_secret }} --build-arg HOST_COUNT=${{ github.event.inputs.host_count }} --build-arg SERVER_URL=${{ github.event.inputs.url }} -f Dockerfile.osquery-perf .
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
\ No newline at end of file
diff --git a/Dockerfile.osquery-perf b/Dockerfile.osquery-perf
new file mode 100644
index 0000000000..e78d967ef5
--- /dev/null
+++ b/Dockerfile.osquery-perf
@@ -0,0 +1,16 @@
+FROM golang:1.17.1-alpine
+
+ARG ENROLL_SECRET
+ARG HOST_COUNT
+ARG SERVER_URL
+
+ENV ENROLL_SECRET ${ENROLL_SECRET}
+ENV HOST_COUNT ${HOST_COUNT}
+ENV SERVER_URL ${SERVER_URL}
+
+COPY ./cmd/osquery-perf/agent.go ./go.mod ./go.sum ./cmd/osquery-perf/mac10.14.6.tmpl /osquery-perf/
+WORKDIR /osquery-perf/
+RUN go mod download
+RUN go build -o osquery-perf
+
+CMD ./osquery-perf -enroll_secret $ENROLL_SECRET -host_count $HOST_COUNT -server_url $SERVER_URL
\ No newline at end of file
diff --git a/cmd/osquery-perf/README.md b/cmd/osquery-perf/README.md
new file mode 100644
index 0000000000..9a809d34ae
--- /dev/null
+++ b/cmd/osquery-perf/README.md
@@ -0,0 +1,82 @@
+# Osquery Server Performance Tester
+
+> **TODO: Archive this repo and move its contents inline into https://github.com/fleetdm/fleet**
+
+This repository provides a tool to generate realistic traffic to an osquery
+management server (primarily, [Fleet](https://github.com/fleetdm/fleet)). With
+this tool, many thousands of hosts can be simulated from a single host.
+
+## Requirements
+
+The only requirement for running this tool is a working installation of
+[Go](https://golang.org/doc/install).
+
+## Usage
+
+Typically `go run` is used:
+
+```
+go run agent.go --help
+Usage of agent.go:
+ -config_interval duration
+ Interval for config requests (default 1m0s)
+ -enroll_secret string
+ Enroll secret to authenticate enrollment
+ -host_count int
+ Number of hosts to start (default 10) (default 10)
+ -query_interval duration
+ Interval for live query requests (default 10s)
+ -seed int
+ Seed for random generator (default current time) (default 1586310930917739000)
+ -server_url string
+ URL (with protocol and port of osquery server) (default "https://localhost:8080")
+ -start_period duration
+ Duration to spread start of hosts over (default 10s)
+exit status 2
+```
+
+The tool should be invoked with the appropriate enroll secret. A typical
+invocation looks like:
+
+```
+go run agent.go --enroll_secret hgh4hk3434l2jjf
+```
+
+When starting many hosts, it is a good idea to extend the intervals, and also
+the period over which the hosts are started:
+
+```
+go run agent.go --enroll_secret hgh4hk3434l2jjf --host_count 5000 --start_period 5m --query_interval 60s --config_interval 5m
+```
+
+This will start 5,000 hosts over a period of 5 minutes. Each host will check in
+for live queries at a 1 minute interval, and for configuration at a 5 minute
+interval. Starting over a 5 minute period ensures that the configuration
+requests are spread evenly over the 5 minute interval.
+
+It can be useful to start the "same" hosts. This can be achieved with the
+`--seed` parameter:
+
+```
+go run agent.go --enroll_secret hgh4hk3434l2jjf --seed 0
+```
+
+By using the same seed, along with other values, we usually get hosts that look
+the same to the server. This is not guaranteed, but it is a useful technique.
+
+### Resource Limits
+
+On many systems, trying to simulate a large number of hosts will result in hitting system resource limits (such as number of open file descriptors).
+
+If you see errors such as `dial tcp: lookup localhost: no such host` or `read: connection reset by peer`, try increasing these limits.
+
+#### macOS
+
+Run the following command in the shell before running the Fleet server _and_ before running `agent.go` (run it once in each shell):
+
+``` sh
+ulimit -n 64000
+```
+
+## Bugs
+To report a bug, [click here](https://github.com/fleetdm/fleet).
diff --git a/cmd/osquery-perf/agent.go b/cmd/osquery-perf/agent.go
new file mode 100644
index 0000000000..a0339bd8fa
--- /dev/null
+++ b/cmd/osquery-perf/agent.go
@@ -0,0 +1,285 @@
+package main
+
+import (
+ "bytes"
+ "crypto/tls"
+ "encoding/json"
+ "flag"
+ "fmt"
+ "log"
+ "math/rand"
+ "net/http"
+ "strings"
+ "text/template"
+ "time"
+
+ "github.com/google/uuid"
+)
+
+type Agent struct {
+ ServerAddress string
+ EnrollSecret string
+ NodeKey string
+ UUID string
+ Client http.Client
+ ConfigInterval time.Duration
+ QueryInterval time.Duration
+ Templates *template.Template
+ strings map[string]string
+}
+
+func NewAgent(serverAddress, enrollSecret string, templates *template.Template, configInterval, queryInterval time.Duration) *Agent {
+ transport := http.DefaultTransport.(*http.Transport).Clone()
+ transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
+ transport.DisableCompression = true
+ return &Agent{
+ ServerAddress: serverAddress,
+ EnrollSecret: enrollSecret,
+ Templates: templates,
+ ConfigInterval: configInterval,
+ QueryInterval: queryInterval,
+ UUID: uuid.New().String(),
+ Client: http.Client{Transport: transport},
+ strings: make(map[string]string),
+ }
+}
+
+type enrollResponse struct {
+ NodeKey string `json:"node_key"`
+}
+
+type distributedReadResponse struct {
+ Queries map[string]string `json:"queries"`
+}
+
+func (a *Agent) runLoop() {
+ a.Enroll()
+
+ a.Config()
+ resp, err := a.DistributedRead()
+ if err != nil {
+ log.Println(err)
+ } else {
+ if len(resp.Queries) > 0 {
+ a.DistributedWrite(resp.Queries)
+ }
+ }
+
+ configTicker := time.Tick(a.ConfigInterval)
+ liveQueryTicker := time.Tick(a.QueryInterval)
+ for {
+ select {
+ case <-configTicker:
+ a.Config()
+ case <-liveQueryTicker:
+ resp, err := a.DistributedRead()
+ if err != nil {
+ log.Println(err)
+ } else {
+ if len(resp.Queries) > 0 {
+ a.DistributedWrite(resp.Queries)
+ }
+ }
+ }
+ }
+}
+
+const stringVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_."
+
+func (a *Agent) randomString(n int) string {
+ sb := strings.Builder{}
+ sb.Grow(n)
+ for i := 0; i < n; i++ {
+ sb.WriteByte(stringVals[rand.Int63()%int64(len(stringVals))])
+ }
+ return sb.String()
+}
+
+func (a *Agent) CachedString(key string) string {
+ if val, ok := a.strings[key]; ok {
+ return val
+ }
+ val := a.randomString(12)
+ a.strings[key] = val
+ return val
+}
+
+func (a *Agent) Enroll() {
+ var body bytes.Buffer
+ if err := a.Templates.ExecuteTemplate(&body, "enroll", a); err != nil {
+ log.Println("execute template:", err)
+ return
+ }
+
+ req, err := http.NewRequest("POST", a.ServerAddress+"/api/v1/osquery/enroll", &body)
+ if err != nil {
+ log.Println("create request:", err)
+ return
+ }
+ req.Header.Add("Content-Type", "application/json")
+ req.Header.Add("Accept", "application/json")
+ req.Header.Add("User-Agent", "osquery/4.6.0")
+
+ resp, err := a.Client.Do(req)
+ if err != nil {
+ log.Println("do request:", err)
+ return
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ log.Println("status:", resp.Status)
+ return
+ }
+
+ var parsedResp enrollResponse
+ if err := json.NewDecoder(resp.Body).Decode(&parsedResp); err != nil {
+ log.Println("json parse:", err)
+ return
+ }
+
+ a.NodeKey = parsedResp.NodeKey
+}
+
+func (a *Agent) Config() {
+ body := bytes.NewBufferString(`{"node_key": "` + a.NodeKey + `"}`)
+
+ req, err := http.NewRequest("POST", a.ServerAddress+"/api/v1/osquery/config", body)
+ if err != nil {
+ log.Println("create config request:", err)
+ return
+ }
+ req.Header.Add("Content-Type", "application/json")
+ req.Header.Add("Accept", "application/json")
+ req.Header.Add("User-Agent", "osquery/4.6.0")
+
+ resp, err := a.Client.Do(req)
+ if err != nil {
+ log.Println("do config request:", err)
+ return
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ log.Println("config status:", resp.Status)
+ return
+ }
+
+ // No need to read the config body
+}
+
+func (a *Agent) DistributedRead() (*distributedReadResponse, error) {
+ body := bytes.NewBufferString(`{"node_key": "` + a.NodeKey + `"}`)
+
+ req, err := http.NewRequest("POST", a.ServerAddress+"/api/v1/osquery/distributed/read", body)
+ if err != nil {
+ return nil, fmt.Errorf("create distributed read request: %s", err)
+ }
+ req.Header.Add("Content-Type", "application/json")
+ req.Header.Add("Accept", "application/json")
+ req.Header.Add("User-Agent", "osquery/4.6.0")
+
+ resp, err := a.Client.Do(req)
+ if err != nil {
+ return nil, fmt.Errorf("do distributed read request: %s", err)
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("distributed read status: %s", resp.Status)
+ }
+
+ var parsedResp distributedReadResponse
+ if err := json.NewDecoder(resp.Body).Decode(&parsedResp); err != nil {
+ return nil, fmt.Errorf("json parse distributed read response: %s", err)
+ }
+
+ return &parsedResp, nil
+}
+
+type distributedWriteRequest struct {
+ Queries map[string]json.RawMessage `json:"queries"`
+ Statuses map[string]string `json:"statuses"`
+ NodeKey string `json:"node_key"`
+}
+
+var defaultQueryResult = json.RawMessage(`[{"foo": "bar"}]`)
+
+const statusSuccess = "0"
+
+func (a *Agent) DistributedWrite(queries map[string]string) {
+ var body bytes.Buffer
+
+ if _, ok := queries["fleet_detail_query_network_interface"]; ok {
+ // Respond to label/detail queries
+ a.Templates.ExecuteTemplate(&body, "distributed_write", a)
+ } else {
+ // Return a generic response for any other queries
+ req := distributedWriteRequest{
+ Queries: make(map[string]json.RawMessage),
+ Statuses: make(map[string]string),
+ NodeKey: a.NodeKey,
+ }
+
+ for name := range queries {
+ req.Queries[name] = defaultQueryResult
+ req.Statuses[name] = statusSuccess
+ }
+ json.NewEncoder(&body).Encode(req)
+ }
+
+ req, err := http.NewRequest("POST", a.ServerAddress+"/api/v1/osquery/distributed/write", &body)
+ if err != nil {
+ log.Println("create distributed write request:", err)
+ return
+ }
+ req.Header.Add("Content-Type", "application/json")
+ req.Header.Add("Accept", "application/json")
+ req.Header.Add("User-Agent", "osquery/4.6.0")
+
+ resp, err := a.Client.Do(req)
+ if err != nil {
+ log.Println("do distributed write request:", err)
+ return
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ log.Println("distributed write status:", resp.Status)
+ return
+ }
+
+ // No need to read the distributed write body
+}
+
+func main() {
+ serverURL := flag.String("server_url", "https://localhost:8080", "URL (with protocol and port of osquery server)")
+ enrollSecret := flag.String("enroll_secret", "", "Enroll secret to authenticate enrollment")
+ hostCount := flag.Int("host_count", 10, "Number of hosts to start (default 10)")
+ randSeed := flag.Int64("seed", time.Now().UnixNano(), "Seed for random generator (default current time)")
+ startPeriod := flag.Duration("start_period", 10*time.Second, "Duration to spread start of hosts over")
+ configInterval := flag.Duration("config_interval", 1*time.Minute, "Interval for config requests")
+ queryInterval := flag.Duration("query_interval", 10*time.Second, "Interval for live query requests")
+
+ flag.Parse()
+
+ rand.Seed(*randSeed)
+
+ tmpl, err := template.ParseGlob("*.tmpl")
+ if err != nil {
+ log.Fatal("parse templates: ", err)
+ }
+
+ // Spread starts over the interval to prevent thunering herd
+ sleepTime := *startPeriod / time.Duration(*hostCount)
+ var agents []*Agent
+ for i := 0; i < *hostCount; i++ {
+ a := NewAgent(*serverURL, *enrollSecret, tmpl, *configInterval, *queryInterval)
+ agents = append(agents, a)
+ go a.runLoop()
+ time.Sleep(sleepTime)
+ }
+
+ fmt.Println("Agents running. Kill with C-c.")
+ <-make(chan struct{})
+}
diff --git a/cmd/osquery-perf/mac10.14.6.tmpl b/cmd/osquery-perf/mac10.14.6.tmpl
new file mode 100644
index 0000000000..88b6f713a9
--- /dev/null
+++ b/cmd/osquery-perf/mac10.14.6.tmpl
@@ -0,0 +1,309 @@
+{{ define "enroll" -}}
+{
+ "enroll_secret": "{{ .EnrollSecret }}",
+ "host_details": {
+ "os_version": {
+ "build": "18G3020",
+ "major": "10",
+ "minor": "14",
+ "name": "Mac OS X",
+ "patch": "6",
+ "platform": "darwin",
+ "platform_like": "darwin",
+ "version": "10.14.6"
+ },
+ "osquery_info": {
+ "build_distro": "10.12",
+ "build_platform": "darwin",
+ "config_hash": "",
+ "config_valid": "0",
+ "extensions": "inactive",
+ "instance_id": "{{ .UUID }}",
+ "pid": "12947",
+ "platform_mask": "21",
+ "start_time": "1580931224",
+ "uuid": "{{ .UUID }}",
+ "version": "4.6.0",
+ "watcher": "12946"
+ },
+ "platform_info": {
+ "address": "0xff990000",
+ "date": "12/16/2019 ",
+ "extra": "MBP114; 196.0.0.0.0; root@xapp160; Mon Dec 16 15:55:18 PST 2019; 196 (B&I); F000_B00; Official Build, Release; Apple LLVM version 5.0 (clang-500.0.68) (based on LLVM 3.3svn)",
+ "revision": "196 (B&I)",
+ "size": "8388608",
+ "vendor": "Apple Inc. ",
+ "version": "196.0.0.0.0 ",
+ "volume_size": "1507328"
+ },
+ "system_info": {
+ "computer_name": "{{ .CachedString "hostname" }}",
+ "cpu_brand": "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
+ "cpu_logical_cores": "8",
+ "cpu_physical_cores": "4",
+ "cpu_subtype": "Intel x86-64h Haswell",
+ "cpu_type": "x86_64h",
+ "hardware_model": "MacBookPro11,4",
+ "hardware_serial": "D02R835DG8WK",
+ "hardware_vendor": "Apple Inc.",
+ "hardware_version": "1.0",
+ "hostname": "{{ .CachedString "hostname" }}",
+ "local_hostname": "{{ .CachedString "hostname" }}",
+ "physical_memory": "17179869184",
+ "uuid": "{{ .UUID }}"
+ }
+ },
+ "host_identifier": "{{ .CachedString "hostname" }}",
+ "platform_type": "21"
+}
+{{- end }}
+
+{{ define "distributed_write" -}}
+{
+ "queries":{
+ "fleet_detail_query_network_interface":[
+ {
+ "point_to_point":"",
+ "address":"fe80::8cb:112d:ff51:1e5d%en0",
+ "mask":"ffff:ffff:ffff:ffff::",
+ "broadcast":"",
+ "interface":"en0",
+ "mac":"f8:2d:88:93:56:5c",
+ "type":"6",
+ "mtu":"1500",
+ "metric":"0",
+ "ipackets":"278493",
+ "opackets":"206238",
+ "ibytes":"275799040",
+ "obytes":"37720064",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582848084"
+
+},
+ {
+ "point_to_point":"",
+ "address":"192.168.1.3",
+ "mask":"255.255.255.0",
+ "broadcast":"192.168.1.255",
+ "interface":"en0",
+ "mac":"f5:5a:80:92:52:5b",
+ "type":"6",
+ "mtu":"1500",
+ "metric":"0",
+ "ipackets":"278493",
+ "opackets":"206238",
+ "ibytes":"275799040",
+ "obytes":"37720064",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582848084"
+
+},
+ {
+ "point_to_point":"127.0.0.1",
+ "address":"127.0.0.1",
+ "mask":"255.0.0.0",
+ "broadcast":"",
+ "interface":"lo0",
+ "mac":"00:00:00:00:00:00",
+ "type":"24",
+ "mtu":"16384",
+ "metric":"0",
+ "ipackets":"132952",
+ "opackets":"132952",
+ "ibytes":"67053568",
+ "obytes":"67053568",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582840871"
+
+},
+ {
+ "point_to_point":"::1",
+ "address":"::1",
+ "mask":"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
+ "broadcast":"",
+ "interface":"lo0",
+ "mac":"00:00:00:00:00:00",
+ "type":"24",
+ "mtu":"16384",
+ "metric":"0",
+ "ipackets":"132952",
+ "opackets":"132952",
+ "ibytes":"67053568",
+ "obytes":"67053568",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582840871"
+
+},
+ {
+ "point_to_point":"",
+ "address":"fe80::1%lo0",
+ "mask":"ffff:ffff:ffff:ffff::",
+ "broadcast":"",
+ "interface":"lo0",
+ "mac":"00:00:00:00:00:00",
+ "type":"24",
+ "mtu":"16384",
+ "metric":"0",
+ "ipackets":"132952",
+ "opackets":"132952",
+ "ibytes":"67053568",
+ "obytes":"67053568",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582840871"
+
+},
+ {
+ "point_to_point":"",
+ "address":"fe80::3a:84ff:fe6b:bf75%awdl0",
+ "mask":"ffff:ffff:ffff:ffff::",
+ "broadcast":"",
+ "interface":"awdl0",
+ "mac":"03:3b:94:5b:be:75",
+ "type":"6",
+ "mtu":"1484",
+ "metric":"0",
+ "ipackets":"0",
+ "opackets":"16",
+ "ibytes":"0",
+ "obytes":"3072",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582842892"
+
+},
+ {
+ "point_to_point":"",
+ "address":"fe80::6eaf:9721:3476:b691%utun0",
+ "mask":"ffff:ffff:ffff:ffff::",
+ "broadcast":"",
+ "interface":"utun0",
+ "mac":"00:00:00:00:00:00",
+ "type":"1",
+ "mtu":"2000",
+ "metric":"0",
+ "ipackets":"0",
+ "opackets":"2",
+ "ibytes":"0",
+ "obytes":"0",
+ "ierrors":"0",
+ "oerrors":"0",
+ "idrops":"0",
+ "odrops":"0",
+ "last_change":"1582840897"
+
+}
+
+],
+ "fleet_detail_query_os_version":[
+ {
+ "name":"Mac OS X",
+ "version":"10.14.6",
+ "major":"10",
+ "minor":"14",
+ "patch":"6",
+ "build":"18G3020",
+ "platform":"darwin",
+ "platform_like":"darwin",
+ "codename":""
+
+}
+
+],
+ "fleet_detail_query_osquery_flags":[
+ {
+ "name":"config_refresh",
+ "value":"{{ printf "%.0f" .ConfigInterval.Seconds }}"
+
+},
+ {
+ "name":"distributed_interval",
+ "value":"{{ printf "%.0f" .QueryInterval.Seconds }}"
+
+},
+ {
+ "name":"logger_tls_period",
+ "value":"99999"
+
+}
+
+],
+ "fleet_detail_query_osquery_info":[
+ {
+ "pid":"11287",
+ "uuid":"{{ .UUID }}",
+ "instance_id":"{{ .UUID }}",
+ "version":"4.1.2",
+ "config_hash":"b01efbf375ac6767f259ae98751154fef727ce35",
+ "config_valid":"1",
+ "extensions":"inactive",
+ "build_platform":"darwin",
+ "build_distro":"10.12",
+ "start_time":"1582857555",
+ "watcher":"11286",
+ "platform_mask":"21"
+
+}
+
+],
+ "fleet_detail_query_system_info":[
+ {
+ "hostname":"{{ .CachedString "hostname" }}",
+ "uuid":"4740D59F-699E-5B29-960B-979AAF9BBEEB",
+ "cpu_type":"x86_64h",
+ "cpu_subtype":"Intel x86-64h Haswell",
+ "cpu_brand":"Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz",
+ "cpu_physical_cores":"4",
+ "cpu_logical_cores":"8",
+ "cpu_microcode":"",
+ "physical_memory":"17179869184",
+ "hardware_vendor":"Apple Inc.",
+ "hardware_model":"MacBookPro11,4",
+ "hardware_version":"1.0",
+ "hardware_serial":"C02R262BM8LN",
+ "computer_name":"{{ .CachedString "hostname" }}",
+ "local_hostname":"{{ .CachedString "hostname" }}"
+
+}
+
+],
+ "fleet_detail_query_uptime":[
+ {
+ "days":"0",
+ "hours":"4",
+ "minutes":"38",
+ "seconds":"11",
+ "total_seconds":"16691"
+
+}
+
+]
+
+},
+ "statuses":{
+ "fleet_detail_query_network_interface":0,
+ "fleet_detail_query_os_version":0,
+ "fleet_detail_query_osquery_flags":0,
+ "fleet_detail_query_osquery_info":0,
+ "fleet_detail_query_system_info":0,
+ "fleet_detail_query_uptime":0
+},
+ "node_key":"{{ .NodeKey }}"
+}
+{{- end }}
diff --git a/go.mod b/go.mod
index b7b7271608..6b0d2d7ea9 100644
--- a/go.mod
+++ b/go.mod
@@ -33,7 +33,7 @@ require (
github.com/gomodule/redigo v1.8.5
github.com/google/go-cmp v0.5.6
github.com/google/go-github/v37 v37.0.0
- github.com/google/uuid v1.1.2
+ github.com/google/uuid v1.3.0
github.com/goreleaser/nfpm/v2 v2.2.2
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.4.2
diff --git a/go.sum b/go.sum
index dd625a9fa6..c045b59475 100644
--- a/go.sum
+++ b/go.sum
@@ -454,6 +454,8 @@ github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4Mgqvf
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
From 1db2acbff7f5ca8792501438822918161521c114 Mon Sep 17 00:00:00 2001
From: Tomas Touceda
Date: Wed, 22 Sep 2021 17:21:50 -0300
Subject: [PATCH 59/82] Add host count input (#2191)
---
.github/workflows/push-osquery-perf-to-ecr.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/workflows/push-osquery-perf-to-ecr.yml b/.github/workflows/push-osquery-perf-to-ecr.yml
index 9ac308d0bb..2841658a4e 100644
--- a/.github/workflows/push-osquery-perf-to-ecr.yml
+++ b/.github/workflows/push-osquery-perf-to-ecr.yml
@@ -9,6 +9,10 @@ on:
url:
description: 'Fleet server URL'
required: true
+ host_count:
+ description: 'Amount of hosts to emulate'
+ required: true
+ default: 20
tag:
description: 'docker image tag'
required: true
From 07342e95c95fc69911d79687275ef76347334860 Mon Sep 17 00:00:00 2001
From: Tomas Touceda
Date: Wed, 22 Sep 2021 17:26:02 -0300
Subject: [PATCH 60/82] Need to checkout code explicitly (#2192)
---
.github/workflows/push-osquery-perf-to-ecr.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/push-osquery-perf-to-ecr.yml b/.github/workflows/push-osquery-perf-to-ecr.yml
index 2841658a4e..197ec32864 100644
--- a/.github/workflows/push-osquery-perf-to-ecr.yml
+++ b/.github/workflows/push-osquery-perf-to-ecr.yml
@@ -22,6 +22,9 @@ jobs:
build-docker:
runs-on: ubuntu-latest
steps:
+ - name: Checkout Code
+ uses: actions/checkout@v2
+
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
From 2505b68cb8dd82437a51a109d503477c35c2e484 Mon Sep 17 00:00:00 2001
From: Mike McNeil
Date: Wed, 22 Sep 2021 23:15:25 -0500
Subject: [PATCH 61/82] Make logos page more inviting for anyone in the
community who might want to use our logo in an article or apply a wallpaper
(#2174)
---
website/views/layouts/layout.ejs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/website/views/layouts/layout.ejs b/website/views/layouts/layout.ejs
index d609febe48..4c3854afb4 100644
--- a/website/views/layouts/layout.ejs
+++ b/website/views/layouts/layout.ejs
@@ -135,7 +135,7 @@
Blog
Jobs
Contribute
- Press Kit
+ Logos/artwork
Hall of fame
From e5452f4e4de1095db7d3a378d807026a44514475 Mon Sep 17 00:00:00 2001
From: Renee Jackson <44620612+rlynnj11@users.noreply.github.com>
Date: Thu, 23 Sep 2021 11:32:02 -0300
Subject: [PATCH 62/82] Update manual qa document (#2124)
* Pack location
Future-proofing instructions for ease of onboards by adding location information.
* Label queries are immutable (addition)
Previous document made it seem users should be able to edit label queries.
* removal of all non-preview tasks
Non-preview tasks will be moved to /docs/3-Contributing/2-Testing.md. Additional changes include clarifications to the testing steps.
* update link
* Update manual-qa.md
---
handbook/manual-qa.md | 126 ++++--------------------------------------
1 file changed, 10 insertions(+), 116 deletions(-)
diff --git a/handbook/manual-qa.md b/handbook/manual-qa.md
index 0c769e22e2..3f84eb2412 100644
--- a/handbook/manual-qa.md
+++ b/handbook/manual-qa.md
@@ -2,63 +2,31 @@
This living document outlines the manual quality assurance process conducted to ensure each release of Fleet meets organization standards.
-All steps should be conducted during each QA pass.
+All steps should be conducted during each QA pass. All steps are possible with `fleetctrl preview`.
As new features are added to Fleet, new steps and flows will be added.
## Collecting bugs
-The goal of manual QA is to catch unexpected behavior prior to release.
+The goal of manual QA is to catch unexpected behavior prior to release. All Manual QA steps should be possible using `fleetctl preview`. Please refer to [docs/03-Contributing/02-Testing.md](https://github.com/fleetdm/fleet/blob/main/docs/03-Contributing/02-Testing.md) for flows that cannot be completed using `fleetctl preview`.
Please start the manual QA process by creating a blank GitHub issue. As you complete each of the flows, record a list of the bugs you encounter in this new issue. Each item in this list should contain one sentence describing the bug and a screenshot if the item is a frontend bug.
## Fleet UI
-### Clear your local MySQL database
-
-Before you fire up your local Fleet server, wipe your local MySQL database by running the following command:
-
-```
-docker volume rm fleet_mysql-persistent-volume
-```
-
-If you receive an error that says "No such volume," double check that the MySQL volume doesn't have a different name by running this command:
-
-```
-docker volume ls
-```
-
-### Start your development server
-
-Next, fire up your local Fleet server. Check out [this Loom video](https://www.loom.com/share/e7439f058eb44c45af872abe8f8de4a1) for instructions on starting up your local development environment.
+For all following flows, please refer to the [permissions documentation](https://fleetdm.com/docs/using-fleet/permissions) to ensure that actions are limited to the appropriate user type. Any users with access beyond what this document lists as availale should be considered a bug and reported for either documentation updates or investigation.
### Set up flow
-Successfully set up Fleet.
+Successfully set up `fleetctl preview` using the preview steps outlined [here](https://fleetdm.com/get-started)
### Login and logout flow
Successfully logout and then login to your local Fleet.
-### Enroll host flow
-
-Enroll your local machine to Fleet. Check out the [Orbit for osquery documentation](https://github.com/fleetdm/orbit#orbit-osquery) for instructions on generating and installing an Orbit package.
-
-### Host page
-
-To populate the Fleet UI with more than just one host you'll need to use the [fleetdm/osquery-perf tool](https://github.com/fleetdm/osquery-perf/tree/629a7efb6097f9108f706ccd45828793ff73cf9c).
-
-First, clone the fleetdm/osquery perf repo and then run the following commands from the top level of the cloned directory:
-
-```
-go run agent.go --host_count 200 --enroll_secret