diff --git a/.eslintrc.js b/.eslintrc.js
index bc42a93c1..d570a3b9a 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -5,7 +5,6 @@ module.exports = {
"plugin:jest/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
- "plugin:cypress/recommended",
"plugin:prettier/recommended",
"plugin:storybook/recommended",
],
@@ -83,13 +82,6 @@ module.exports = {
"jsx-a11y/anchor-has-content": "off",
},
overrides: [
- {
- files: ["cypress/**/*.ts"],
- // Set to turn off jest linting error on cypress library
- rules: {
- "jest/valid-expect": "off",
- },
- },
],
settings: {
"import/resolver": {
diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md
index 271e930f9..bb40d2b6c 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.md
+++ b/.github/ISSUE_TEMPLATE/bug-report.md
@@ -1,32 +1,33 @@
---
-name: 🦟 Bug report
+name: 🦟 Bug report
about: Report a bug to help us improve.
title: ''
-labels: 'bug,:reproduce'
+labels: 'bug,:reproduce,:incoming'
assignees: ''
---
-**Fleet version**: _(head to the "My account" page in the Fleet UI or run `fleetctl --version`)_
+**Fleet version**:
-**Operating system**: _(e.g. macOS 11.2.3)_
-
-**Web browser**: _(e.g. Chrome 88.0.4324)_
+**Web browser and operating system**:
+Test name | Step instructions | Expected result | pass/fail |
+$Name | {what a tester should do} | {what a tester should see when they do that} | pass/fail |
+Update flow |
+
+1. remove all fleet processes/agents/etc using `fleetctl preview reset` for a clean slate
+2. run `fleetctl preview` with no tag for latest stable
+3. create a host/query to later confirm upgrade with
+4. STOP fleet-preview-server instances in containers/apps on Docker
+5. run `fleetctl preview` with appropriate testing tag | All previously created hosts/queries are verified to still exist | pass/fail |
+Login flow |
+
+1. navigate to the login page and attempt to login with both valid and invalid credentials to verify some combination of expected results.
+2. navigate to the login page and attempt to login with both valid and invalid sso credentials to verify expected results.
+ |
+
+1. text fields prompt when blank
+2. correct error message is "authentication failed"
+3. forget password link prompts for email
+4. valid credentials result in a successful login.
+5. valid sso credentials result in a successful login | pass/fail |
+Query flow | Create, edit, run, and delete queries. |
+
+1. permissions regarding creating/editing/deleting queries are up to date with documentation
+2. syntax errors result in error messaging
+3. queries can be run manually
+ | pass/fail |
+Host Flow | Verify a new host can be added and removed following modal instructions using your own device. |
+
+1. Host is added via command line
+2. Host serial number and date added are accurate
+3. Host is not visible after it is deleted
+4. Warning and informational modals show when expected and make sense
+ | pass/fail |
+
+Packs flow | Verify management, operation, and logging of ["2017 packs"](https://fleetdm.com/handbook/company/why-this-way#why-does-fleet-support-query-packs). |
+
+1. Packs successfully run on host machines after migrations
+2. New Packs can be created
+3. Packs can be edited and deleted
+4. Packs results information is logged
+
+ | pass/fail |
+
+Log destination flow | Verify log destination for software, query, policy, and packs. |
+
+1. Software, query, policy, and packs logs are successfully sent to external log destinations
+2. Software, query, policy, and packs logs are successfully sent to Filesystem log destinations
+
+ | pass/fail |
+
+
+My device page | Verify the end user's my device page loads successfully. |
+
+1. Clicking the Fleet desktop item, then "My device" successfully loads the my device page.
+2. The "My device" page is populated correctly and as expected.
+3. Styling and padding appears correct.
+
+ | pass/fail |
+
+MDM enrollment flow | Verify MDM enrollments, run MDM commands |
+
+1. Erase an ADE-eligible macOS host and verify able to complete auomated enrollment flow.
+2. With Windows MDM turned On, enroll a Windows host and verify MDM is turned On for the host.
+3. Verify able to run MDM commands on both macOS and Windows hosts from the CLI.
+ | pass/fail |
+
+Scripts | Verify script library and execution |
+
+1. Verify able to run a script on all host types from CLI.
+2. Verify scripts library upload/download/delete.
+3. From Host details (Windows and macOS) run a script that should PASS, verify.
+4. From Host details (Windows and macOS) run a script that should FAIL, verify.
+5. Verify UI loading state and statuses for scripts.
+6. Disable scripts globally and verify unable to run.
+7. Verify scripts display correctly in Activity feed.
+ | pass/fail |
+
+OS settings | Verify OS settings functionality |
+
+1. Verify able to configure Disk encryption.
+2. Verify host enrolled with Disk encryption enforced successfully encrypts.
+3. Verify Profiles upload/download/delete (macOS & Windows).
+4. Verify profiles are delivered to host and applied.
+ | pass/fail |
+
+Setup experience | Verify macOS Setup experience |
+
+1. Configure End user authentication.
+2. Upload a Boostrap package.
+3. Enroll an ADE-eligible macOS host and verify successful authentication.
+4. Verify Boostrap package is delivered.
+ | pass/fail |
+
+OS updates | Verify OS updates flow |
+
+1. Configure OS updates (macOS & Windows).
+2. Verify on-device that Nudge prompt appears (macOS).
+ | pass/fail |
+
+Migration Test | Verify Fleet can migrate to the next version with no issues. |
+
+Using the migration scripts located in fleet/test/upgrade/
+1. Run the upgrade_test.go script using the most recent stable version of Fleet and `main`.
+2. Upgrade test returns an 'OK' response.
+ | pass/fail |
+
+Migration Test with Percona XtraDB MySQL Server | Verify Fleet can migrate to the next version without issues when using a specific version of Percona XtraDB Server. |
+
+Run the instructions in [tools/percona/test/README.md](../../tools/percona/test/README.md)
+ | pass/fail |
+
+Release blockers | Verify there are no outstanding release blocking tickets. |
+
+1. Check [this](https://github.com/fleetdm/fleet/labels/~release%20blocker) filter to view all open `~release blocker` tickets.
+2. If any are found raise an alarm in the `#help-engineering` and `#help-product-design` channels.
+ | pass/fail |
+
+
+### Notes
+
+Issues found new to this version:
+
+Issues found that reproduce in last stable version:
+
+What has not been tested:
+
+Include any notes on whether issues should block release or not as needed:
+
+## `fleetd` agent:
+
+Includes updates to:
+- Orbit: True / False
+- Desktop: True / False
+- Chrome extension: True / False
+
+List versions changes for any component updates below:
+
+- Orbit `v1.xx.x` > `v1.xx.x`
+- Desktop `v1.xx.x` > `v1.xx.x`
+- Chrome extension `v1.xx.x` > `v1.xx.x`
+
+### Prerequisites
+
+1. Build a new `fleetd` from the release candidate branch as neded for Orbit, Desktop, and Chrome Extension.
+
+
+Test name | Step instructions | Expected result | pass/fail |
+$Name | {what a tester should do} | {what a tester should see when they do that} | pass/fail |
+`fleetd` tests |
+
+1. Create binaries for Mac, Windows, and Ubuntu running against the `edge` channels and install (--orbit-channel edge, --desktop-channel edge).
+2. Work with engineer leading the release to push changes to the `edge` channel.
+ |
+
+1. Confirm the hosts running on the edge channel receive the update and are working correctly.
+2. Confirm any new features and/or bug fixes associated with this release are working as intended.
+ |
+pass/fail |
+`fleetd` auto-update tests |
+
+1. Conduct the [`fleetd` auto-update n+1 test]([url](https://github.com/fleetdm/fleet/blob/main/tools/tuf/test/Fleetd-auto-update-test-guide.md))
+2. QA certifies new release by commenting in issue.
+3. Engineer waits at least 1 business day, then promotes update to `stable`.
+ |
+
+1. Agent successfully auto-updates.
+2. Issue is certified by QA.
+3. Agent is promoted to `stable`.
+4. Confirms agents running on `stable` receive the new update.
+ |
+pass/fail |
+
+
+
+# Notes
+
+Issues found new to this version:
+
+Issues found that reproduce in last stable version:
+
+What has not been tested:
+
+
+Include any notes on whether issues should block release or not as needed:
diff --git a/.github/ISSUE_TEMPLATE/smoke-tests.md b/.github/ISSUE_TEMPLATE/smoke-tests.md
deleted file mode 100644
index 32982acc0..000000000
--- a/.github/ISSUE_TEMPLATE/smoke-tests.md
+++ /dev/null
@@ -1,93 +0,0 @@
----
-name: Release QA
-about: Checklist of required tests prior to release
-title: ''
-labels: ''
-assignees: ''
-
----
-
-# Goal: easy-to-follow test steps for sanity checking a release manually
-
-**Fleet version** (Head to the "My account" page in the Fleet UI or run `fleetctl version`):
-
-**Web browser** _(e.g. Chrome 88.0.4324)_:
-
-# Important reference data
-
-1. [fleetctl preview setup](https://fleetdm.com/fleetctl-preview)
-2. [permissions documentation](https://fleetdm.com/docs/using-fleet/permissions)
-3. premium tests require license key (needs renewal) `fleetctl preview --license-key=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJGbGVldCBEZXZpY2UgTWFuYWdlbWVudCBJbmMuIiwiZXhwIjoxNjQwOTk1MjAwLCJzdWIiOiJkZXZlbG9wbWVudCIsImRldmljZXMiOjEwMCwibm90ZSI6ImZvciBkZXZlbG9wbWVudCBvbmx5IiwidGllciI6ImJhc2ljIiwiaWF0IjoxNjIyNDI2NTg2fQ.WmZ0kG4seW3IrNvULCHUPBSfFdqj38A_eiXdV_DFunMHechjHbkwtfkf1J6JQJoDyqn8raXpgbdhafDwv3rmDw`
-4. premium tests require license key (active - Expires Sunday, January 1, 2023 12:00:00 AM) `fleetctl preview --license-key=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJGbGVldCBEZXZpY2UgTWFuYWdlbWVudCBJbmMuIiwiZXhwIjoxNjcyNTMxMjAwLCJzdWIiOiJGbGVldCBEZXZpY2UgTWFuYWdlbWVudCIsImRldmljZXMiOjEwMCwibm90ZSI6ImZvciBkZXZlbG9wbWVudCBvbmx5IiwidGllciI6InByZW1pdW0iLCJpYXQiOjE2NDI1MjIxODF9.EGHQjIzM73YyMbnCruswzg360DEYCsDi9uz48YcDwQHq90BabGT5PIXRiculw79emGj5sk2aKgccTd2hU5J7Jw`
-
-
-# Smoke Tests
-Smoke tests are limited to core functionality and serve as a sanity test. If smoke tests are failing, a release cannot proceed.
-
-## Prerequisites
-
-1. `fleetctl preview` is set up and running the desired test version using [`--tag` parameters.](https://github.com/fleetdm/fleet/blob/main/handbook/product.md#manual-qa )
-2. Unless you are explicitly testing older browser versions, browser is up to date.
-3. Certificate & flagfile are in place to create new host.
-4. In your browser, clear local storage using devtools.
-
-## Instructions
-
-
-Test name | Step instructions | Expected result | pass/fail |
-$Name | {what a tester should do} | {what a tester should see when they do that} | pass/fail |
-Update flow |
-
-1. remove all fleet processes/agents/etc using `fleetctl preview reset` for a clean slate
-1. run `fleetctl preview` with no tag for latest stable
-1. create a host/query to later confirm upgrade with
-1. STOP fleet-preview-server instances in containers/apps on Docker
-1. run `fleetctl preview` with appropriate testing tag | All previously created hosts/queries are verified to still exist | pass/fail |
-Login flow |
-
-1. navigate to the login page and attempt to login with both valid and invalid credentials to verify some combination of expected results.
-2. navigate to the login page and attempt to login with both valid and invalid sso credentials to verify expected results.
- |
-
-1. text fields prompt when blank
-2. correct error message is "authentication failed"
-3. forget password link prompts for email
-4. valid credentials result in a successful login.
-5. valid sso credentials result in a successful login | pass/fail |
-Query flow | Create, edit, run, and delete queries. |
-
-1. permissions regarding creating/editing/deleting queries are up to date with documentation
-2. syntax errors result in error messaging
-3. queries can be run manually
- | pass/fail |
-Host Flow | Verify a new host can be added and removed following modal instructions using your own device. |
-
-1. Host is added via command line
-2. Host serial number and date added are accurate
-3. Host is not visible after it is deleted
-4. Warning and informational modals show when expected and make sense
- | pass/fail |
-
-Migration Test | Verify Fleet can migrate to the next version with no issues. |
-
-Using the migration scripts located in fleet/test/upgrade/
-1. Run the upgrade_test.go script using the most recent stable version of Fleet and `main`.
-2. Upgrade test returns an 'OK' response.
- | pass/fail |
-
-Release blockers | Verify there are no outstanding release blocking tickets. |
-
-1. Check [this](https://github.com/fleetdm/fleet/labels/~release%20blocker) filter to view all open `~release blocker` tickets.
-2. If any are found raise an alarm in the `#help-engineering` and `#help-product` channels.
- | pass/fail |
-
-
-# Notes
-
-Issues found new to this version:
-
-Issues found that reproduce in last stable version:
-
-What has not been tested:
-
-Include any notes on whether issues should block release or not as needed
diff --git a/.github/ISSUE_TEMPLATE/story.md b/.github/ISSUE_TEMPLATE/story.md
index af1411cf9..aa03f8718 100644
--- a/.github/ISSUE_TEMPLATE/story.md
+++ b/.github/ISSUE_TEMPLATE/story.md
@@ -7,9 +7,9 @@ assignees: ''
---
-> **This issue's remaining effort can be completed in ≤1 sprint. It will be valuable even if nothing else ships.**
->
-> It is [planned and ready](https://fleetdm.com/handbook/company/development-groups#making-changes) to implement. It is on the proper kanban board.
+
+
## Goal
@@ -19,47 +19,39 @@ assignees: ''
| I want to _________________________________________
| so that I can _________________________________________.
-## Changes
-
-This issue's estimation includes completing:
-- [ ] UI changes: TODO
-- [ ] CLI usage changes: TODO
-- [ ] REST API changes: TODO
-- [ ] Permissions changes: TODO
-- [ ] Database schema migrations: TODO
-- [ ] Outdated documentation changes: TODO
-- [ ] Scope transparency changes? TODO
-- [ ] Breaking changes requiring major version bump? TODO
-- [ ] Changes to paid features or tiers? TODO
-- [ ] QA complete?
-- [ ] ...
-
-> ℹ️ Please read this issue carefully and understand it. Pay [special attention](https://fleetdm.com/handbook/company/development-groups#developing-from-wireframes) to UI wireframes, especially "dev notes".
-
-
## Context
-- Requestor(s): _________________________
+- Requestor(s): _________________________
+- Product designer: _________________________
+
+## Changes
+
+### Product
+- [ ] UI changes: TODO
+- [ ] CLI usage changes: TODO
+- [ ] REST API changes: TODO
+- [ ] Permissions changes: TODO
+- [ ] Outdated documentation changes: TODO
+- [ ] Changes to paid features or tiers: TODO
+
+### Engineering
+- [ ] Database schema migrations: TODO
+- [ ] Load testing: TODO
+
+> ℹ️ Please read this issue carefully and understand it. Pay [special attention](https://fleetdm.com/handbook/company/development-groups#developing-from-wireframes) to UI wireframes, especially "dev notes".
## QA
### Risk assessment
-- [ ] Requires load testing TODO
-
-Risk level: Low / High TODO
-
-Risk description: TODO
-
-#### Automated:
-
-- Fleet: Cover / Will not cover
-- QAWolf: Cover / Will not cover
+- Requires load testing: TODO
+- Risk level: Low / High TODO
+- Risk description: TODO
### Manual testing steps
-1. [ ] Engineer (@____): Added comment to user story confirming succesful completion of QA.
-2. [ ] QA (@____): Added comment to user story confirming succesful completion of QA.
+1. [ ] Engineer (@____): Added comment to user story confirming successful completion of QA.
+2. [ ] QA (@____): Added comment to user story confirming successful completion of QA.
diff --git a/.github/ISSUE_TEMPLATE/sub-task.md b/.github/ISSUE_TEMPLATE/sub-task.md
new file mode 100644
index 000000000..18b969f48
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/sub-task.md
@@ -0,0 +1,23 @@
+---
+name: 🧩 Sub-task
+about: "Specify a sub-task. (Avoid comments. Use only as prescribed.)"
+title: ''
+labels: '~sub-task'
+assignees: ''
+
+---
+
+## Related user story
+
+TODO
+
+
+## Task
+
+TODO
+
+
+## Condition of satisfaction
+
+TODO
+
diff --git a/.github/ISSUE_TEMPLATE/timebox.md b/.github/ISSUE_TEMPLATE/timebox.md
new file mode 100644
index 000000000..ea2704254
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/timebox.md
@@ -0,0 +1,22 @@
+---
+name: ⏳ Timebox
+about: Specify an effort that will be completed within a pre-defined amount of time.
+title: ''
+labels: 'timebox'
+assignees: ''
+
+---
+
+## Related user story
+
+TODO
+
+## Task
+
+TODO
+
+
+## Condition of satisfaction
+
+TODO
+
diff --git a/.github/ISSUE_TEMPLATE/unestimated-sub-task.md b/.github/ISSUE_TEMPLATE/unestimated-sub-task.md
deleted file mode 100644
index 45c9e4fc2..000000000
--- a/.github/ISSUE_TEMPLATE/unestimated-sub-task.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-name: 🧩 Unestimated sub-task
-about: "Specify an unestimated sub-task. (Avoid comments. Use only as prescribed.)"
-title: ''
-labels: '~sub-task'
-assignees: ''
-
----
-
-## Related user story
-
-TODO
-
-
-## Task
-
-TODO
-
-
-## Condition of satisfaction
-
-TODO
-
-
diff --git a/.github/ISSUE_TEMPLATE/website-request.md b/.github/ISSUE_TEMPLATE/website-request.md
index 4321a3973..bb6e5ea7d 100644
--- a/.github/ISSUE_TEMPLATE/website-request.md
+++ b/.github/ISSUE_TEMPLATE/website-request.md
@@ -1,19 +1,19 @@
---
-name: 🕸️ Website request
+name: 🌐 Website request
about: Propose a new feature or enhancement to fleetdm.com.
title: 'Request: __________________________'
-labels: '#g-website'
+labels: '#g-digital-experience'
assignees: ''
---
-> **This request is expected to be doable in ≤1 sprint. It would be valuable even if nothing else ships.**
+> **This request is expected to be doable in ≤1 sprint. It would be valuable even if nothing else ships.**
>
> It will be reviewed by the acting PM for the #g-website product group, and then hopefully [prioritized, drafted, and implemented](https://fleetdm.com/handbook/company/development-groups#making-changes).
## Goal
-
+
| User story |
|:---------------------------------------------------------------------------|
@@ -21,17 +21,17 @@ assignees: ''
| I want to _________________________________________
| so that I can _________________________________________.
+>For help creating a user story, see ["Writing a good user story"](https://fleetdm.com/handbook/company/development-groups#writing-a-good-user-story) in the website handbook.
+
## Changes
-This issue's estimation includes completing:
+This issue's estimation includes completing the following:
- [ ] UI changes: TODO
- [ ] QA complete?
## QA
-
+>The testing steps outlined below must be verified before the associated PR is merged. See ["Quality"](https://fleetdm.com/handbook/marketing/website-handbook#quality) in the website handbook for help.
### Manual testing steps
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 67d3c77a8..217ab2c19 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,5 +1,94 @@
+# Basic set up for Actions and Docker. Security updates enabled via GitHub settings for other ecosystems.
+
version: 2
-# updates intentionally left empty, as we were seeing too much volume of PRs, and breakages
-# introduced by dependency version updates. Dependabot will continue to open security-related PRs,
-# but non-security dependency updates must be done manually.
-updates: []
+updates:
+
+# Maintain dependencies for GitHub Actions
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ # Disable version updates for github-actions dependencies
+ open-pull-requests-limit: 0
+ pull-request-branch-name:
+ # Default is "/" which makes "docker tag" fail with
+ # "not a valid repository/tag: invalid reference format".
+ separator: "-"
+ # Add assignees
+ assignees:
+ - "lukeheath"
+
+# Maintain dependencies for Dockerfiles
+ - package-ecosystem: "docker"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ # Disable version updates for docker dependencies
+ open-pull-requests-limit: 0
+ reviewers:
+ - "fleetdm/go"
+ - "fleetdm/infra"
+ pull-request-branch-name:
+ # Default is "/" which makes "docker tag" fail with
+ # "not a valid repository/tag: invalid reference format".
+ separator: "-"
+ # Add assignees
+ assignees:
+ - "fleetdm/go"
+ - "fleetdm/infra"
+
+# Maintain dependencies for website NPM
+ - package-ecosystem: "npm"
+ directory: "/website"
+ labels:
+ - "website"
+ schedule:
+ interval: "daily"
+ # Disable version updates
+ open-pull-requests-limit: 0
+ allow:
+ - dependency-type: "production"
+ reviewers:
+ - "eashaw"
+ pull-request-branch-name:
+ # Default is "/" which makes "docker tag" fail with
+ # "not a valid repository/tag: invalid reference format".
+ separator: "-"
+ assignees:
+ - "eashaw"
+
+# Maintain dependencies for Go
+ - package-ecosystem: "gomod"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ # Disable version updates
+ open-pull-requests-limit: 0
+ reviewers:
+ - lucasmrod
+ pull-request-branch-name:
+ # Default is "/" which makes "docker tag" fail with
+ # "not a valid repository/tag: invalid reference format".
+ separator: "-"
+ # Add assignees
+ assignees:
+ - lucasmrod
+
+# Maintain dependencies for npm
+ - package-ecosystem: "npm"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ # Disable version updates
+ open-pull-requests-limit: 0
+ reviewers:
+ - lukeheath
+ allow:
+ - dependency-type: "production"
+ pull-request-branch-name:
+ # Default is "/" which makes "docker tag" fail with
+ # "not a valid repository/tag: invalid reference format".
+ separator: "-"
+ # Add assignees
+ assignees:
+ - lukeheath
\ No newline at end of file
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index d73608b74..feb3159ed 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -2,13 +2,17 @@
If some of the following don't apply, delete the relevant line.
+
+
- [ ] Changes file added for user-visible changes in `changes/` or `orbit/changes/`.
See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information.
-- [ ] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md)
-- [ ] Documented any permissions changes
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.
- [ ] Added/updated tests
+- [ ] If database migrations are included, checked table schema to confirm autoupdate
+- For database migrations:
+ - [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration.
+ - [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects.
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux.
diff --git a/.github/workflows/build-and-push-fleetctl-docker.yml b/.github/workflows/build-and-push-fleetctl-docker.yml
index cb037782d..8ae3c7069 100644
--- a/.github/workflows/build-and-push-fleetctl-docker.yml
+++ b/.github/workflows/build-and-push-fleetctl-docker.yml
@@ -29,8 +29,13 @@ jobs:
permissions:
contents: write
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
@@ -39,9 +44,9 @@ jobs:
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
- go-version: 1.19.10
+ go-version: ${{ vars.GO_VERSION }}
- name: Install Go Dependencies
run: make deps-go
diff --git a/.github/workflows/build-binaries.yaml b/.github/workflows/build-binaries.yaml
index 04a4bb2ac..ed18437c7 100644
--- a/.github/workflows/build-binaries.yaml
+++ b/.github/workflows/build-binaries.yaml
@@ -3,7 +3,7 @@ name: Build binaries
on:
push:
branches:
- - main
+ - main
pull_request:
workflow_dispatch:
@@ -24,61 +24,72 @@ jobs:
build-binaries:
runs-on: ubuntu-latest
steps:
- - name: Install Go
- uses: actions/setup-go@v2.1.3
- with:
- go-version: 1.19.10
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
- - name: JS Dependency Cache
- id: js-cache
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
- with:
- path: |
- **/node_modules
- # Use a separate cache for this from other JS jobs since we run the
- # webpack steps and will have more to cache.
- key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-node_modules-
+ # Set the Node.js version
+ - name: Set up Node.js ${{ vars.NODE_VERSION }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ vars.NODE_VERSION }}
- - name: Go Cache
- id: go-cache
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
- with:
- # In order:
- # * Module download cache
- # * Build cache (Linux)
- # * Build cache (Mac)
- # * Build cache (Windows)
- path: |
- ~/go/pkg/mod
- ~/.cache/go-build
- ~/Library/Caches/go-build
- %LocalAppData%\go-build
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- restore-keys: |
- ${{ runner.os }}-go-
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- - name: Install JS Dependencies
- if: steps.js-cache.outputs.cache-hit != 'true'
- run: make deps-js
+ - name: JS Dependency Cache
+ id: js-cache
+ uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
+ with:
+ path: |
+ **/node_modules
+ # Use a separate cache for this from other JS jobs since we run the
+ # webpack steps and will have more to cache.
+ key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-node_version-${{ vars.NODE_VERSION }}
+ restore-keys: |
+ ${{ runner.os }}-node_modules-
- - name: Install Go Dependencies
- if: steps.go-cache.outputs.cache-hit != 'true'
- run: make deps-go
+ - name: Go Cache
+ id: go-cache
+ uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
+ with:
+ # In order:
+ # * Module download cache
+ # * Build cache (Linux)
+ # * Build cache (Mac)
+ # * Build cache (Windows)
+ path: |
+ ~/go/pkg/mod
+ ~/.cache/go-build
+ ~/Library/Caches/go-build
+ %LocalAppData%\go-build
+ key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
+ restore-keys: |
+ ${{ runner.os }}-go-
- - name: Generate static files
- run: |
- export PATH=$PATH:~/go/bin
- make generate
+ - name: Install JS Dependencies
+ if: steps.js-cache.outputs.cache-hit != 'true'
+ run: make deps-js
- - name: Build binaries
- run: make
+ - name: Install Go Dependencies
+ if: steps.go-cache.outputs.cache-hit != 'true'
+ run: make deps-go
- - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: build
- path: build/
+ - name: Generate static files
+ run: |
+ export PATH=$PATH:~/go/bin
+ make generate
+
+ - name: Build binaries
+ run: make
+
+ - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: build
+ path: build/
diff --git a/.github/workflows/build-orbit.yaml b/.github/workflows/build-orbit.yaml
index ddac75ec8..09f296aec 100644
--- a/.github/workflows/build-orbit.yaml
+++ b/.github/workflows/build-orbit.yaml
@@ -1,9 +1,20 @@
-name: Build, Sign and Notarize Orbit
+name: Build, Sign and Notarize Orbit for macOS
on:
+ workflow_dispatch: # allow manual action
+ push:
+ paths:
+ # The workflow can be triggered by modifying ORBIT_VERSION env.
+ - '.github/workflows/build-orbit.yaml'
pull_request:
paths:
- 'orbit/**.go'
+ # The workflow can be triggered by modifying ORBIT_VERSION env.
+ - '.github/workflows/build-orbit.yaml'
+
+env:
+ ORBIT_VERSION: 1.20.0
+ CGO_ENABLED: 1
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
@@ -22,8 +33,13 @@ jobs:
build:
runs-on: macos-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Import signing keys
env:
@@ -41,9 +57,9 @@ jobs:
rm certificate.p12
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
- go-version: 1.19.10
+ go-version: ${{ vars.GO_VERSION }}
- name: Build, codesign and notarize orbit
run: go run ./orbit/tools/build/build.go
@@ -53,6 +69,8 @@ jobs:
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
AC_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CODESIGN_IDENTITY: 51049B247B25B3119FAE7E9C0CC4375A43E47237
+ ORBIT_VERSION: ${{ env.ORBIT_VERSION }}
+ ORBIT_COMMIT: ${{ github.sha }}
- name: Upload orbit
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
diff --git a/.github/workflows/check-tuf-timestamps.yml b/.github/workflows/check-tuf-timestamps.yml
new file mode 100644
index 000000000..c55de6e2b
--- /dev/null
+++ b/.github/workflows/check-tuf-timestamps.yml
@@ -0,0 +1,70 @@
+name: Check TUF timestamps
+
+on:
+ pull_request:
+ paths:
+ - '.github/workflows/check-tuf-timestamps.yml'
+ workflow_dispatch: # Manual
+ schedule:
+ - cron: '0 10 * * *'
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ test-go:
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Check remote timestamp.json file
+ run: |
+ expires=$(curl -s http://tuf.fleetctl.com/timestamp.json | jq -r '.signed.expires' | cut -c 1-10)
+ today=$(date "+%Y-%m-%d")
+ warning_at=$(date -d "$today + 2 day" "+%Y-%m-%d")
+ expires_sec=$(date -d "$expires" "+%s")
+ warning_at_sec=$(date -d "$warning_at" "+%s")
+
+ if [ "$expires_sec" -le "$warning_at_sec" ]; then
+ exit 1
+ else
+ exit 0
+ fi
+
+ - name: Slack Notification
+ if: failure()
+ uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
+ with:
+ payload: |
+ {
+ "text": "${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}",
+ "blocks": [
+ {
+ "type": "section",
+ "text": {
+ "type": "mrkdwn",
+ "text": "⚠️ TUF timestamp.json is about to expire or has already expired\nhttps://github.com/fleetdm/fleet/actions/runs/${{ github.run_id }}"
+ }
+ }
+ ]
+ }
+ env:
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_G_HELP_ENGINEERING_WEBHOOK_URL }}
+ SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index e64c8f824..246c6418a 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -45,15 +45,25 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout repository
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ - name: Set up Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@32dc499307d133bb5085bae78498c0ac2cf762d5
+ uses: github/codeql-action/init@f6e388ebf0efc915c6c5b165b019ee61a6746a38
with:
languages: ${{ matrix.language }}
config-file: .github/workflows/config/codeql.yml
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5
+ uses: github/codeql-action/analyze@f6e388ebf0efc915c6c5b165b019ee61a6746a38
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
new file mode 100644
index 000000000..3f3456223
--- /dev/null
+++ b/.github/workflows/dependency-review.yml
@@ -0,0 +1,27 @@
+# Dependency Review Action
+#
+# This Action will scan dependency manifest files that change as part of a Pull Request,
+# surfacing known-vulnerable versions of the packages declared or updated in the PR.
+# Once installed, if the workflow run is marked as required,
+# PRs introducing known-vulnerable packages will be blocked from merging.
+#
+# Source repository: https://github.com/actions/dependency-review-action
+name: 'Dependency Review'
+on: [pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ dependency-review:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: 'Checkout Repository'
+ uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
+ - name: 'Dependency Review'
+ uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1
diff --git a/.github/workflows/deploy-fleet-website.yml b/.github/workflows/deploy-fleet-website.yml
index ee8094923..9fc044e13 100644
--- a/.github/workflows/deploy-fleet-website.yml
+++ b/.github/workflows/deploy-fleet-website.yml
@@ -31,10 +31,15 @@ jobs:
strategy:
matrix:
- node-version: [14.x]
+ node-version: [16.x]
steps:
- - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Configure our access credentials for the Heroku CLI
- uses: akhileshns/heroku-deploy@79ef2ae4ff9b897010907016b268fd0f88561820 # v3.6.8
@@ -45,18 +50,24 @@ jobs:
justlogin: true
- run: heroku auth:whoami
+ # Install the heroku-repo plugin in the Heroku CLI
+ - run: heroku plugins:install heroku-repo
+
# Set the Node.js version
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
# Install the right version of Go for the Golang child process that we are currently using for CSR signing
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
- go-version: 1.19
+ go-version: ${{ vars.GO_VERSION }}
+
+ # Download top-level dependencies and build Storybook in the website's assets/ folder
+ - run: npm install --legacy-peer-deps && npm run build-storybook -- -o ./website/assets/storybook --loglevel verbose
# Now start building!
# > …but first, get a little crazy for a sec and delete the top-level package.json file
@@ -81,11 +92,14 @@ jobs:
- run: cd website/ && npm test
# Compile browser assets & markdown content into generated collateral
- - run: cd website/ && BUILD_SCRIPT_ARGS="--githubAccessToken=${{ secrets.FLEET_RELEASE_GITHUB_PAT }}" npm run build-for-prod
+ - run: cd website/ && BUILD_SCRIPT_ARGS="--githubAccessToken=${{ secrets.FLEET_GITHUB_TOKEN_FOR_WEBSITE_TEST }}" npm run build-for-prod
# Build the go binary we use to sign APNS certificates in the website/.tools/ folder.
- run: cd ee/tools/mdm/ && GOOS=linux GOARCH=amd64 go build -o ../../../website/.tools/mdm-gen-cert .
+ # Reset the Heroku app's git repo to prevent errors when pushing to the repo. (See https://github.com/fleetdm/fleet/issues/14162 for more details)
+ - run: heroku repo:reset -a production-fleetdm-website
+
# Commit newly-generated collateral locally so we can push them to Heroku below.
# (This commit will never be pushed to GitHub- only to Heroku.)
# > The local config flags make this work in GitHub's environment.
diff --git a/.github/workflows/deploy-vulnerability-dashboard.yml b/.github/workflows/deploy-vulnerability-dashboard.yml
new file mode 100644
index 000000000..5030c2eb1
--- /dev/null
+++ b/.github/workflows/deploy-vulnerability-dashboard.yml
@@ -0,0 +1,89 @@
+name: Deploy app to vulnerability dashboard pipeline on Heroku.
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'ee/vulnerability-dashboard/**'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ permissions:
+ contents: write # for Git to git push
+ if: ${{ github.repository == 'fleetdm/fleet' }}
+
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [14.x]
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ # Configure our access credentials for the Heroku CLI
+ - uses: akhileshns/heroku-deploy@79ef2ae4ff9b897010907016b268fd0f88561820 # v3.6.8
+ with:
+ heroku_api_key: ${{secrets.HEROKU_API_TOKEN_FOR_BOT_USER}}
+ heroku_app_name: "" # this has to be blank or it doesn't work
+ heroku_email: ${{secrets.HEROKU_EMAIL_FOR_BOT_USER}}
+ justlogin: true
+ - run: heroku auth:whoami
+
+ # Set the Node.js version
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ # Now start building!
+ # > …but first, get a little crazy for a sec and delete the top-level package.json file
+ # > i.e. the one used by the Fleet server. This is because require() in node will go
+ # > hunting in ancestral directories for missing dependencies, and since some of the
+ # > bundled transpiler tasks sniff for package availability using require(), this trips
+ # > up when it encounters another Node universe in the parent directory.
+ - run: rm -rf package.json package-lock.json node_modules/
+ # > Turns out there's a similar issue with how eslint plugins are looked up, so we
+ # > delete the top level .eslintrc file too.
+ - run: rm -f .eslintrc.js
+ # > And, as a change to the top-level fleetdm/fleet .gitignore on May 2, 2022 revealed,
+ # > we also need to delete the top level .gitignore file too, so that its rules don't
+ # > interfere with the committing and force-pushing we're doing as part of our deploy
+ # > script here. For more info, see: https://github.com/fleetdm/fleet/pull/5549
+ - run: rm -f .gitignore
+
+ # Get dependencies (including dev deps)
+ - run: cd ee/vulnerability-dashboard/ && npm install
+
+ # Run sanity checks
+ - run: cd ee/vulnerability-dashboard/ && npm test
+
+ # Compile assets
+ - run: cd ee/vulnerability-dashboard/ && npm run build-for-prod
+
+ # Commit newly-built assets locally so we can push them to Heroku below.
+ # (This commit will never be pushed to GitHub- only to Heroku.)
+ # > The local config flags make this work in GitHub's environment.
+ - run: git add ee/vulnerability-dashboard/.www
+ - run: git -c "user.name=GitHub" -c "user.email=github@example.com" commit -am 'AUTOMATED COMMIT - Deployed the latest, including modified HTML layouts and .sailsrc file that reference minified assets.'
+
+ # Configure the Heroku app we'll be deploying to
+ - run: heroku git:remote -a vulnerability-dashboard
+ - run: git remote -v
+
+ # Deploy to Heroku (by pushing)
+ # > Since a shallow clone was grabbed, we have to "unshallow" it before forcepushing.
+ - run: echo "Unshallowing local repository…"
+ - run: git fetch --prune --unshallow
+ - run: echo "Deploying branch '${GITHUB_REF##*/}' to Heroku…"
+ - run: git push heroku +${GITHUB_REF##*/}:master
+ - name: 🌐 The dashboard has been deployed
+ run: echo '' && echo '--' && echo 'OK, done. It should be live momentarily.' && echo '(if you get impatient, check the Heroku dashboard for status)'
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index c135a652d..ec0df78a4 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -28,8 +28,13 @@ jobs:
contents: read # to read files to check dead links
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # master
- - uses: gaurav-nelson/github-action-markdown-link-check@58f84fd654812d0d8da4e4d4a559eda087daf8ce # v1.0.13
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+ - uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # v1.0.15
with:
use-quiet-mode: 'yes'
config-file: .github/workflows/config/markdown-link-check-config.json
diff --git a/.github/workflows/dogfood-deploy.yml b/.github/workflows/dogfood-deploy.yml
index 47a7433cd..d13d2f476 100644
--- a/.github/workflows/dogfood-deploy.yml
+++ b/.github/workflows/dogfood-deploy.yml
@@ -30,6 +30,7 @@ env:
TF_VAR_fleet_sentry_dsn: ${{ secrets.DOGFOOD_SENTRY_DSN }}
TF_VAR_elastic_url: ${{ secrets.ELASTIC_APM_SERVER_URL }}
TF_VAR_elastic_token: ${{ secrets.ELASTIC_APM_SECRET_TOKEN }}
+ TF_VAR_geolite2_license: ${{ secrets.MAXMIND_LICENSE }}
permissions:
id-token: write
@@ -40,6 +41,11 @@ jobs:
name: Deploy Fleet Dogfood Environment
runs-on: ubuntu-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- id: fail-on-main
run: "false"
@@ -48,9 +54,13 @@ jobs:
with:
role-to-assume: ${{env.AWS_IAM_ROLE}}
aws-region: ${{ env.AWS_REGION }}
+ - name: Set up Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
- terraform_version: 1.3.8
+ terraform_version: 1.6.3
terraform_wrapper: false
- name: Terraform Init
id: init
diff --git a/.github/workflows/dogfood-gitops.yml b/.github/workflows/dogfood-gitops.yml
new file mode 100644
index 000000000..43761a5fb
--- /dev/null
+++ b/.github/workflows/dogfood-gitops.yml
@@ -0,0 +1,66 @@
+name: 'Apply latest configuration to dogfood with gitops'
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - 'it-and-security/**'
+ - '.github/workflows/dogfood-gitops.yml'
+ workflow_dispatch: # allows manual triggering
+
+defaults:
+ run:
+ shell: bash
+
+# Limit permissions of GITHUB_TOKEN.
+permissions:
+ contents: read
+
+jobs:
+ fleet-gitops:
+ timeout-minutes: 10
+ runs-on: ubuntu-latest
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout our repository
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: Checkout GitOps repository
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ repository: fleetdm/fleet-gitops
+ ref: main
+ path: fleet-gitops
+
+ - name: Apply env vars to profiles
+ env:
+ MANAGED_CHROME_ENROLLMENT_TOKEN: ${{ secrets.CLOUD_MANAGEMENT_ENROLLMENT_TOKEN }}
+ run: |
+ envsubst < ./it-and-security/lib/configuration-profiles/macos-chrome-enrollment.mobileconfig > ./it-and-security/lib/configuration-profiles/macos-chrome-enrollment.confidential.mobileconfig
+ mv ./it-and-security/lib/configuration-profiles/macos-chrome-enrollment.confidential.mobileconfig ./it-and-security/lib/configuration-profiles/macos-chrome-enrollment.mobileconfig
+
+ - name: Apply latest configuration to Fleet
+ uses: ./fleet-gitops/.github/gitops-action
+ with:
+ working-directory: ${{ github.workspace }}/fleet-gitops
+ env:
+ FLEET_GITOPS_DIR: ${{ github.workspace }}/it-and-security
+ FLEET_URL: https://dogfood.fleetdm.com
+ FLEET_API_TOKEN: ${{ secrets.DOGFOOD_API_TOKEN }}
+ DOGFOOD_APPLE_BM_DEFAULT_TEAM: "💻Workstations"
+ DOGFOOD_MACOS_MIGRATION_WEBHOOK_URL: ${{ secrets.DOGFOOD_MACOS_MIGRATION_WEBHOOK_URL }}
+ DOGFOOD_GLOBAL_ENROLL_SECRET: ${{ secrets.DOGFOOD_GLOBAL_ENROLL_SECRET }}
+ DOGFOOD_SSO_ISSUER_URI: ${{ secrets.DOGFOOD_SSO_ISSUER_URI }}
+ DOGFOOD_SSO_METADATA: ${{ secrets.DOGFOOD_SSO_METADATA }}
+ DOGFOOD_FAILING_POLICIES_WEBHOOK_URL: ${{ secrets.DOGFOOD_FAILING_POLICIES_WEBHOOK_URL }}
+ DOGFOOD_VULNERABILITIES_WEBHOOK_URL: ${{ secrets.DOGFOOD_VULNERABILITIES_WEBHOOK_URL }}
+ DOGFOOD_WORKSTATIONS_ENROLL_SECRET: ${{ secrets.DOGFOOD_WORKSTATIONS_ENROLL_SECRET }}
+ DOGFOOD_WORKSTATIONS_CANARY_ENROLL_SECRET: ${{ secrets.DOGFOOD_WORKSTATIONS_CANARY_ENROLL_SECRET }}
+ DOGFOOD_SERVERS_ENROLL_SECRET: ${{ secrets.DOGFOOD_SERVERS_ENROLL_SECRET }}
+ DOGFOOD_SERVERS_CANARY_ENROLL_SECRET: ${{ secrets.DOGFOOD_SERVERS_CANARY_ENROLL_SECRET }}
+ DOGFOOD_EXPLORE_DATA_ENROLL_SECRET: ${{ secrets.DOGFOOD_EXPLORE_DATA_ENROLL_SECRET }}
diff --git a/.github/workflows/example-workflow.yaml b/.github/workflows/example-workflow.yaml
deleted file mode 100644
index 75ca7e296..000000000
--- a/.github/workflows/example-workflow.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-# This workflow applies the latest configuration profiles (macOS settings) and macOS updates minimum version and deadline to the provided team.
-name: Apply latest configuration profiles (example)
-on:
- push:
- branches:
- - main
- paths:
- - "path/to/**.mobileconfig"
- workflow_dispatch: # Manual
-
-# This allows a subsequently queued workflow run to interrupt previous runs
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
- cancel-in-progress: true
-
-defaults:
- run:
- # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
- shell: bash
-
-permissions:
- contents: read
-
-env:
- FLEET_API_TOKEN: ${{ secrets.DOGFOOD_API_TOKEN }}
- FLEET_URL: ${{ secrets.DOGFOOD_URL }}
- TOKEN_USED_BY_PROFILE: ${{ secrets.TOKEN_USED_BY_PROFILE }}
-
-jobs:
- apply-profiles:
- timeout-minutes: 5
- runs-on: ubuntu-latest
- steps:
- - name: Apply configuration profiles and updates
- uses: fleetdm/fleet-mdm-gitops@026ee84a69cb89c869fedbe27c969bf89def418b
- with:
- FLEET_API_TOKEN: $FLEET_API_TOKEN
- FLEET_URL: $FLEET_URL
- FLEET_TEAM_NAME: 💻🐣 Workstations (canary)
- MDM_CONFIG_REPO: fleetdm/fleet
- MDM_CONFIG_DIRECTORY: mdm_profiles
- MAC_OS_MIN_VERSION: 13.3.2
- MAC_OS_VERSION_DEADLINE: 2023-06-15
- MAC_OS_ENABLE_DISK_ENCRYPTION: true
diff --git a/.github/workflows/fleet-and-orbit.yml b/.github/workflows/fleet-and-orbit.yml
index 57d60ad47..2849c0f56 100644
--- a/.github/workflows/fleet-and-orbit.yml
+++ b/.github/workflows/fleet-and-orbit.yml
@@ -9,13 +9,14 @@ on:
branches:
- main
- patch-*
+ - prepare-*
paths:
- - 'orbit/**.go'
- - '.github/workflows/fleet-and-orbit.yml'
+ - "orbit/**.go"
+ - ".github/workflows/fleet-and-orbit.yml"
pull_request:
paths:
- - 'orbit/**.go'
- - '.github/workflows/fleet-and-orbit.yml'
+ - "orbit/**.go"
+ - ".github/workflows/fleet-and-orbit.yml"
workflow_dispatch: # Manual
# This allows a subsequently queued workflow run to interrupt previous runs
@@ -29,7 +30,7 @@ defaults:
shell: bash
env:
- OSQUERY_VERSION: 5.5.1
+ OSQUERY_VERSION: 5.9.1
permissions:
contents: read
@@ -43,100 +44,131 @@ jobs:
address: ${{ steps.gen.outputs.address }}
enroll_secret: ${{ steps.gen.outputs.enroll_secret }}
steps:
- - id: gen
- run: |
- UUID=$(uuidgen)
- echo "subdomain=fleet-test-$UUID" >> $GITHUB_OUTPUT
- echo "domain=fleet-test-$UUID.fleetuem.com" >> $GITHUB_OUTPUT
- echo "address=https://fleet-test-$UUID.fleetuem.com" >> $GITHUB_OUTPUT
- ENROLL=$(uuidgen)
- echo "enroll_secret=$ENROLL" >> $GITHUB_OUTPUT
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - id: gen
+ run: |
+ UUID=$(uuidgen)
+ echo "subdomain=fleet-test-$UUID" >> $GITHUB_OUTPUT
+ echo "domain=fleet-test-$UUID.fleetuem.com" >> $GITHUB_OUTPUT
+ echo "address=https://fleet-test-$UUID.fleetuem.com" >> $GITHUB_OUTPUT
+ ENROLL=$(uuidgen)
+ echo "enroll_secret=$ENROLL" >> $GITHUB_OUTPUT
run-server:
timeout-minutes: 60
strategy:
matrix:
- go-version: ['^1.19.10']
- mysql: ['mysql:5.7']
+ go-version: ["${{ vars.GO_VERSION }}"]
+ mysql: ["mysql:5.7"]
runs-on: ubuntu-latest
needs: gen
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Install Go
- uses: actions/setup-go@v2.1.3
- with:
- go-version: ${{ matrix.go-version }}
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ matrix.go-version }}
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ # Set the Node.js version
+ - name: Set up Node.js ${{ vars.NODE_VERSION }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ vars.NODE_VERSION }}
- - name: Start tunnel
- env:
- CERT_PEM: ${{ secrets.CLOUDFLARE_TUNNEL_FLEETUEM_CERT_B64 }}
- run: |
- # Install cloudflared
- wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
- sudo dpkg -i cloudflared-linux-amd64.deb
- # Add secret
- echo "$CERT_PEM" | base64 -d > cert.pem
- # Start tunnel
- cloudflared tunnel --origincert cert.pem --hostname ${{ needs.gen.outputs.subdomain }} --url http://localhost:1337 --name ${{ needs.gen.outputs.subdomain }} &
- until [[ $(cloudflared tunnel --origincert cert.pem info -o json ${{ needs.gen.outputs.subdomain }} | jq '.conns[0].conns[0].is_pending_reconnect') = false ]]; do
- echo "Awaiting tunnel ready..."
- sleep 5
- done
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- - name: Start Infra Dependencies
- run: FLEET_MYSQL_IMAGE=${{ matrix.mysql }} docker-compose up -d mysql redis &
+ - name: Start tunnel
+ env:
+ CERT_PEM: ${{ secrets.CLOUDFLARE_TUNNEL_FLEETUEM_CERT_B64 }}
+ run: |
+ #!/bin/bash
+ # Increase maximum receive buffer size to roughly 2.5 MB.
+ # Cloudflared uses quic-go. This buffer holds packets that have been received by the kernel,
+ # but not yet read by the application (quic-go in this case). Once this buffer fills up, the
+ # kernel will drop any new incoming packet.
+ # See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size.
+ sudo sysctl -w net.core.rmem_max=2500000
- - name: Install JS Dependencies
- run: make deps-js
+ # Install cloudflared
+ wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
+ sudo dpkg -i cloudflared-linux-amd64.deb
+ # Add secret
+ echo "$CERT_PEM" | base64 -d > cert.pem
+ # Start tunnel
+ cloudflared tunnel --origincert cert.pem --hostname ${{ needs.gen.outputs.subdomain }} --url http://localhost:1337 --name ${{ needs.gen.outputs.subdomain }} --logfile cloudflared.log &
+ until [[ $(cloudflared tunnel --origincert cert.pem info -o json ${{ needs.gen.outputs.subdomain }} | jq '.conns[0].conns[0].is_pending_reconnect') = false ]]; do
+ echo "Awaiting tunnel ready..."
+ sleep 5
+ done
- - name: Generate and bundle go & js code
- run: make generate
+ - name: Start Infra Dependencies
+ run: FLEET_MYSQL_IMAGE=${{ matrix.mysql }} docker-compose up -d mysql redis &
- - name: Build fleet and fleetctl
- # fleet-dev builds fleet with "race" enabled.
- run: make fleet-dev fleetctl
+ - name: Install JS Dependencies
+ run: make deps-js
- - name: Run Fleet server
- env:
- FLEET_OSQUERY_HOST_IDENTIFIER: instance # use instance identifier to allow for duplicate UUIDs
- FLEET_SERVER_ADDRESS: 0.0.0.0:1337
- FLEET_SERVER_TLS: false
- FLEET_LOGGING_DEBUG: true
- run: |
- mkdir ./fleet_log
- make db-reset
- ./build/fleet serve --dev --dev_license 1>./fleet_log/stdout.log 2>./fleet_log/stderr.log &
- ./build/fleetctl config set --address http://localhost:1337 --tls-skip-verify
- until ./build/fleetctl setup --email admin@example.com --name Admin --password preview1337# --org-name Example
- do
- echo "Retrying setup in 5s..."
- sleep 5
- done
- # Wait for all of the hosts to be enrolled
- EXPECTED=3
- until [ $(./build/fleetctl get hosts --json | grep "hostname" | wc -l | tee hostcount) -ge $EXPECTED ]; do
- echo -n "Waiting for hosts to enroll: "
- cat hostcount | xargs echo -n
- echo " / $EXPECTED"
- sleep 30
- done
- ./build/fleetctl get hosts
- echo "Success! $EXPECTED hosts enrolled."
+ - name: Generate and bundle go & js code
+ run: make generate
- - name: Cleanup tunnel
- if: always()
- run: cloudflared tunnel --origincert cert.pem delete --force ${{ needs.gen.outputs.subdomain }}
+ - name: Build fleet and fleetctl
+ # fleet-dev builds fleet with "race" enabled.
+ run: make fleet-dev fleetctl
- - name: Upload fleet logs
- if: always()
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: fleet-logs
- path: |
- fleet_log
+ - name: Run Fleet server
+ env:
+ FLEET_OSQUERY_HOST_IDENTIFIER: instance # use instance identifier to allow for duplicate UUIDs
+ FLEET_SERVER_ADDRESS: 0.0.0.0:1337
+ FLEET_SERVER_TLS: false
+ FLEET_LOGGING_DEBUG: true
+ run: |
+ mkdir ./fleet_log
+ make db-reset
+ ./build/fleet serve --dev --dev_license 1>./fleet_log/stdout.log 2>./fleet_log/stderr.log &
+ ./build/fleetctl config set --address http://localhost:1337 --tls-skip-verify
+ until ./build/fleetctl setup --email admin@example.com --name Admin --password preview1337# --org-name Example
+ do
+ echo "Retrying setup in 5s..."
+ sleep 5
+ done
+ # Wait for all of the hosts to be enrolled
+ EXPECTED=3
+ until [ $(./build/fleetctl get hosts --json | grep "hostname" | wc -l | tee hostcount) -ge $EXPECTED ]; do
+ echo -n "Waiting for hosts to enroll: "
+ cat hostcount | xargs echo -n
+ echo " / $EXPECTED"
+ sleep 30
+ done
+ ./build/fleetctl get hosts
+ ./build/fleetctl get hosts --json
+ echo "Success! $EXPECTED hosts enrolled."
+
+ - name: Cleanup tunnel
+ if: always()
+ run: cloudflared tunnel --origincert cert.pem delete --force ${{ needs.gen.outputs.subdomain }}
+
+ - name: Upload fleet logs
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: fleet-logs
+ path: |
+ fleet_log
+
+ - name: Upload cloudflared logs
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: cloudflared.log
+ path: cloudflared.log
# Sets the enroll secret of the Fleet server.
#
@@ -145,71 +177,83 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
- go-version: ['^1.19.10']
+ go-version: ["${{ vars.GO_VERSION }}"]
runs-on: ubuntu-latest
needs: gen
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Install Go
- uses: actions/setup-go@v2.1.3
- with:
- go-version: ${{ matrix.go-version }}
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ matrix.go-version }}
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- - name: Build Fleetctl
- run: make fleetctl
-
- - id: enroll
- name: Set enroll secret
- run: |
- ./build/fleetctl config set --address ${{ needs.gen.outputs.address }}
- until ./build/fleetctl login --email admin@example.com --password preview1337#
- do
- echo "Retrying in 30s..."
- sleep 30
- done
- echo '---
- apiVersion: v1
- kind: enroll_secret
- spec:
- secrets:
- - secret: ${{ needs.gen.outputs.enroll_secret }}
- ' > secrets.yml
- ./build/fleetctl apply -f secrets.yml
+ - name: Build Fleetctl
+ run: make fleetctl
+ - id: enroll
+ name: Set enroll secret
+ run: |
+ ./build/fleetctl config set --address ${{ needs.gen.outputs.address }}
+ until ./build/fleetctl login --email admin@example.com --password preview1337#
+ do
+ echo "Retrying in 30s..."
+ sleep 30
+ done
+ echo '---
+ apiVersion: v1
+ kind: enroll_secret
+ spec:
+ secrets:
+ - secret: ${{ needs.gen.outputs.enroll_secret }}
+ ' > secrets.yml
+ ./build/fleetctl apply -f secrets.yml
# Here we generate the Fleet Desktop and osqueryd targets for
# macOS which can only be generated from a macOS host.
build-macos-targets:
strategy:
matrix:
- go-version: ['^1.19.10']
- runs-on: macos-latest
+ go-version: ["${{ vars.GO_VERSION }}"]
+ # Set macOS version to '12' (current equivalent to macos-latest) for
+ # building the binary. This ensures compatibility with macOS version 13 and
+ # later, avoiding runtime errors on systems using macOS 13 or newer.
+ #
+ # Note: Update this version to '13' once GitHub marks macOS 13 as stable
+ # or if we revise our minimum supported macOS version.
+ runs-on: macos-12
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Install Go
- uses: actions/setup-go@v2.1.3
- with:
- go-version: ${{ matrix.go-version }}
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ matrix.go-version }}
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- - name: Build desktop.app.tar.gz and osqueryd.app.tar.gz
- run: |
- make desktop-app-tar-gz
- make osqueryd-app-tar-gz version=$OSQUERY_VERSION out-path=.
-
- - name: Upload desktop.app.tar.gz and osqueryd.app.tar.gz
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: macos-pre-built-apps
- path: |
- desktop.app.tar.gz
- osqueryd.app.tar.gz
+ - name: Build desktop.app.tar.gz and osqueryd.app.tar.gz
+ run: |
+ make desktop-app-tar-gz
+ make osqueryd-app-tar-gz version=$OSQUERY_VERSION out-path=.
+ - name: Upload desktop.app.tar.gz and osqueryd.app.tar.gz
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: macos-pre-built-apps
+ path: |
+ desktop.app.tar.gz
+ osqueryd.app.tar.gz
# TODO(lucas): Currently, to simplify the workflow we do all in one job:
# 1. Generate TUF repository (compile Orbit from source).
@@ -227,276 +271,287 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
- go-version: ['^1.19.10']
+ go-version: ["${{ vars.GO_VERSION }}"]
runs-on: ubuntu-latest
needs: [gen, build-macos-targets]
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Install Go
- uses: actions/setup-go@v2.1.3
- with:
- go-version: ${{ matrix.go-version }}
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ matrix.go-version }}
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- - name: Download macos pre-built apps
- id: download
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
- with:
- name: macos-pre-built-apps
+ - name: Download macos pre-built apps
+ id: download
+ uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
+ with:
+ name: macos-pre-built-apps
- - name: Build Repository and run TUF server
- env:
- SYSTEMS: "macos windows linux"
- PKG_FLEET_URL: ${{ needs.gen.outputs.address }}
- PKG_TUF_URL: http://localhost:8081
- DEB_FLEET_URL: ${{ needs.gen.outputs.address }}
- DEB_TUF_URL: http://localhost:8081
- RPM_FLEET_URL: ${{ needs.gen.outputs.address }}
- RPM_TUF_URL: http://localhost:8081
- MSI_FLEET_URL: ${{ needs.gen.outputs.address }}
- MSI_TUF_URL: http://localhost:8081
- ENROLL_SECRET: ${{ needs.gen.outputs.enroll_secret }}
- MACOS_USE_PREBUILT_DESKTOP_APP_TAR_GZ: 1
- MACOS_USE_PREBUILT_OSQUERYD_APP_TAR_GZ: 1
- GENERATE_PKG: 1
- GENERATE_DEB: 1
- GENERATE_RPM: 1
- GENERATE_MSI: 1
- FLEET_DESKTOP: 1
- run: |
- ./tools/tuf/test/main.sh
+ - name: Build Repository and run TUF server
+ env:
+ SYSTEMS: "macos windows linux"
+ PKG_FLEET_URL: ${{ needs.gen.outputs.address }}
+ PKG_TUF_URL: http://localhost:8081
+ DEB_FLEET_URL: ${{ needs.gen.outputs.address }}
+ DEB_TUF_URL: http://localhost:8081
+ RPM_FLEET_URL: ${{ needs.gen.outputs.address }}
+ RPM_TUF_URL: http://localhost:8081
+ MSI_FLEET_URL: ${{ needs.gen.outputs.address }}
+ MSI_TUF_URL: http://localhost:8081
+ ENROLL_SECRET: ${{ needs.gen.outputs.enroll_secret }}
+ MACOS_USE_PREBUILT_DESKTOP_APP_TAR_GZ: 1
+ MACOS_USE_PREBUILT_OSQUERYD_APP_TAR_GZ: 1
+ GENERATE_PKG: 1
+ GENERATE_DEB: 1
+ GENERATE_RPM: 1
+ GENERATE_MSI: 1
+ FLEET_DESKTOP: 1
+ run: |
+ ./tools/tuf/test/main.sh
- - name: Upload PKG installer
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: fleet-osquery.pkg
- path: |
- fleet-osquery.pkg
+ - name: Upload PKG installer
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: fleet-osquery.pkg
+ path: |
+ fleet-osquery.pkg
- - name: Upload DEB installer
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: fleet-osquery_42.0.0_amd64.deb
- path: |
- fleet-osquery_42.0.0_amd64.deb
-
- - name: Upload MSI installer
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: fleet-osquery.msi
- path: |
- fleet-osquery.msi
+ - name: Upload DEB installer
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: fleet-osquery_42.0.0_amd64.deb
+ path: |
+ fleet-osquery_42.0.0_amd64.deb
+ - name: Upload MSI installer
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: fleet-osquery.msi
+ path: |
+ fleet-osquery.msi
orbit-macos:
timeout-minutes: 60
runs-on: macos-latest
needs: [gen, run-tuf-and-gen-pkgs]
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- - name: Download pkg
- id: download
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
- with:
- name: fleet-osquery.pkg
+ - name: Download pkg
+ id: download
+ uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
+ with:
+ name: fleet-osquery.pkg
- - name: Install pkg
- run: |
- sudo hostname orbit-macos
- sudo installer -pkg ${{ steps.download.outputs.download-path }}/fleet-osquery.pkg -target /
+ - name: Install pkg
+ run: |
+ sudo hostname orbit-macos
+ sudo installer -pkg ${{ steps.download.outputs.download-path }}/fleet-osquery.pkg -target /
- - name: Wait enroll
- run: |
- # Wait until fleet server goes down.
- while curl --fail ${{ needs.gen.outputs.address }};
- do
- echo "Retrying in 10s..."
- sleep 10
- done
+ - name: Wait enroll
+ run: |
+ # Wait until fleet server goes down.
+ while curl --fail ${{ needs.gen.outputs.address }};
+ do
+ echo "Retrying in 10s..."
+ sleep 10
+ done
- - name: Run orbit shell
- run:
- sudo orbit shell -- --json "select * from osquery_info;" | jq -e 'if (.[0]) then true else false end'
+ - name: Run orbit shell
+ run: sudo orbit shell -- --json "select * from osquery_info;" | jq -e 'if (.[0]) then true else false end'
- - name: Collect orbit logs
- if: always()
- run: |
- mkdir orbit-logs
- sudo cp /var/log/orbit/* orbit-logs/
+ - name: Collect orbit logs
+ if: always()
+ run: |
+ mkdir orbit-logs
+ sudo cp /var/log/orbit/* orbit-logs/
- - name: Upload orbit logs
- if: always()
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: orbit-logs
- path: |
- orbit-logs
-
- - name: Uninstall pkg
- run: |
- ./orbit/tools/cleanup/cleanup_macos.sh
+ - name: Upload orbit logs
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: orbit-logs
+ path: |
+ orbit-logs
+ - name: Uninstall pkg
+ run: |
+ ./orbit/tools/cleanup/cleanup_macos.sh
orbit-ubuntu:
timeout-minutes: 60
runs-on: ubuntu-latest
needs: [gen, run-tuf-and-gen-pkgs]
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Download deb
- id: download
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
- with:
- name: fleet-osquery_42.0.0_amd64.deb
+ - name: Download deb
+ id: download
+ uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
+ with:
+ name: fleet-osquery_42.0.0_amd64.deb
- - name: Install deb
- run: |
- sudo hostname orbit-ubuntu
- sudo dpkg --install ${{ steps.download.outputs.download-path }}/fleet-osquery_42.0.0_amd64.deb
+ - name: Install deb
+ run: |
+ sudo hostname orbit-ubuntu
+ sudo dpkg --install ${{ steps.download.outputs.download-path }}/fleet-osquery_42.0.0_amd64.deb
- - name: Wait enroll
- run: |
- # Wait until fleet server goes down.
- while curl --fail ${{ needs.gen.outputs.address }};
- do
- echo "Retrying in 10s..."
- sleep 10
- done
+ - name: Wait enroll
+ run: |
+ # Wait until fleet server goes down.
+ while curl --fail ${{ needs.gen.outputs.address }};
+ do
+ echo "Retrying in 10s..."
+ sleep 10
+ done
- - name: Run orbit shell
- run:
- sudo orbit shell -- --json "select * from osquery_info;" | jq -e 'if (.[0]) then true else false end'
+ - name: Run orbit shell
+ run: sudo orbit shell -- --json "select * from osquery_info;" | jq -e 'if (.[0]) then true else false end'
- - name: Collect orbit logs
- if: always()
- run: |
- mkdir orbit-logs
- sudo journalctl -u orbit.service > orbit-logs/orbit_service.log
+ - name: Collect orbit logs
+ if: always()
+ run: |
+ mkdir orbit-logs
+ sudo journalctl -u orbit.service > orbit-logs/orbit_service.log
- - name: Upload orbit logs
- if: always()
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: orbit-logs
- path: |
- orbit-logs
-
- - name: Uninstall deb
- run: |
- sudo apt remove fleet-osquery -y
+ - name: Upload orbit logs
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: orbit-logs
+ path: |
+ orbit-logs
+ - name: Uninstall deb
+ run: |
+ sudo apt remove fleet-osquery -y
orbit-windows:
timeout-minutes: 60
- needs: [run-tuf-and-gen-pkgs]
+ needs: [gen, run-tuf-and-gen-pkgs]
runs-on: windows-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- - name: Download msi
- id: download
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
- with:
- name: fleet-osquery.msi
+ - name: Download msi
+ id: download
+ uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
+ with:
+ name: fleet-osquery.msi
- - name: Install msi
- shell: pwsh
- run: |
- Start-Process msiexec -ArgumentList "/i ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv log.txt" -Wait
+ - name: Install msi
+ shell: pwsh
+ run: |
+ Start-Process msiexec -ArgumentList "/i ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv log.txt" -Wait
- - name: Wait enroll
- run: |
- while curl --fail ${{ needs.gen.outputs.address }};
- do
- echo "Retrying in 10s..."
- sleep 10
- done
+ - name: Wait enroll
+ run: |
+ while curl --fail ${{ needs.gen.outputs.address }};
+ do
+ echo "Retrying in 10s..."
+ sleep 10
+ done
- - name: Run orbit shell
- shell: cmd
- run: |
- "C:\Program Files\Orbit\bin\orbit\orbit.exe" shell -- --json "select * from osquery_info;" | jq -e "if (.[0]) then true else false end"
+ - name: Run orbit shell
+ shell: cmd
+ run: |
+ "C:\Program Files\Orbit\bin\orbit\orbit.exe" shell -- --json "select * from osquery_info;" | jq -e "if (.[0]) then true else false end"
- - name: Fleet Service Tests
- shell: pwsh
- run: |
- # Tests setup
- $serviceName = "Fleet osquery"
- $orbitMaxTimeToStartAndTeardown = 15
+ - name: Fleet Service Tests
+ shell: pwsh
+ run: |
+ # Tests setup
+ $serviceName = "Fleet osquery"
+ $orbitMaxTimeToStartAndTeardown = 15
- # Test 1 - Check that the service starts without issues
- Stop-Service -Name $serviceName
- Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
- Start-Service -Name $serviceName
- Get-Service -Name $serviceName | %{ if ($_.Status -ne "Running") { throw "Fleet Service test #1 failed" } }
+ # Test 1 - Check that the service starts without issues
+ Stop-Service -Name $serviceName
+ Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
+ Start-Service -Name $serviceName
+ Get-Service -Name $serviceName | %{ if ($_.Status -ne "Running") { throw "Fleet Service test #1 failed" } }
- # Test 2 - Check that the service stops without issues
- Stop-Service -Name $serviceName
- Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
- Get-Service -Name $serviceName | %{ if ($_.Status -ne "Stopped") { throw "Fleet Service test #2 failed" } }
+ # Test 2 - Check that the service stops without issues
+ Stop-Service -Name $serviceName
+ Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
+ Get-Service -Name $serviceName | %{ if ($_.Status -ne "Stopped") { throw "Fleet Service test #2 failed" } }
- # Test 3 - Check that no orbit.exe is running after service stop (updated after graceful shutdown)
- #Start-Service -Name $serviceName
- #Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
- #Stop-Service -Name $serviceName
- #Start-Sleep -Seconds ($orbitMaxTimeToStartAndTeardown * 10) # there is an issue with osqueryd runner intertupt that needs to be tracked down
- #Get-Process | %{ if ($_.Name -eq "orbit") { throw "Fleet Service test #3 failed" } }
+ # Test 3 - Check that no orbit.exe is running after service stop (updated after graceful shutdown)
+ #Start-Service -Name $serviceName
+ #Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
+ #Stop-Service -Name $serviceName
+ #Start-Sleep -Seconds ($orbitMaxTimeToStartAndTeardown * 10) # there is an issue with osqueryd runner intertupt that needs to be tracked down
+ #Get-Process | %{ if ($_.Name -eq "orbit") { throw "Fleet Service test #3 failed" } }
- # Test 4 - Check that service starts in less than 3 secs
- #Start-Job { Start-Service -Name $args[0] } -ArgumentList $serviceName | Out-Null #async operation
- #Start-Sleep -Seconds 3
- #Get-Service -Name $serviceName | %{ if ($_.Status -ne "Running") { throw "Fleet Service test #4 failed" } }
+ # Test 4 - Check that service starts in less than 3 secs
+ #Start-Job { Start-Service -Name $args[0] } -ArgumentList $serviceName | Out-Null #async operation
+ #Start-Sleep -Seconds 3
+ #Get-Service -Name $serviceName | %{ if ($_.Status -ne "Running") { throw "Fleet Service test #4 failed" } }
- # Test 5 - Check that service stops in less than $orbitMaxTimeToStartAndTeardown secs
- #Start-Job { Stop-Service -Name $args[0] } -ArgumentList $serviceName | Out-Null #async operation
- #Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
- #Get-Service -Name $serviceName | %{ if ($_.Status -ne "Stopped") { throw "Fleet Service test #5 failed" } }
-
- # There is an sporadic issue with --insecure flag being used and osqueryd which causes long shutdown time, not testing this scenario until issue this scenario is sorted out
+ # Test 5 - Check that service stops in less than $orbitMaxTimeToStartAndTeardown secs
+ #Start-Job { Stop-Service -Name $args[0] } -ArgumentList $serviceName | Out-Null #async operation
+ #Start-Sleep -Seconds $orbitMaxTimeToStartAndTeardown
+ #Get-Service -Name $serviceName | %{ if ($_.Status -ne "Stopped") { throw "Fleet Service test #5 failed" } }
- - name: MSI Installer Tests
- shell: pwsh
- run: |
- # Tests setup
- $serviceName = "Fleet osquery"
- $registryPath = "HKLM:\SOFTWARE\FleetDM\"
- $installerExecTime = 15
+ # There is an sporadic issue with --insecure flag being used and osqueryd which causes long shutdown time, not testing this scenario until issue this scenario is sorted out
- # Commenting test, being looked at as part of https://github.com/fleetdm/fleet/issues/8057
-
- # Test 1 - Check that there is not Orbit installation folder in programfiles and no registry entries after MSI uninstallation
- # msiexec /x ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest1.txt
- # Start-Sleep -Seconds $installerExecTime
- # if (Test-Path -Path $Env:Programfiles\Orbit) { throw "MSI Installer test #1 failed" }
- # Get-Service -Name $serviceName -ErrorAction SilentlyContinue | %{ if ($_.Name) { throw "MSI Installer test #1 failed" } }
- # if (((Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Measure-Object).Count) -gt 0) { throw "MSI Installer test #1 failed" }
+ - name: MSI Installer Tests
+ shell: pwsh
+ run: |
+ # Tests setup
+ $serviceName = "Fleet osquery"
+ $registryPath = "HKLM:\SOFTWARE\FleetDM\"
+ $installerExecTime = 15
- # Test 2 - Check that Orbit service, installation folder and registry entry are present after installing MSI again
- # msiexec /i ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest2.txt
- # Start-Sleep -Seconds $installerExecTime
- # if (-not (Test-Path -Path $Env:Programfiles\Orbit)) { throw "MSI Installer test #2 failed" }
- # Get-Service -Name $serviceName -ErrorAction SilentlyContinue | %{ if ($_.Status -ne "Running") { throw "MSI Installer test #2 failed" } }
- # if (((Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Measure-Object).Count) -eq 0) { throw "MSI Installer test #2 failed" }
+ # Commenting test, being looked at as part of https://github.com/fleetdm/fleet/issues/8057
- # Test 3 - Check that there is not Orbit folder in programfiles, no fleet service entry and no registry entries after uninstalling MSI again
- # msiexec /x ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest3.txt
- # Start-Sleep -Seconds $installerExecTime
- # if (Test-Path -Path $Env:Programfiles\Orbit) { throw "MSI Installer test #3 failed" }
- # Get-Service -Name $serviceName -ErrorAction SilentlyContinue | %{ if ($_.Name) { throw "MSI Installer test #3 failed" } }
- # if (((Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Measure-Object).Count) -gt 0) { throw "MSI Installer test #3 failed" }
+ # Test 1 - Check that there is not Orbit installation folder in programfiles and no registry entries after MSI uninstallation
+ # msiexec /x ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest1.txt
+ # Start-Sleep -Seconds $installerExecTime
+ # if (Test-Path -Path $Env:Programfiles\Orbit) { throw "MSI Installer test #1 failed" }
+ # Get-Service -Name $serviceName -ErrorAction SilentlyContinue | %{ if ($_.Name) { throw "MSI Installer test #1 failed" } }
+ # if (((Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Measure-Object).Count) -gt 0) { throw "MSI Installer test #1 failed" }
- # Test 4 - Check that osquery manifest is present and that it points to the expected osqueryd.exe file
- # msiexec /i ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest4.txt
- # Start-Sleep -Seconds $installerExecTime
- # Get-Content "$Env:Programfiles\Orbit\osquery.man" | % { if($_ -match 'resourceFileName=\"(.*?)\"') { if (-not (Test-Path -Path ([System.Environment]::ExpandEnvironmentVariables($Matches[1])))) { throw "MSI Installer test #4 failed" } } }
+ # Test 2 - Check that Orbit service, installation folder and registry entry are present after installing MSI again
+ # msiexec /i ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest2.txt
+ # Start-Sleep -Seconds $installerExecTime
+ # if (-not (Test-Path -Path $Env:Programfiles\Orbit)) { throw "MSI Installer test #2 failed" }
+ # Get-Service -Name $serviceName -ErrorAction SilentlyContinue | %{ if ($_.Status -ne "Running") { throw "MSI Installer test #2 failed" } }
+ # if (((Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Measure-Object).Count) -eq 0) { throw "MSI Installer test #2 failed" }
- - name: Upload Orbit logs
- if: always()
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
- with:
- name: orbit-logs-windows
- path: C:\Windows\system32\config\systemprofile\AppData\Local\FleetDM\Orbit\Logs\orbit-osquery.log
+ # Test 3 - Check that there is not Orbit folder in programfiles, no fleet service entry and no registry entries after uninstalling MSI again
+ # msiexec /x ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest3.txt
+ # Start-Sleep -Seconds $installerExecTime
+ # if (Test-Path -Path $Env:Programfiles\Orbit) { throw "MSI Installer test #3 failed" }
+ # Get-Service -Name $serviceName -ErrorAction SilentlyContinue | %{ if ($_.Name) { throw "MSI Installer test #3 failed" } }
+ # if (((Get-ChildItem -Path $registryPath -ErrorAction SilentlyContinue | Measure-Object).Count) -gt 0) { throw "MSI Installer test #3 failed" }
+
+ # Test 4 - Check that osquery manifest is present and that it points to the expected osqueryd.exe file
+ # msiexec /i ${{ steps.download.outputs.download-path }}\fleet-osquery.msi /quiet /passive /lv logtest4.txt
+ # Start-Sleep -Seconds $installerExecTime
+ # Get-Content "$Env:Programfiles\Orbit\osquery.man" | % { if($_ -match 'resourceFileName=\"(.*?)\"') { if (-not (Test-Path -Path ([System.Environment]::ExpandEnvironmentVariables($Matches[1])))) { throw "MSI Installer test #4 failed" } } }
+
+ - name: Upload Orbit logs
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: orbit-logs-windows
+ path: C:\Windows\system32\config\systemprofile\AppData\Local\FleetDM\Orbit\Logs\orbit-osquery.log
diff --git a/.github/workflows/fleetctl-preview-latest.yml b/.github/workflows/fleetctl-preview-latest.yml
index b69e480af..dda4e0f73 100644
--- a/.github/workflows/fleetctl-preview-latest.yml
+++ b/.github/workflows/fleetctl-preview-latest.yml
@@ -8,6 +8,7 @@ on:
branches:
- main
- patch-*
+ - prepare-*
paths:
- 'cmd/fleetctl/**.go'
- 'pkg/**.go'
@@ -16,6 +17,7 @@ on:
- 'orbit/**.go'
- 'ee/fleetctl/**.go'
- 'docs/01-Using-Fleet/standard-query-library/standard-query-library.yml'
+ - 'tools/osquery/in-a-box'
pull_request:
paths:
- 'cmd/fleetctl/**.go'
@@ -25,6 +27,7 @@ on:
- 'orbit/**.go'
- 'ee/fleetctl/**.go'
- 'docs/01-Using-Fleet/standard-query-library/standard-query-library.yml'
+ - 'tools/osquery/in-a-box'
workflow_dispatch: # Manual
# This allows a subsequently queued workflow run to interrupt previous runs
@@ -50,33 +53,44 @@ jobs:
# - Unattended installation of Docker on macOS fails. (see
# https://github.com/docker/for-mac/issues/6450)
os: [ubuntu-latest]
- go-version: ['1.19.10']
+ go-version: ['${{ vars.GO_VERSION }}']
runs-on: ${{ matrix.os }}
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Build Fleetctl
run: make fleetctl
- name: Run fleetctl preview
run: |
- ./build/fleetctl preview --std-query-lib-file-path $(pwd)/docs/01-Using-Fleet/standard-query-library/standard-query-library.yml
+ ./build/fleetctl preview \
+ --preview-config-path ./tools/osquery/in-a-box \
+ --std-query-lib-file-path $(pwd)/docs/01-Using-Fleet/standard-query-library/standard-query-library.yml
sleep 10
./build/fleetctl get hosts | tee hosts.txt
- [ $( cat hosts.txt | grep online | wc -l) -eq 8 ]
+ [ $( cat hosts.txt | grep online | wc -l) -eq 9 ]
- name: Get fleet logs
+ if: always()
run: |
FLEET_LICENSE_KEY=foo docker compose -f ~/.fleet/preview/docker-compose.yml logs fleet01 fleet02 > fleet-logs.txt
# Copying logs, otherwise the upload-artifact action uploads the logs in a hidden folder (.fleet)
- cp ~/.fleet/preview/orbit.log orbit.log
+ # Old location of orbit logs before v4.43.0
+ cp ~/.fleet/preview/orbit.log orbit.log || true
+ # New location of orbit logs since v4.43.0
+ cp ~/.fleet/preview/orbit/orbit.log orbit.log || true
cp -r ~/.fleet/preview/logs osquery_result_status_logs
- name: Upload logs
diff --git a/.github/workflows/fleetctl-preview.yml b/.github/workflows/fleetctl-preview.yml
index 7e7522b77..ab9a69c2b 100644
--- a/.github/workflows/fleetctl-preview.yml
+++ b/.github/workflows/fleetctl-preview.yml
@@ -27,11 +27,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- - name: Start tunnel
- run: |
- npm install -g localtunnel
- lt --port 1337 &
- sleep 5
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- name: Test fleetctl preview
run: |
@@ -39,7 +38,7 @@ jobs:
fleetctl preview
sleep 10
fleetctl get hosts | tee hosts.txt
- [ $( cat hosts.txt | grep online | wc -l) -eq 8 ]
+ [ $( cat hosts.txt | grep online | wc -l) -eq 9 ]
shell: bash
- name: Get fleet logs
@@ -47,7 +46,10 @@ jobs:
run: |
FLEET_LICENSE_KEY=foo docker compose -f ~/.fleet/preview/docker-compose.yml logs fleet01 fleet02 > fleet-logs.txt
# Copying logs, otherwise the upload-artifact action uploads the logs in a hidden folder (.fleet)
- cp ~/.fleet/preview/orbit.log orbit.log
+ # Old location of orbit logs before v4.43.0
+ cp ~/.fleet/preview/orbit.log orbit.log || true
+ # New location of orbit logs since v4.43.0
+ cp ~/.fleet/preview/orbit/orbit.log orbit.log || true
cp -r ~/.fleet/preview/logs osquery_result_status_logs
shell: bash
diff --git a/.github/workflows/fleetctl-workstations-canary.yml b/.github/workflows/fleetctl-workstations-canary.yml
deleted file mode 100644
index cec3da8b2..000000000
--- a/.github/workflows/fleetctl-workstations-canary.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-# This workflow applies the latest MDM profiles to the workstations team.
-# It uses a fleet instance also built and executed from source.
-#
-# It runs automatically when a file is changed in /mdm_profiles.
-name: Apply latest MDM profiles (Canary)
-
-on:
- push:
- branches:
- - main
- paths:
- - "mdm_profiles/**.mobileconfig"
- - ".github/workflows/fleetctl-workstations-canary.yml"
- workflow_dispatch: # Manual
-
-# This allows a subsequently queued workflow run to interrupt previous runs
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
- cancel-in-progress: true
-
-defaults:
- run:
- # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
- shell: bash
-
-permissions:
- contents: read
-
-env:
- DOGFOOD_API_TOKEN: ${{ secrets.DOGFOOD_API_TOKEN }}
- DOGFOOD_URL: ${{ secrets.DOGFOOD_URL }}
- CLOUD_MANAGEMENT_ENROLLMENT_TOKEN: ${{ secrets.CLOUD_MANAGEMENT_ENROLLMENT_TOKEN }}
-
-jobs:
- apply-profiles:
- timeout-minutes: 5
- runs-on: ubuntu-latest
- steps:
- - name: Apply configuration profiles and updates
- uses: fleetdm/fleet-mdm-gitops@026ee84a69cb89c869fedbe27c969bf89def418b
- with:
- FLEET_API_TOKEN: $DOGFOOD_API_TOKEN
- FLEET_URL: $DOGFOOD_URL
- FLEET_TEAM_NAME: 💻🐣 Workstations (canary)
- MDM_CONFIG_REPO: fleetdm/fleet
- MDM_CONFIG_DIRECTORY: mdm_profiles
- MAC_OS_MIN_VERSION: "13.4.0"
- MAC_OS_VERSION_DEADLINE: 2023-06-01
- MAC_OS_ENABLE_DISK_ENCRYPTION: true
diff --git a/.github/workflows/fleetctl-workstations.yml b/.github/workflows/fleetctl-workstations.yml
deleted file mode 100644
index ae77928a2..000000000
--- a/.github/workflows/fleetctl-workstations.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-# This workflow applies the latest configuration profiles (macOS settings) and macOS updates minimum version and deadline to the workstations team.
-# It uses a Fleet instance also built and executed from source.
-#
-# It runs when the GitHub action is triggered manually
-name: Apply latest configuration profiles and macOS updates
-
-on:
- push:
- branches:
- - main
- paths:
- - "mdm_profiles/**.mobileconfig"
- - ".github/workflows/fleetctl-workstations.yml"
- workflow_dispatch: # Manual
-
-# This allows a subsequently queued workflow run to interrupt previous runs
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
- cancel-in-progress: true
-
-defaults:
- run:
- # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
- shell: bash
-
-permissions:
- contents: read
-
-env:
- DOGFOOD_API_TOKEN: ${{ secrets.DOGFOOD_API_TOKEN }}
- DOGFOOD_URL: ${{ secrets.DOGFOOD_URL }}
- CLOUD_MANAGEMENT_ENROLLMENT_TOKEN: ${{ secrets.CLOUD_MANAGEMENT_ENROLLMENT_TOKEN }}
-
-jobs:
- apply-profiles:
- timeout-minutes: 5
- runs-on: ubuntu-latest
- steps:
- - name: Apply configuration profiles and updates
- uses: fleetdm/fleet-mdm-gitops@026ee84a69cb89c869fedbe27c969bf89def418b
- with:
- FLEET_API_TOKEN: $DOGFOOD_API_TOKEN
- FLEET_URL: $DOGFOOD_URL
- FLEET_TEAM_NAME: 💻 Workstations
- MDM_CONFIG_REPO: fleetdm/fleet
- MDM_CONFIG_DIRECTORY: mdm_profiles
- MAC_OS_MIN_VERSION: 13.4.0
- MAC_OS_VERSION_DEADLINE: "2023-06-02"
- MAC_OS_ENABLE_DISK_ENCRYPTION: true
diff --git a/.github/workflows/fleetd-tuf.yml b/.github/workflows/fleetd-tuf.yml
new file mode 100644
index 000000000..c1617cb86
--- /dev/null
+++ b/.github/workflows/fleetd-tuf.yml
@@ -0,0 +1,60 @@
+name: Update documentation of current versions of TUF fleetd components
+
+on:
+ workflow_dispatch: # Manual
+ schedule:
+ - cron: '0 3 * * *' # Nightly 3AM UTC
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ update-fleetd-tuf:
+ permissions:
+ contents: write # for peter-evans/create-pull-request to create branch
+ pull-requests: write # for peter-evans/create-pull-request to create a PR
+ runs-on: ubuntu-latest
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
+
+ - name: Checkout Code
+ uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
+ with:
+ fetch-depth: 0
+
+ - name: Update orbit/TUF.md
+ run: |
+ make fleetd-tuf
+
+ - name: PR changes
+ uses: peter-evans/create-pull-request@f22a7da129c901513876a2380e2dae9f8e145330 # v3.12.1
+ with:
+ base: main
+ branch: update-versions-of-fleetd-components-tuf
+ delete-branch: true
+ title: Update versions of fleetd components in Fleet's TUF [automated]
+ commit-message: |
+ Update versions of fleetd components in Fleet's TUF [automated]
+
+ Generated automatically with tools/tuf/status.
+ body: Automated change from [GitHub action](https://github.com/fleetdm/fleet/actions/workflows/fleetd-tuf.yml).
+
+
diff --git a/.github/workflows/generate-desktop-targets.yml b/.github/workflows/generate-desktop-targets.yml
index cf329da54..fef2d6075 100644
--- a/.github/workflows/generate-desktop-targets.yml
+++ b/.github/workflows/generate-desktop-targets.yml
@@ -24,23 +24,34 @@ defaults:
shell: bash
env:
- FLEET_DESKTOP_VERSION: 1.10.0
+ FLEET_DESKTOP_VERSION: 1.22.0
permissions:
contents: read
jobs:
desktop-macos:
- runs-on: macos-latest
+ # Set macOS version to '12' (current equivalent to macos-latest) for
+ # building the binary. This ensures compatibility with macOS version 13 and
+ # later, avoiding runtime errors on systems using macOS 13 or newer.
+ #
+ # Note: Update this version to '13' once GitHub marks macOS 13 as stable
+ # or if we revise our minimum supported macOS version.
+ runs-on: macos-12
steps:
- - name: Install Go
- uses: actions/setup-go@v2.1.3
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
- go-version: '^1.19.10'
+ egress-policy: audit
+
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Import signing keys
env:
@@ -82,13 +93,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Install Go
- uses: actions/setup-go@v2.1.3
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
- go-version: '^1.19.10'
+ egress-policy: audit
+
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Generate fleet-desktop.exe
run: |
@@ -105,13 +121,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- - name: Install Go
- uses: actions/setup-go@v2.1.3
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
- go-version: '^1.19.10'
+ egress-policy: audit
+
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Generate desktop.tar.gz
run: |
diff --git a/.github/workflows/generate-nudge-targets.yml b/.github/workflows/generate-nudge-targets.yml
index 550bfb5d2..4b7f025f4 100644
--- a/.github/workflows/generate-nudge-targets.yml
+++ b/.github/workflows/generate-nudge-targets.yml
@@ -33,8 +33,13 @@ jobs:
generate-macos:
runs-on: macos-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Generate nudge.app.tar.gz
run: make nudge-app-tar-gz version=$NUDGE_VERSION out-path=.
diff --git a/.github/workflows/generate-osqueryd-targets.yml b/.github/workflows/generate-osqueryd-targets.yml
index 35d748242..0af9f64be 100644
--- a/.github/workflows/generate-osqueryd-targets.yml
+++ b/.github/workflows/generate-osqueryd-targets.yml
@@ -24,7 +24,7 @@ defaults:
shell: bash
env:
- OSQUERY_VERSION: 5.8.2
+ OSQUERY_VERSION: 5.12.0
permissions:
contents: read
@@ -33,8 +33,13 @@ jobs:
generate-macos:
runs-on: macos-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Generate osqueryd.app.tar.gz
run: |
@@ -49,8 +54,13 @@ jobs:
generate-linux:
runs-on: ubuntu-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download and extract osqueryd for linux
run: |
@@ -69,8 +79,13 @@ jobs:
generate-windows:
runs-on: windows-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Download osquery msi for Windows
run: |
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index bc3a3408f..1d00e3c0d 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -5,6 +5,7 @@ on:
branches:
- main
- patch-*
+ - prepare-*
paths:
- '**.go'
pull_request:
@@ -37,14 +38,19 @@ jobs:
matrix:
# See #9943, we just need to add windows-latest here once all issues are fixed.
os: [ubuntu-latest, macos-latest]
- go-version: ['1.19.10']
+ go-version: ['${{ vars.GO_VERSION }}']
runs-on: ${{ matrix.os }}
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ matrix.go-version }}
@@ -59,5 +65,9 @@ jobs:
# Don't forget to update
# docs/Contributing/Testing-and-local-development.md when this
# version changes
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.1
+ go install github.com/golangci/golangci-lint/cmd/golangci-lint@411e0bbbd3096aa0ee2b924160629bdf2bc81d40 # v1.54.2
make lint-go
+
+ - name: Run cloner-check tool
+ run: |
+ go run ./tools/cloner-check/main.go -check
diff --git a/.github/workflows/goreleaser-fleet.yaml b/.github/workflows/goreleaser-fleet.yaml
index e9960bbaa..f192a624f 100644
--- a/.github/workflows/goreleaser-fleet.yaml
+++ b/.github/workflows/goreleaser-fleet.yaml
@@ -3,7 +3,7 @@ name: goreleaser
on:
push:
tags:
- - 'fleet-*'
+ - "fleet-*"
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
@@ -25,8 +25,13 @@ jobs:
permissions:
contents: write
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0 # Needed for goreleaser
@@ -37,10 +42,16 @@ jobs:
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ vars.GO_VERSION }}
+ # Set the Node.js version
+ - name: Set up Node.js ${{ vars.NODE_VERSION }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ vars.NODE_VERSION }}
+
- name: Install JS Dependencies
run: make deps-js
diff --git a/.github/workflows/goreleaser-orbit.yaml b/.github/workflows/goreleaser-orbit.yaml
index a81437b6f..2f1eb3905 100644
--- a/.github/workflows/goreleaser-orbit.yaml
+++ b/.github/workflows/goreleaser-orbit.yaml
@@ -24,8 +24,13 @@ jobs:
permissions:
contents: read
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Note that goreleaser does not like the orbit- prefixed flag unless you use the closed-source
# paid version. We pay for goreleaser, but using the closed source build would weaken our
@@ -49,12 +54,12 @@ jobs:
rm certificate.p12
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ vars.GO_VERSION }}
- name: Run GoReleaser
- run: go run github.com/goreleaser/goreleaser@v1.9.2 release --debug --rm-dist --skip-publish -f orbit/goreleaser-macos.yml
+ run: go run github.com/goreleaser/goreleaser@56c9d09a1b925e2549631c6d180b0a1c2ebfac82 release --debug --rm-dist --skip-publish -f orbit/goreleaser-macos.yml # v1.20.0
env:
GITHUB_TOKEN: ${{ secrets.FLEET_RELEASE_GITHUB_PAT }}
AC_USERNAME: ${{ secrets.APPLE_USERNAME }}
@@ -66,15 +71,20 @@ jobs:
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
name: orbit-macos
- path: dist
+ path: dist/orbit-macos_darwin_all/orbit
goreleaser-linux:
runs-on: ubuntu-20.04
permissions:
contents: read
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Note that goreleaser does not like the orbit- prefixed flag unless you use the closed-source
# paid version. We pay for goreleaser, but using the closed source build would weaken our
@@ -83,26 +93,31 @@ jobs:
run: git tag $(echo ${{ github.ref_name }} | sed -e 's/orbit-//g') && git tag -d ${{ github.ref_name }}
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ vars.GO_VERSION }}
- name: Run GoReleaser
- run: go run github.com/goreleaser/goreleaser@v1.9.2 release --debug --rm-dist --skip-publish -f orbit/goreleaser-linux.yml
+ run: go run github.com/goreleaser/goreleaser@56c9d09a1b925e2549631c6d180b0a1c2ebfac82 release --debug --rm-dist --skip-publish -f orbit/goreleaser-linux.yml # v1.20.0
- name: Upload
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
name: orbit-linux
- path: dist
+ path: dist/orbit_linux_amd64_v1/orbit
goreleaser-windows:
runs-on: windows-2022
permissions:
contents: read
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Note that goreleaser does not like the orbit- prefixed flag unless you use the closed-source
# paid version. We pay for goreleaser, but using the closed source build would weaken our
@@ -111,15 +126,15 @@ jobs:
run: git tag $(echo ${{ github.ref_name }} | sed -e 's/orbit-//g') && git tag -d ${{ github.ref_name }}
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ vars.GO_VERSION }}
- name: Run GoReleaser
- run: go run github.com/goreleaser/goreleaser@v1.9.2 release --debug --rm-dist --skip-publish -f orbit/goreleaser-windows.yml
+ run: go run github.com/goreleaser/goreleaser@56c9d09a1b925e2549631c6d180b0a1c2ebfac82 release --debug --rm-dist --skip-publish -f orbit/goreleaser-windows.yml # v1.20.0
- name: Upload
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
name: orbit-windows
- path: dist
+ path: dist/orbit_windows_amd64_v1/orbit.exe
diff --git a/.github/workflows/goreleaser-snapshot-fleet.yaml b/.github/workflows/goreleaser-snapshot-fleet.yaml
index 756f9712b..65ac166c1 100644
--- a/.github/workflows/goreleaser-snapshot-fleet.yaml
+++ b/.github/workflows/goreleaser-snapshot-fleet.yaml
@@ -2,15 +2,20 @@ name: Docker publish
on:
push:
+ branches:
+ - "main"
+ - "prepare-*"
+ - "patch-*"
paths-ignore:
- - 'handbook/**'
- - 'website/**'
- - 'mdm-profiles/**'
+ - "handbook/**"
+ - "website/**"
+ - "mdm-profiles/**"
pull_request:
paths-ignore:
- - 'handbook/**'
- - 'website/**'
- - 'mdm-profiles/**'
+ - "handbook/**"
+ - "website/**"
+ - "mdm-profiles/**"
+ workflow_dispatch: # Manual
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
@@ -35,8 +40,13 @@ jobs:
runs-on: ubuntu-20.04
environment: Docker Hub
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
@@ -45,9 +55,15 @@ jobs:
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Set up Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
- go-version: 1.19.10
+ go-version: ${{ vars.GO_VERSION }}
+
+ # Set the Node.js version
+ - name: Set up Node.js ${{ vars.NODE_VERSION }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ vars.NODE_VERSION }}
- name: Install Dependencies
run: make deps
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 87c70e481..a6200e984 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -31,6 +31,11 @@ jobs:
subdomain: ${{ steps.gen.outputs.subdomain }}
address: ${{ steps.gen.outputs.address }}
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- id: gen
run: |
UUID=$(uuidgen)
@@ -41,17 +46,29 @@ jobs:
runs-on: ubuntu-latest
needs: gen
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Start tunnel
env:
CERT_PEM: ${{ secrets.CLOUDFLARE_TUNNEL_FLEETUEM_CERT_B64 }}
run: |
+ # Increase maximum receive buffer size to roughly 2.5 MB.
+ # Cloudflared uses quic-go. This buffer holds packets that have been received by the kernel,
+ # but not yet read by the application (quic-go in this case). Once this buffer fills up, the
+ # kernel will drop any new incoming packet.
+ # See https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size.
+ sudo sysctl -w net.core.rmem_max=2500000
+
# Install cloudflared
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
# Add secret
echo "$CERT_PEM" | base64 -d > cert.pem
# Start tunnel
- cloudflared tunnel --origincert cert.pem --hostname ${{ needs.gen.outputs.subdomain }} --url http://localhost:1337 --name ${{ needs.gen.outputs.subdomain }} &
+ cloudflared tunnel --origincert cert.pem --hostname ${{ needs.gen.outputs.subdomain }} --url http://localhost:1337 --name ${{ needs.gen.outputs.subdomain }} --logfile cloudflared.log &
until [[ $(cloudflared tunnel --origincert cert.pem info -o json ${{ needs.gen.outputs.subdomain }} | jq '.conns[0].conns[0].is_pending_reconnect') = false ]]; do
echo "Awaiting tunnel ready..."
sleep 5
@@ -68,10 +85,7 @@ jobs:
check_artifacts: true
- name: Run Fleet server
- timeout-minutes: 15
- env:
- # Use instance identifier to allow for duplicate UUIDs
- FLEET_OSQUERY_HOST_IDENTIFIER: instance
+ timeout-minutes: 10
run: |
chmod +x ./build/fleetctl
./build/fleetctl preview --no-hosts
@@ -79,19 +93,23 @@ jobs:
./build/fleetctl get enroll-secret
docker compose -f ~/.fleet/preview/docker-compose.yml logs --follow fleet01 fleet02 &
# Wait for all of the hosts to be enrolled
- EXPECTED=12
+ EXPECTED=3
until [ $(./build/fleetctl get hosts --json | wc -l | tee hostcount) -ge $EXPECTED ]; do
echo -n "Waiting for hosts to enroll: "
cat hostcount | xargs echo -n
echo " / $EXPECTED"
- sleep 10
+ sleep 20
done
- ./build/fleetctl get hosts
echo "Success! $EXPECTED hosts enrolled."
+ - name: Show enrolled hosts
+ if: always()
+ run: |
+ ./build/fleetctl get hosts --json
+
- name: Slack Notification
if: failure()
- uses: slackapi/slack-github-action@16b6c78ee73689a627b65332b34e5d409c7299da # v1.18.0
+ uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{
@@ -114,6 +132,13 @@ jobs:
if: always()
run: cloudflared tunnel --origincert cert.pem delete --force ${{ needs.gen.outputs.subdomain }}
+ - name: Upload cloudflared logs
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: cloudflared.log
+ path: cloudflared.log
+
login:
runs-on: ubuntu-latest
needs: gen
@@ -121,6 +146,11 @@ jobs:
token: ${{ steps.login.outputs.token }}
steps:
# Download fleet and fleetctl binaries from last successful build on main
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Download binaries
uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67
with:
@@ -146,16 +176,30 @@ jobs:
echo "token=$TOKEN" >> $GITHUB_OUTPUT
orbit-macos:
- timeout-minutes: 15
+ timeout-minutes: 10
strategy:
matrix:
- orbit-channel: [ 'stable', 'edge' ]
- osqueryd-channel: ['stable', 'edge' ]
+ # To run multiple VMs that have the same UUID we need to implement
+ # https://github.com/fleetdm/fleet/issues/8021 (otherwise orbit and osqueryd
+ # in the same host are enrolled as two hosts in Fleet).
+ # Until then we will just test the `stable` channel in all components.
+ #
+ # Alternatively, we can bring back the `edge` channel when we decide to upgrade
+ # our worker to macOS 13 in the future, as they changed the virtualization
+ # layer for 13 and now it has random UUIDs (https://github.com/actions/runner-images/issues/7591).
+ orbit-channel: [ 'stable' ]
+ osqueryd-channel: [ 'stable' ]
+ desktop-channel: [ 'stable' ]
runs-on: macos-latest
needs: [gen, login]
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install dependencies
run: |
@@ -170,7 +214,7 @@ jobs:
SECRET=$(echo $SECRET_JSON | jq -r '.spec.secrets[0].secret')
echo "Secret: $SECRET"
echo "Hostname: $(hostname -s)"
- fleetctl package --type pkg --fleet-url=${{ needs.gen.outputs.address }} --enroll-secret=$SECRET --orbit-channel=${{ matrix.orbit-channel }} --osqueryd-channel=${{ matrix.osqueryd-channel }} --fleet-desktop
+ fleetctl package --type pkg --fleet-url=${{ needs.gen.outputs.address }} --enroll-secret=$SECRET --orbit-channel=${{ matrix.orbit-channel }} --osqueryd-channel=${{ matrix.osqueryd-channel }} --desktop-channel=${{ matrix.desktop-channel }} --fleet-desktop --debug
sudo installer -pkg fleet-osquery.pkg -target /
until fleetctl get hosts | grep -iF $(hostname -s);
do
@@ -188,7 +232,7 @@ jobs:
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
- name: orbit-macos-${{ matrix.orbit-channel }}-${{ matrix.osqueryd-channel }}-logs
+ name: orbit-macos-${{ matrix.orbit-channel }}-${{ matrix.osqueryd-channel }}-${{ matrix.desktop-channel }}-logs
path: |
orbit-logs
@@ -197,26 +241,36 @@ jobs:
./orbit/tools/cleanup/cleanup_macos.sh
orbit-ubuntu:
- timeout-minutes: 15
+ timeout-minutes: 10
strategy:
matrix:
- orbit-channel: [ 'stable', 'edge' ]
- osqueryd-channel: ['stable', 'edge' ]
+ # To run multiple VMs that have the same UUID we need to implement
+ # https://github.com/fleetdm/fleet/issues/8021 (otherwise orbit and osqueryd
+ # in the same host are enrolled as two hosts in Fleet).
+ # Until then we will just test the `stable` channel in all components.
+ orbit-channel: [ 'stable' ]
+ osqueryd-channel: [ 'stable' ]
+ desktop-channel: [ 'stable' ]
runs-on: ubuntu-latest
needs: [gen, login]
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install dependencies
run: |
npm install -g fleetctl
fleetctl config set --address ${{ needs.gen.outputs.address }} --token ${{ needs.login.outputs.token }}
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
- go-version: '^1.19.10'
+ go-version: ${{ vars.GO_VERSION }}
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Build Fleetctl
run: make fleetctl
@@ -230,7 +284,7 @@ jobs:
SECRET=$(echo $SECRET_JSON | jq -r '.spec.secrets[0].secret')
echo "Secret: $SECRET"
echo "Hostname: $(hostname -s)"
- ./build/fleetctl package --type deb --fleet-url=${{ needs.gen.outputs.address }} --enroll-secret=$SECRET --orbit-channel=${{ matrix.orbit-channel }} --osqueryd-channel=${{ matrix.osqueryd-channel }}
+ ./build/fleetctl package --type deb --fleet-url=${{ needs.gen.outputs.address }} --enroll-secret=$SECRET --orbit-channel=${{ matrix.orbit-channel }} --osqueryd-channel=${{ matrix.osqueryd-channel }} --desktop-channel=${{ matrix.desktop-channel }} --fleet-desktop --debug
sudo dpkg -i fleet-osquery*
until fleetctl get hosts | grep -iF $(hostname -s);
do
@@ -248,7 +302,7 @@ jobs:
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
- name: orbit-ubuntu-${{ matrix.orbit-channel }}-${{ matrix.osqueryd-channel }}-logs
+ name: orbit-ubuntu-${{ matrix.orbit-channel }}-${{ matrix.osqueryd-channel }}-${{ matrix.desktop-channel }}-logs
path: |
orbit-logs
@@ -257,14 +311,24 @@ jobs:
sudo apt remove fleet-osquery -y
orbit-windows-build:
- timeout-minutes: 15
+ timeout-minutes: 10
strategy:
matrix:
- orbit-channel: [ 'stable', 'edge' ]
- osqueryd-channel: ['stable', 'edge' ]
+ # To run multiple VMs that have the same UUID we need to implement
+ # https://github.com/fleetdm/fleet/issues/8021 (otherwise orbit and osqueryd
+ # in the same host are enrolled as two hosts in Fleet).
+ # Until then we will just test the `stable` channel in all components.
+ orbit-channel: [ 'stable' ]
+ osqueryd-channel: [ 'stable' ]
+ desktop-channel: [ 'stable' ]
runs-on: ubuntu-latest
needs: [gen, login]
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install dependencies
run: |
docker pull fleetdm/wix:latest &
@@ -278,24 +342,34 @@ jobs:
SECRET=$(echo $SECRET_JSON | jq -r '.spec.secrets[0].secret')
echo "Secret: $SECRET"
echo "Hostname: $(hostname -s)"
- fleetctl package --type msi --fleet-url=${{ needs.gen.outputs.address }} --enroll-secret=$SECRET --orbit-channel=${{ matrix.orbit-channel }} --osqueryd-channel=${{ matrix.osqueryd-channel }} --fleet-desktop
- mv fleet-osquery.msi orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}.msi
+ fleetctl package --type msi --fleet-url=${{ needs.gen.outputs.address }} --enroll-secret=$SECRET --orbit-channel=${{ matrix.orbit-channel }} --osqueryd-channel=${{ matrix.osqueryd-channel }} --desktop-channel=${{ matrix.desktop-channel }} --fleet-desktop --debug
+ mv fleet-osquery.msi orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}-desktop-${{ matrix.desktop-channel }}.msi
- name: Upload MSI
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
- name: orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}.msi
- path: orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}.msi
+ name: orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}-desktop-${{ matrix.desktop-channel }}.msi
+ path: orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}-desktop-${{ matrix.desktop-channel }}.msi
orbit-windows:
- timeout-minutes: 15
+ timeout-minutes: 10
strategy:
matrix:
- orbit-channel: [ 'stable', 'edge' ]
- osqueryd-channel: ['stable', 'edge' ]
+ # To run multiple VMs that have the same UUID we need to implement
+ # https://github.com/fleetdm/fleet/issues/8021 (otherwise orbit and osqueryd
+ # in the same host are enrolled as two hosts in Fleet).
+ # Until then we will just test the `stable` channel in all components.
+ orbit-channel: [ 'stable' ]
+ osqueryd-channel: [ 'stable' ]
+ desktop-channel: [ 'stable' ]
needs: [gen, login, orbit-windows-build]
runs-on: windows-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install dependencies
shell: bash
run: |
@@ -306,21 +380,28 @@ jobs:
id: download
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v2
with:
- name: orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}.msi
-
+ name: orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}-desktop-${{ matrix.desktop-channel }}.msi
- name: Install Orbit
+ shell: cmd
run: |
- msiexec /i ${{steps.download.outputs.download-path}}\orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}.msi /quiet /passive /lv log.txt
+ msiexec /i ${{steps.download.outputs.download-path}}\orbit-${{ matrix.orbit-channel }}-osqueryd-${{ matrix.osqueryd-channel }}-desktop-${{ matrix.desktop-channel }}.msi /quiet /passive /lv log.txt
sleep 30
# We can't very accurately check the install on these Windows hosts since the hostnames tend to
# overlap and we can't control the hostnames. Instead we just return and have the run-server job
# wait until the expected number of hosts enroll.
+ - name: Upload orbit install log
+ if: always()
+ uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
+ with:
+ name: msiexec-install-log
+ path: log.txt
+
- name: Upload Orbit logs
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v2
with:
- name: orbit-windows-${{ matrix.orbit-channel }}-${{ matrix.osqueryd-channel }}-logs
+ name: orbit-windows-${{ matrix.orbit-channel }}-${{ matrix.osqueryd-channel }}-${{ matrix.desktop-channel }}-logs
path: C:\Windows\system32\config\systemprofile\AppData\Local\FleetDM\Orbit\Logs\orbit-osquery.log
diff --git a/.github/workflows/pr-helm.yaml b/.github/workflows/pr-helm.yaml
index 1bb2c333d..4f119e04a 100644
--- a/.github/workflows/pr-helm.yaml
+++ b/.github/workflows/pr-helm.yaml
@@ -28,8 +28,13 @@ jobs:
kube-version: [1.16.0, 1.17.0, 1.18.0] # kubeval is currently lagging behind the active schema versions, so these are the ones we can test against. see https://github.com/instrumenta/kubernetes-json-schema/issues/26
runs-on: ubuntu-20.04
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: checkout
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: create temp dir
run: mkdir -p helm-temp
- name: helm template -- default values
diff --git a/.github/workflows/push-osquery-perf-to-ecr.yml b/.github/workflows/push-osquery-perf-to-ecr.yml
index 0b17bbbf1..0760d0390 100644
--- a/.github/workflows/push-osquery-perf-to-ecr.yml
+++ b/.github/workflows/push-osquery-perf-to-ecr.yml
@@ -35,8 +35,13 @@ jobs:
build-docker:
runs-on: ubuntu-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@05b148adc31e091bafbaf404f745055d4d3bc9d2 # v1
diff --git a/.github/workflows/release-fleetd-chrome-beta.yml b/.github/workflows/release-fleetd-chrome-beta.yml
new file mode 100644
index 000000000..8f50b02d6
--- /dev/null
+++ b/.github/workflows/release-fleetd-chrome-beta.yml
@@ -0,0 +1,72 @@
+name: Release fleetd-chrome beta
+
+on:
+ push:
+ tags:
+ - 'fleetd-chrome-**-beta'
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ release-fleetd-chrome-beta:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ - name: Run test
+ working-directory: ./ee/fleetd-chrome
+ run: |
+ npm install && npm run test
+
+ - name: Build & sign extension
+ working-directory: ./ee/fleetd-chrome
+ env:
+ CHROME_SIGNING_KEY: ${{ secrets.FLEETD_CHROME_SIGNING_KEY_BETA }}
+ run: |
+ echo -e 'FLEET_URL=""\nFLEET_ENROLL_SECRET=""' > .env
+ npm install && npm run build
+ echo "$CHROME_SIGNING_KEY" > chrome.pem
+ /usr/bin/google-chrome --pack-extension=./dist --pack-extension-key=chrome.pem
+
+ - name: Upload extension
+ working-directory: ./ee/fleetd-chrome
+ env:
+ R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
+ R2_CHROME_BETA_ACCESS_KEY_ID: ${{ secrets.R2_CHROME_BETA_ACCESS_KEY_ID }}
+ R2_CHROME_BETA_ACCESS_KEY_SECRET: ${{ secrets.R2_CHROME_BETA_ACCESS_KEY_SECRET }}
+ run: |
+ sudo apt-get install rclone
+ mkdir -p ~/.config/rclone
+ echo "[r2]
+ type = s3
+ provider = Cloudflare
+ region = auto
+ no_check_bucket = true
+ access_key_id = $R2_CHROME_BETA_ACCESS_KEY_ID
+ secret_access_key = $R2_CHROME_BETA_ACCESS_KEY_SECRET
+ endpoint = $R2_ENDPOINT
+
+ " > ~/.config/rclone/rclone.conf
+ mv dist.crx fleetd.crx
+ rclone copy fleetd.crx r2:chrome-beta/
+ mv updates-beta.xml updates.xml
+ rclone copy updates.xml r2:chrome-beta/
diff --git a/.github/workflows/release-fleetd-chrome.yml b/.github/workflows/release-fleetd-chrome.yml
new file mode 100644
index 000000000..6751d7705
--- /dev/null
+++ b/.github/workflows/release-fleetd-chrome.yml
@@ -0,0 +1,72 @@
+name: Release fleetd-chrome
+
+on:
+ push:
+ tags:
+ - 'fleetd-chrome-**'
+ - '!fleetd-chrome-**-beta'
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ release-fleetd-chrome:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ - name: Run test
+ working-directory: ./ee/fleetd-chrome
+ run: |
+ npm install && npm run test
+
+ - name: Build & sign extension
+ working-directory: ./ee/fleetd-chrome
+ env:
+ CHROME_SIGNING_KEY: ${{ secrets.FLEETD_CHROME_SIGNING_KEY }}
+ run: |
+ echo -e 'FLEET_URL=""\nFLEET_ENROLL_SECRET=""' > .env
+ npm install && npm run build
+ echo "$CHROME_SIGNING_KEY" > chrome.pem
+ /usr/bin/google-chrome --pack-extension=./dist --pack-extension-key=chrome.pem
+
+ - name: Upload extension
+ working-directory: ./ee/fleetd-chrome
+ env:
+ R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
+ R2_CHROME_ACCESS_KEY_ID: ${{ secrets.R2_CHROME_ACCESS_KEY_ID }}
+ R2_CHROME_ACCESS_KEY_SECRET: ${{ secrets.R2_CHROME_ACCESS_KEY_SECRET }}
+ run: |
+ sudo apt-get install rclone
+ mkdir -p ~/.config/rclone
+ echo "[r2]
+ type = s3
+ provider = Cloudflare
+ region = auto
+ no_check_bucket = true
+ access_key_id = $R2_CHROME_ACCESS_KEY_ID
+ secret_access_key = $R2_CHROME_ACCESS_KEY_SECRET
+ endpoint = $R2_ENDPOINT
+
+ " > ~/.config/rclone/rclone.conf
+ mv dist.crx fleetd.crx
+ rclone copy fleetd.crx r2:chrome/
+ rclone copy updates.xml r2:chrome/
diff --git a/.github/workflows/release-helm.yaml b/.github/workflows/release-helm.yaml
index fa5a1c589..d6d738c36 100644
--- a/.github/workflows/release-helm.yaml
+++ b/.github/workflows/release-helm.yaml
@@ -24,10 +24,15 @@ jobs:
contents: write # to push helm charts
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260
with:
- token: ${{ secrets.FLEET_RELEASE_GITHUB_PAT }}
+ token: ${{ secrets.GITHUB_TOKEN }}
charts_dir: charts
target_dir: charts
linting: off
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index e209635c5..59dfd8a7f 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -24,13 +24,18 @@ jobs:
id-token: write
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: "Checkout code"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
+ uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
@@ -47,6 +52,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
+ uses: github/codeql-action/upload-sarif@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
with:
sarif_file: results.sarif
diff --git a/.github/workflows/test-db-changes.yml b/.github/workflows/test-db-changes.yml
index 6a9f225f7..301645008 100644
--- a/.github/workflows/test-db-changes.yml
+++ b/.github/workflows/test-db-changes.yml
@@ -5,6 +5,7 @@ on:
branches:
- main
- patch-*
+ - prepare-*
pull_request:
paths:
- '**.go'
@@ -29,10 +30,15 @@ jobs:
test-db-changes:
runs-on: ubuntu-latest
steps:
- - name: Install Go
- uses: actions/setup-go@v2.1.3
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
- go-version: '^1.19.10'
+ egress-policy: audit
+
+ - name: Install Go
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
+ with:
+ go-version: ${{ vars.GO_VERSION }}
- name: Checkout Code
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
with:
@@ -81,3 +87,16 @@ jobs:
fi
index=$((index+1))
done
+
+ - name: Prevent hosts foreign keys
+ run: |
+ # grep exits with an error code if it doesn't find a match, so this condition
+ # is only true if it a) finds a matching migrations file in the diff, and b)
+ # finds an FK to hosts in one of the migrations files.
+ #
+ # grep prints the matches, which will help figure out where those references are.
+ if git diff --name-only origin/main | grep "migrations/" | xargs grep -i -E 'references\s*hosts\s*\(\s*id\s*\)' ; then
+ echo "❌ fail: hosts foreign keys are not allowed"
+ echo "Ref: https://github.com/fleetdm/fleet/blob/main/handbook/engineering/scaling-fleet.md#foreign-keys-and-locking"
+ exit 1
+ fi
diff --git a/.github/workflows/test-fleetd-chrome.yml b/.github/workflows/test-fleetd-chrome.yml
new file mode 100644
index 000000000..82fa08fc8
--- /dev/null
+++ b/.github/workflows/test-fleetd-chrome.yml
@@ -0,0 +1,72 @@
+name: Run fleetd-chrome tests
+
+on:
+ push:
+ branches:
+ - main
+ - patch-*
+ - prepare-*
+ pull_request:
+ paths:
+ - ee/fleetd-chrome/**
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ test-fleetd-chrome:
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ - name: JS Dependency Cache
+ id: js-cache
+ uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
+ with:
+ path: |
+ **/node_modules
+ key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-modules-
+
+ - name: Install JS Dependencies
+ if: steps.js-cache.outputs.cache-hit != 'true'
+ working-directory: ./ee/fleetd-chrome
+ run: npm install
+
+ - name: Build JS
+ working-directory: ./ee/fleetd-chrome
+ run: |
+ echo -e 'FLEET_URL="url"\nFLEET_ENROLL_SECRET="secret"' > .env
+ npm run build
+
+ - name: Run JS Tests
+ working-directory: ./ee/fleetd-chrome
+ run: |
+ npm test
+
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
+ with:
+ directory: ./ee/fleetd-chrome/coverage
+ flags: fleetd-chrome
diff --git a/.github/workflows/test-go.yaml b/.github/workflows/test-go.yaml
index 8d133663c..a5c02b14c 100644
--- a/.github/workflows/test-go.yaml
+++ b/.github/workflows/test-go.yaml
@@ -5,12 +5,14 @@ on:
branches:
- main
- patch-*
+ - prepare-*
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/test-go.yaml'
- 'server/authz/policy.rego'
+ - 'docker-compose.yml'
pull_request:
paths:
- '**.go'
@@ -18,6 +20,7 @@ on:
- 'go.sum'
- '.github/workflows/test-go.yaml'
- 'server/authz/policy.rego'
+ - 'docker-compose.yml'
workflow_dispatch: # Manual
schedule:
- cron: '0 4 * * *'
@@ -40,27 +43,37 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
- go-version: ['^1.19.10']
+ go-version: ['${{ vars.GO_VERSION }}']
mysql: ["mysql:5.7.21", "mysql:8.0.28"]
runs-on: ${{ matrix.os }}
env:
RACE_ENABLED: false
- GO_TEST_TIMEOUT: 15m
+ GO_TEST_TIMEOUT: 20m
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Pre-starting dependencies here means they are ready to go when we need them.
- name: Start Infra Dependencies
# Use & to background this
- run: FLEET_MYSQL_IMAGE=${{ matrix.mysql }} docker-compose -f docker-compose.yml -f docker-compose-redis-cluster.yml up -d mysql_test redis redis-cluster-1 redis-cluster-2 redis-cluster-3 redis-cluster-4 redis-cluster-5 redis-cluster-6 redis-cluster-setup minio saml_idp mailhog mailpit &
+ run: FLEET_MYSQL_IMAGE=${{ matrix.mysql }} docker-compose -f docker-compose.yml -f docker-compose-redis-cluster.yml up -d mysql_test redis redis-cluster-1 redis-cluster-2 redis-cluster-3 redis-cluster-4 redis-cluster-5 redis-cluster-6 redis-cluster-setup minio saml_idp mailhog mailpit smtp4dev_test &
+
+ - name: Add TLS certificate for SMTP Tests
+ run: |
+ sudo cp tools/smtp4dev/fleet.crt /usr/local/share/ca-certificates/
+ sudo update-ca-certificates
# It seems faster not to cache Go dependencies
- name: Install Go Dependencies
@@ -86,6 +99,7 @@ jobs:
done
echo "mysql is ready"
+
- name: Run Go Tests
run: |
GO_TEST_EXTRA_FLAGS="-v -race=$RACE_ENABLED -timeout=$GO_TEST_TIMEOUT" \
@@ -107,7 +121,7 @@ jobs:
- name: Slack Notification
if: github.event.schedule == '0 4 * * *' && failure()
- uses: slackapi/slack-github-action@16b6c78ee73689a627b65332b34e5d409c7299da # v1.18.0
+ uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
payload: |
{
diff --git a/.github/workflows/test-js.yml b/.github/workflows/test-js.yml
new file mode 100644
index 000000000..9d6352373
--- /dev/null
+++ b/.github/workflows/test-js.yml
@@ -0,0 +1,117 @@
+name: JavaScript Tests
+
+on:
+ push:
+ branches:
+ - main
+ - patch-*
+ - prepare-*
+ pull_request:
+ paths:
+ - assets/**
+ - frontend/**
+ - package.json
+ - yarn.lock
+ - webpack.config.js
+ - tsconfig.json
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ test-js:
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ # Set the Node.js version
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Set up Node.js ${{ vars.NODE_VERSION }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ vars.NODE_VERSION }}
+
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ - name: JS Dependency Cache
+ id: js-cache
+ uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
+ with:
+ path: |
+ **/node_modules
+ key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-modules-
+
+ - name: Install JS Dependencies
+ if: steps.js-cache.outputs.cache-hit != 'true'
+ run: make deps-js
+
+ - name: Run JS Tests
+ run: |
+ yarn test:ci
+
+ - name: Upload to Codecov
+ uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
+ with:
+ flags: frontend
+
+ lint-js:
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ # Set the Node.js version
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Set up Node.js ${{ vars.NODE_VERSION }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ vars.NODE_VERSION }}
+
+ - name: Checkout Code
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ - name: JS Dependency Cache
+ id: js-cache
+ uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
+ with:
+ path: |
+ **/node_modules
+ key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-modules-
+
+ - name: Install JS Dependencies
+ if: steps.js-cache.outputs.cache-hit != 'true'
+ run: make deps-js
+
+ - name: Run JS Linting
+ run: |
+ make lint-js
+
+ - name: Run prettier formatting check
+ run: |
+ yarn prettier:check
diff --git a/.github/workflows/test-native-tooling-packaging.yml b/.github/workflows/test-native-tooling-packaging.yml
index 9c2592f05..db242cee0 100644
--- a/.github/workflows/test-native-tooling-packaging.yml
+++ b/.github/workflows/test-native-tooling-packaging.yml
@@ -7,6 +7,7 @@ on:
branches:
- main
- patch-*
+ - prepare-*
pull_request:
paths:
- 'cmd/fleetctl/**.go'
@@ -40,17 +41,22 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
- go-version: ['^1.19.10']
+ go-version: ['${{ vars.GO_VERSION }}']
runs-on: ${{ matrix.os }}
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install Go Dependencies
run: make deps-go
diff --git a/.github/workflows/test-packaging.yml b/.github/workflows/test-packaging.yml
index 53084a1b5..113f3c33c 100644
--- a/.github/workflows/test-packaging.yml
+++ b/.github/workflows/test-packaging.yml
@@ -9,6 +9,7 @@ on:
branches:
- main
- patch-*
+ - prepare-*
pull_request:
paths:
- 'cmd/fleetctl/**.go'
@@ -42,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
- go-version: ['^1.19.10']
+ go-version: ['${{ vars.GO_VERSION }}']
runs-on: ${{ matrix.os }}
steps:
@@ -50,6 +51,11 @@ jobs:
# Docker needs to be installed manually on macOS.
# From https://github.com/docker/for-mac/issues/2359#issuecomment-943131345
# FIXME: lock Docker version to 4.10.0 as newer versions fail to initialize
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install Docker
timeout-minutes: 20
if: matrix.os == 'macos-latest'
@@ -69,14 +75,24 @@ jobs:
run: docker pull fleetdm/wix:latest &
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- # It seems faster not to cache Go dependencies
+ - name: Install wine and wix
+ if: matrix.os == 'macos-latest'
+ run: |
+ ./scripts/macos-install-wine.sh
+ wget https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip -nv -O wix.zip
+ mkdir wix
+ unzip wix.zip -d wix
+ rm -f wix.zip
+ echo wix installed at $(pwd)/wix
+
+ # It seems faster not to cache Go dependencies
- name: Install Go Dependencies
run: make deps-go
@@ -106,3 +122,7 @@ jobs:
- name: Build PKG with Fleet Desktop
run: ./build/fleetctl package --type pkg --enroll-secret=foo --fleet-url=https://localhost:8080 --fleet-desktop
+
+ - name: Build MSI (using local Wix)
+ if: matrix.os == 'macos-latest'
+ run: ./build/fleetctl package --type msi --enroll-secret=foo --fleet-url=https://localhost:8080 --fleet-desktop --local-wix-dir ./wix
diff --git a/.github/workflows/test-puppet.yml b/.github/workflows/test-puppet.yml
new file mode 100644
index 000000000..f537913a5
--- /dev/null
+++ b/.github/workflows/test-puppet.yml
@@ -0,0 +1,59 @@
+name: Test Puppet
+
+on:
+ push:
+ branches:
+ - main
+ - patch-*
+ pull_request:
+ paths:
+ - 'ee/tools/puppet/fleetdm/**'
+ - '.github/workflows/test-puppet.yml'
+ workflow_dispatch: # Manual
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ test-puppet:
+ runs-on: macos-latest
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Install Puppet Development Kit
+ run: brew install --cask puppetlabs/puppet/pdk
+
+ - name: Checkout Code
+ uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
+ with:
+ fetch-depth: 0
+
+ - name: Install Ruby Gems
+ working-directory: ./ee/tools/puppet/fleetdm/
+ run: /opt/puppetlabs/pdk/bin/pdk bundle install
+
+ - name: Run Tests
+ working-directory: ./ee/tools/puppet/fleetdm/
+ run: /opt/puppetlabs/pdk/bin/pdk test unit
+
+ - name: Run Rubocop
+ working-directory: ./ee/tools/puppet/fleetdm/
+ run: /opt/puppetlabs/pdk/bin/pdk bundle exec rubocop
+
+ - name: Run Linter
+ working-directory: ./ee/tools/puppet/fleetdm/
+ run: /opt/puppetlabs/pdk/bin/pdk bundle exec puppet-lint .
+
diff --git a/.github/workflows/test-vulnerability-dashboard-changes.yml b/.github/workflows/test-vulnerability-dashboard-changes.yml
new file mode 100644
index 000000000..d2c5cb45f
--- /dev/null
+++ b/.github/workflows/test-vulnerability-dashboard-changes.yml
@@ -0,0 +1,58 @@
+on:
+ pull_request:
+ paths:
+ - 'ee/vulnerability-dashboard/**'
+ - '.github/workflows/test-vulnerability-dashboard-changes.yml'
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ permissions:
+ contents: read
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [16.x]
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+
+ # Set the Node.js version
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+
+ # Now start building!
+ # > …but first, get a little crazy for a sec and delete the top-level package.json file
+ # > i.e. the one used by the Fleet server. This is because require() in node will go
+ # > hunting in ancestral directories for missing dependencies, and since some of the
+ # > bundled transpiler tasks sniff for package availability using require(), this trips
+ # > up when it encounters another Node universe in the parent directory.
+ - run: rm -rf package.json package-lock.json node_modules/
+ # > Turns out there's a similar issue with how eslint plugins are looked up, so we
+ # > delete the top level .eslintrc file too.
+ - run: rm -f .eslintrc.js
+
+ # Get dependencies (including dev deps)
+ - run: cd ee/vulnerability-dashboard/ && npm install
+
+ # Run sanity checks
+ - run: cd ee/vulnerability-dashboard/ && npm test
+
+ # Compile assets
+ - run: cd ee/vulnerability-dashboard/ && npm run build-for-prod
diff --git a/.github/workflows/test-website.yml b/.github/workflows/test-website.yml
index cf2470efd..3045c9d4a 100644
--- a/.github/workflows/test-website.yml
+++ b/.github/workflows/test-website.yml
@@ -3,11 +3,12 @@ name: Test Fleet website
on:
pull_request:
paths:
- - 'website/**'
- - 'docs/**'
- - 'handbook/**'
- - 'schema/**'
- - 'articles/**'
+ - "website/**"
+ - "docs/**"
+ - "handbook/**"
+ - "schema/**"
+ - "articles/**"
+ - ".github/workflows/test-website.yml"
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
@@ -28,33 +29,41 @@ jobs:
strategy:
matrix:
- node-version: [14.x]
+ node-version: [16.x]
steps:
- - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
- # Set the Node.js version
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
- with:
- node-version: ${{ matrix.node-version }}
+ - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- # Now start building!
- # > …but first, get a little crazy for a sec and delete the top-level package.json file
- # > i.e. the one used by the Fleet server. This is because require() in node will go
- # > hunting in ancestral directories for missing dependencies, and since some of the
- # > bundled transpiler tasks sniff for package availability using require(), this trips
- # > up when it encounters another Node universe in the parent directory.
- - run: rm -rf package.json package-lock.json node_modules/
- # > Turns out there's a similar issue with how eslint plugins are looked up, so we
- # > delete the top level .eslintrc file too.
- - run: rm -f .eslintrc.js
+ # Set the Node.js version
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ with:
+ node-version: ${{ matrix.node-version }}
- # Get dependencies (including dev deps)
- - run: cd website/ && npm install
+ # Download top-level dependencies and build Storybook in the website's assets/ folder.
+ - run: npm install --legacy-peer-deps && npm run build-storybook -- -o ./website/assets/storybook --loglevel verbose
- # Run sanity checks
- - run: cd website/ && npm test
+ # Now start building!
+ # > …but first, get a little crazy for a sec and delete the top-level package.json file
+ # > i.e. the one used by the Fleet server. This is because require() in node will go
+ # > hunting in ancestral directories for missing dependencies, and since some of the
+ # > bundled transpiler tasks sniff for package availability using require(), this trips
+ # > up when it encounters another Node universe in the parent directory.
+ - run: rm -rf package.json package-lock.json node_modules/
+ # > Turns out there's a similar issue with how eslint plugins are looked up, so we
+ # > delete the top level .eslintrc file too.
+ - run: rm -f .eslintrc.js
- # Compile assets
- - run: cd website/ && BUILD_SCRIPT_ARGS="--githubAccessToken=${{ secrets.FLEET_RELEASE_GITHUB_PAT }}" npm run build-for-prod
+ # Get dependencies (including dev deps)
+ - run: cd website/ && npm install
+
+ # Run sanity checks
+ - run: cd website/ && npm test
+
+ # Compile assets
+ - run: cd website/ && BUILD_SCRIPT_ARGS="--githubAccessToken=${{ secrets.FLEET_GITHUB_TOKEN_FOR_WEBSITE_TEST }}" npm run build-for-prod
diff --git a/.github/workflows/test-yml-specs.yml b/.github/workflows/test-yml-specs.yml
index 243c12d0b..75e46d6af 100644
--- a/.github/workflows/test-yml-specs.yml
+++ b/.github/workflows/test-yml-specs.yml
@@ -5,6 +5,7 @@ on:
branches:
- main
- patch-*
+ - prepare-*
paths:
- 'ee/cis/**.yml'
- '.github/workflows/test-yml-specs.yml'
@@ -32,17 +33,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
- go-version: ['^1.19.10']
+ go-version: ['${{ vars.GO_VERSION }}']
runs-on: ${{ matrix.os }}
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Install Go
- uses: actions/setup-go@v2.1.3
+ uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Run apply spec tests
run: |
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index 85c46e3a9..000000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,96 +0,0 @@
-name: Run Tests
-
-on:
- push:
- branches:
- - main
- - patch-*
- pull_request:
- paths:
- - assets/**
- - frontend/**
- - package.json
- - yarn.lock
- - webpack.config.js
- - tsconfig.json
-
-# This allows a subsequently queued workflow run to interrupt previous runs
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
- cancel-in-progress: true
-
-defaults:
- run:
- # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
- shell: bash
-
-permissions:
- contents: read
-
-jobs:
- test-js:
- strategy:
- matrix:
- os: [ubuntu-latest]
- runs-on: ${{ matrix.os }}
-
- steps:
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
-
- - name: JS Dependency Cache
- id: js-cache
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
- with:
- path: |
- **/node_modules
- ~/.cache/Cypress
- key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-modules-
-
- - name: Install JS Dependencies
- if: steps.js-cache.outputs.cache-hit != 'true'
- run: make deps-js
-
- - name: Run JS Tests
- run: |
- yarn test:ci
-
- - name: Upload to Codecov
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
- with:
- flags: frontend
-
- lint-js:
- strategy:
- matrix:
- os: [ubuntu-latest]
- runs-on: ${{ matrix.os }}
-
- steps:
- - name: Checkout Code
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2
-
- - name: JS Dependency Cache
- id: js-cache
- uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v2
- with:
- path: |
- **/node_modules
- ~/.cache/Cypress
- key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-modules-
-
- - name: Install JS Dependencies
- if: steps.js-cache.outputs.cache-hit != 'true'
- run: make deps-js
-
- - name: Run JS Linting
- run: |
- make lint-js
-
- - name: Run prettier formatting check
- run: |
- yarn prettier:check
diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml
deleted file mode 100644
index 84fbec2b6..000000000
--- a/.github/workflows/tfsec.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-name: tfsec
-
-on:
- push:
- branches:
- - main
- paths:
- - '**.tf'
- pull_request:
- paths:
- - '**.tf'
- workflow_dispatch: # Manual dispatch
-
-# This allows a subsequently queued workflow run to interrupt previous runs
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
- cancel-in-progress: true
-
-defaults:
- run:
- # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
- shell: bash
-
-permissions:
- contents: read
-
-jobs:
- tfsec:
- permissions:
- contents: read # for actions/checkout to fetch code
- security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
- name: tfsec sarif report
- runs-on: ubuntu-latest
-
- steps:
- - name: Clone repo
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
-
- - name: tfsec
- uses: tfsec/tfsec-sarif-action@21ded20e8ca120cd9d3d6ab04ef746477542a608
- with:
- sarif_file: tfsec.sarif
-
- - name: Upload SARIF file
- uses: github/codeql-action/upload-sarif@32dc499307d133bb5085bae78498c0ac2cf762d5
- with:
- # Path to SARIF file relative to the root of the repository
- sarif_file: tfsec.sarif
diff --git a/.github/workflows/tfvalidate.yml b/.github/workflows/tfvalidate.yml
index ce2479198..6513377a0 100644
--- a/.github/workflows/tfvalidate.yml
+++ b/.github/workflows/tfvalidate.yml
@@ -30,11 +30,16 @@ jobs:
runs-on: ubuntu-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Clone repo
- uses: actions/checkout@v3
+ uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install terraform
- uses: hashicorp/setup-terraform@v2
+ uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: 1.3.0
diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml
new file mode 100644
index 000000000..9e0686c46
--- /dev/null
+++ b/.github/workflows/trivy-scan.yml
@@ -0,0 +1,58 @@
+name: Trivy vulnerability scan
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - "**.tf"
+ pull_request:
+ paths:
+ - "**.tf"
+ workflow_dispatch:
+ schedule:
+ - cron: "0 4 * * *" # Nightly 4AM UTC
+
+# This allows a subsequently queued workflow run to interrupt previous runs
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
+ shell: bash
+
+permissions:
+ contents: read
+
+jobs:
+ trivy:
+ permissions:
+ contents: read # for actions/checkout to fetch code
+ security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
+ name: Trivy sarif report
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
+ - name: Checkout code
+ uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
+
+ - name: Run Trivy vulnerability scanner in repo mode
+ uses: aquasecurity/trivy-action@062f2592684a31eb3aa050cc61e7ca1451cecd3d # 0.18.0
+ with:
+ scan-type: "fs"
+ ignore-unfixed: false
+ format: "sarif"
+ output: "trivy-results.sarif"
+ severity: "CRITICAL,HIGH,MEDIUM,LOW"
+ trivyignores: ".trivyignore"
+
+ - name: Upload Trivy scan results to GitHub Security tab
+ uses: github/codeql-action/upload-sarif@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
+ with:
+ sarif_file: "trivy-results.sarif"
diff --git a/.github/workflows/trivy_scan.yml b/.github/workflows/trivy_scan.yml
deleted file mode 100644
index bbfa763f4..000000000
--- a/.github/workflows/trivy_scan.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: Trivy vulnerability scan
-on:
- workflow_dispatch:
- schedule:
- - cron: '0 4 * * *' # Nightly 4AM UTC
-jobs:
- build:
- name: Trivy
- runs-on: ubuntu-20.04
- steps:
- - name: Checkout code
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
-
- - name: Run Trivy vulnerability scanner in repo mode
- uses: aquasecurity/trivy-action@8bd2f9fbda2109502356ff8a6a89da55b1ead252 # master
- with:
- scan-type: 'fs'
- ignore-unfixed: true
- format: 'sarif'
- output: 'trivy-results.sarif'
- severity: 'CRITICAL'
- skip-dirs: 'website/,tools/,infrastructure/,test/,orbit/pkg/insecure/'
- trivyignores: '.trivyignore'
- security-checks: 'vuln'
-
- - name: Upload Trivy scan results to GitHub Security tab
- uses: github/codeql-action/upload-sarif@32dc499307d133bb5085bae78498c0ac2cf762d5 # v2.2.5
- with:
- sarif_file: 'trivy-results.sarif'
diff --git a/.github/workflows/update-certs.yml b/.github/workflows/update-certs.yml
index 1aa054f68..c5227657f 100644
--- a/.github/workflows/update-certs.yml
+++ b/.github/workflows/update-certs.yml
@@ -25,6 +25,11 @@ jobs:
pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-latest
steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
+ with:
+ egress-policy: audit
+
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v.24.0
diff --git a/.gitignore b/.gitignore
index 8e4d2f013..ec2db762a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,15 +37,11 @@ mysqldata/
# test helm charts
helm-temp
+charts/fleet/charts
#editors
.idea
-# Cypress e2e testing
-cypress/screenshots
-cypress/videos
-cypress/downloads
-
# Fleet local development DB backups
backup.sql.gz
@@ -94,3 +90,17 @@ orbit/cmd/desktop/manifest.xml
orbit/cmd/desktop/resource.syso
orbit/cmd/orbit/manifest.xml
orbit/cmd/orbit/resource.syso
+
+# Residual files from osqueryd loadtests.
+osquery_worker_*.jpg
+
+# Residual files when building fleetd_tables extension.
+fleetd_tables_*
+
+# Location of test extensions executables
+tools/test_extensions/hello_world/macos
+tools/test_extensions/hello_world/windows
+tools/test_extensions/hello_world/linux
+
+# Residual files when building fleet_tables extension.
+fleet_tables_*.ext
diff --git a/.golangci.yml b/.golangci.yml
index e87d090f3..2e31094f1 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -17,10 +17,11 @@ linters:
linters-settings:
depguard:
- list-type: denylist
- include-go-stdlib: false
- packages-with-error-message:
- - github.com/pkg/errors: "use ctxerr if a context.Context is available or stdlib errors.New / fmt.Errorf with the %w verb"
+ rules:
+ main:
+ deny:
+ - pkg: github.com/pkg/errors
+ desc: "use ctxerr if a context.Context is available or stdlib errors.New / fmt.Errorf with the %w verb"
errcheck:
check-type-assertions: false
diff --git a/.goreleaser-snapshot.yml b/.goreleaser-snapshot.yml
index 742110852..a514c952d 100644
--- a/.goreleaser-snapshot.yml
+++ b/.goreleaser-snapshot.yml
@@ -27,12 +27,12 @@ builds:
- -trimpath
ldflags:
- -extldflags "-static"
- - -X github.com/kolide/kit/version.appName={{ .ArtifactName }}
- - -X github.com/kolide/kit/version.version={{ .Version }}
- - -X github.com/kolide/kit/version.branch={{ .Branch }}
- - -X github.com/kolide/kit/version.revision={{ .FullCommit }}
- - -X github.com/kolide/kit/version.buildDate={{ time "2006-01-02" }}
- - -X github.com/kolide/kit/version.buildUser={{ .Env.USER }}
+ - -X github.com/fleetdm/fleet/v4/server/version.appName={{ .ArtifactName }}
+ - -X github.com/fleetdm/fleet/v4/server/version.version={{ .Version }}
+ - -X github.com/fleetdm/fleet/v4/server/version.branch={{ .Branch }}
+ - -X github.com/fleetdm/fleet/v4/server/version.revision={{ .FullCommit }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }}
- id: fleetctl
dir: ./cmd/fleetctl/
@@ -46,12 +46,12 @@ builds:
flags:
- -trimpath
ldflags:
- - -X github.com/kolide/kit/version.appName={{ .ArtifactName }}
- - -X github.com/kolide/kit/version.version={{ .Version }}
- - -X github.com/kolide/kit/version.branch={{ .Branch }}
- - -X github.com/kolide/kit/version.revision={{ .FullCommit }}
- - -X github.com/kolide/kit/version.buildDate={{ time "2006-01-02" }}
- - -X github.com/kolide/kit/version.buildUser={{ .Env.USER }}
+ - -X github.com/fleetdm/fleet/v4/server/version.appName={{ .ArtifactName }}
+ - -X github.com/fleetdm/fleet/v4/server/version.version={{ .Version }}
+ - -X github.com/fleetdm/fleet/v4/server/version.branch={{ .Branch }}
+ - -X github.com/fleetdm/fleet/v4/server/version.revision={{ .FullCommit }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }}
dockers:
diff --git a/.goreleaser.yml b/.goreleaser.yml
index d44c472f2..e4fa880ed 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -27,12 +27,12 @@ builds:
- -trimpath
ldflags:
- -extldflags "-static"
- - -X github.com/kolide/kit/version.appName={{ .ArtifactName }}
- - -X github.com/kolide/kit/version.version={{ .Version }}
- - -X github.com/kolide/kit/version.branch={{ .Branch }}
- - -X github.com/kolide/kit/version.revision={{ .FullCommit }}
- - -X github.com/kolide/kit/version.buildDate={{ time "2006-01-02" }}
- - -X github.com/kolide/kit/version.buildUser={{ .Env.USER }}
+ - -X github.com/fleetdm/fleet/v4/server/version.appName={{ .ArtifactName }}
+ - -X github.com/fleetdm/fleet/v4/server/version.version={{ .Version }}
+ - -X github.com/fleetdm/fleet/v4/server/version.branch={{ .Branch }}
+ - -X github.com/fleetdm/fleet/v4/server/version.revision={{ .FullCommit }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }}
- id: fleetctl
dir: ./cmd/fleetctl/
@@ -40,7 +40,6 @@ builds:
env:
- CGO_ENABLED=0
goos:
- - darwin
- linux
- windows
goarch:
@@ -48,20 +47,44 @@ builds:
flags:
- -trimpath
ldflags:
- - -X github.com/kolide/kit/version.appName={{ .ArtifactName }}
- - -X github.com/kolide/kit/version.version={{ .Version }}
- - -X github.com/kolide/kit/version.branch={{ .Branch }}
- - -X github.com/kolide/kit/version.revision={{ .FullCommit }}
- - -X github.com/kolide/kit/version.buildDate={{ time "2006-01-02" }}
- - -X github.com/kolide/kit/version.buildUser={{ .Env.USER }}
+ - -X github.com/fleetdm/fleet/v4/server/version.appName={{ .ArtifactName }}
+ - -X github.com/fleetdm/fleet/v4/server/version.version={{ .Version }}
+ - -X github.com/fleetdm/fleet/v4/server/version.branch={{ .Branch }}
+ - -X github.com/fleetdm/fleet/v4/server/version.revision={{ .FullCommit }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }}
+
+ - id: fleetctl-macos
+ dir: ./cmd/fleetctl/
+ binary: fleetctl
+ env:
+ - CGO_ENABLED=0
+ goos:
+ - darwin
+ goarch:
+ - amd64
+ - arm64
+ flags:
+ - -trimpath
+ ldflags:
+ - -X github.com/fleetdm/fleet/v4/server/version.appName={{ .ArtifactName }}
+ - -X github.com/fleetdm/fleet/v4/server/version.version={{ .Version }}
+ - -X github.com/fleetdm/fleet/v4/server/version.branch={{ .Branch }}
+ - -X github.com/fleetdm/fleet/v4/server/version.revision={{ .FullCommit }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildDate={{ time "2006-01-02" }}
+ - -X github.com/fleetdm/fleet/v4/server/version.buildUser={{ .Env.USER }}
+
+universal_binaries:
+ - id: fleetctl # resulting binary id
+ ids: [fleetctl-macos] # source binaries
+ replace: true
+ name_template: fleetctl # resulting binary name
archives:
- id: fleet
builds:
- fleet
- name_template: fleet_v{{.Version}}_{{.Os}}
- replacements:
- darwin: macos
+ name_template: fleet_v{{.Version}}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}
format_overrides:
- goos: windows
format: zip
@@ -70,18 +93,14 @@ archives:
- id: fleetctl
builds:
- fleetctl
- name_template: fleetctl_v{{.Version}}_{{.Os}}
- replacements:
- darwin: macos
+ name_template: fleetctl_v{{.Version}}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}
wrap_in_directory: true
- id: fleetctl-zip
builds:
- fleetctl
- name_template: fleetctl_v{{.Version}}_{{.Os}}
+ name_template: fleetctl_v{{.Version}}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}
format: zip
- replacements:
- darwin: macos
wrap_in_directory: true
dockers:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 000000000..aee960260
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,35 @@
+repos:
+- repo: https://github.com/digitalpulp/pre-commit-php
+ rev: 1.4.0
+ hooks:
+ - id: php-lint-all
+- repo: https://github.com/gitleaks/gitleaks
+ rev: v8.16.3
+ hooks:
+ - id: gitleaks
+- repo: https://github.com/golangci/golangci-lint
+ rev: v1.52.2
+ hooks:
+ - id: golangci-lint
+- repo: https://github.com/jumanjihouse/pre-commit-hooks
+ rev: 3.0.0
+ hooks:
+ - id: RuboCop
+ - id: shellcheck
+- repo: https://github.com/pocc/pre-commit-hooks
+ rev: v1.3.5
+ hooks:
+ - id: cpplint
+- repo: https://github.com/pre-commit/mirrors-eslint
+ rev: v8.38.0
+ hooks:
+ - id: eslint
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.4.0
+ hooks:
+ - id: end-of-file-fixer
+ - id: trailing-whitespace
+- repo: https://github.com/pylint-dev/pylint
+ rev: v2.17.2
+ hooks:
+ - id: pylint
diff --git a/.prettierignore b/.prettierignore
index bd3ee8cac..9bc2a3577 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -28,11 +28,6 @@ tmp/
.vscode
.idea
-# Cypress e2e testing
-cypress/screenshots
-cypress/videos
-cypress/downloads
-
# fleetdm.com website (uses its own formatting conventions)
website/
diff --git a/.storybook/main.ts b/.storybook/main.ts
index 79e3c4765..a77c72a42 100644
--- a/.storybook/main.ts
+++ b/.storybook/main.ts
@@ -52,7 +52,7 @@ const config: StorybookConfig = {
"@storybook/addon-mdx-gfm",
"@storybook/addon-a11y",
"@storybook/test-runner",
- "storybook-addon-designs",
+ "@storybook/addon-designs",
],
typescript: {
check: false,
diff --git a/.yarnrc b/.yarnrc
new file mode 100644
index 000000000..fdd705c63
--- /dev/null
+++ b/.yarnrc
@@ -0,0 +1 @@
+save-prefix ""
diff --git a/16538-preserve-manage-query-automations-modal-state b/16538-preserve-manage-query-automations-modal-state
new file mode 100644
index 000000000..d8ea5ca98
--- /dev/null
+++ b/16538-preserve-manage-query-automations-modal-state
@@ -0,0 +1,2 @@
+- Fix a bug where the manage query automations modal would lose its state when the user clicks
+ "Preview data"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 430ee720d..9057a35aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,1024 @@
+## Fleet 4.48.0 (Apr 02, 2024)
+
+### Bug fixes
+
+## Changelog
+
+### Endpoint operations
+
+- Added integration with Google Calendar.
+
+* Fleet admins can enable Google Calendar integration by using a Google service account with domain-wide delegation.
+* Calendar integration is enabled at the team level for specific team policies.
+* If the policy is failing, a calendar event will be put on the host user's calendar for the 3rd Tuesday of the month.
+* During the event, Fleet will fire a webhook. IT admins should use this webhook to trigger a script or MDM command that will remediate the issue.
+
+- Reduced the number of 'Deadlock found' errors seen by the server when multiple hosts share the same UUID.
+- Removed outdated tooltips from UI.
+- Added hover states to clickable elements.
+- Added cross-platform check for duplicate MDM profiles names in batch set MDM profiles API.
+
+### Device management (MDM)
+
+- Added Windows MDM support to the `osquery-perf` host-simulation command.
+- Added a missing database index to the MDM Windows enrollments table that will improve performance at scale.
+- Migrate MDM-related endpoints to new paths, deprecating (but still supporting indefinitely) the old endpoints.
+- Adds API functionality for creating DDM declarations, both individually and as a batch.
+- Added DDM activities to the fleet UI.
+- Added the `enable_release_device_manually` configuration setting for a team and no team. **Note** that the macOS automatic enrollment profile cannot set the `await_device_configured` option anymore, this setting is controlled by Fleet via the new `enable_release_device_manually` option.
+- Automatically release a macOS DEP-enrolled device after enrollment commands and profiles have been delivered, unless `enable_release_device_manually` is set to `true`.
+
+### Vulnerability management
+
+- Added Visual Studio extensions to Fleet's software inventory.
+
+### Bug fixes
+
+- Fixed a bug where valid MDM enrollments would show up as unmanaged (EnrollmentState 3).
+- Fixed flash message from closing when a modal closes.
+- Fixed a bug where OS version information would not get detected on Windows Server 2019.
+- Fixed issue where getting host details failed when attempting to read the host's bitlocker status from the datastore.
+- Fixed false negative vulnerabilities on macOS Homebrew python packages.
+- Fixed styling of live query disabled warning.
+- Fixed issue where Windows MDM profile processing was skipping `