Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fed3911
Add new teams
noahtalerman Jan 29, 2026
56f5276
Remove strucutre
noahtalerman Jan 29, 2026
0eb6451
Add strings around secret
noahtalerman Jan 29, 2026
e221834
Global enroll secret
noahtalerman Jan 29, 2026
9319696
Add changes
noahtalerman Jan 29, 2026
c00f7b8
Update YAML
noahtalerman Feb 2, 2026
74ddeae
Update workflow.yml
noahtalerman Feb 2, 2026
d1beebb
Update default.yml
noahtalerman Feb 2, 2026
cf99532
Update teams/dedicated-devices.yml
noahtalerman Feb 2, 2026
7a355d7
Update teams/workstations.yml
noahtalerman Feb 2, 2026
85c8552
Update teams/employee-issued-mobile-devices.yml
noahtalerman Feb 2, 2026
1aac59b
Update teams/it-servers.yml
noahtalerman Feb 2, 2026
b0bac44
Update teams/personal-mobile-devices.yml
noahtalerman Feb 2, 2026
8d5595f
Shorten the README
noahtalerman Feb 3, 2026
d4a3d57
Fix README
noahtalerman Feb 3, 2026
d1b8fc5
Clean up
noahtalerman Feb 3, 2026
cce400e
Add learn how
noahtalerman Feb 3, 2026
161edf9
Update teams/workstations.yml
noahtalerman Feb 3, 2026
1bc1f95
Update teams/personal-mobile-devices.yml
noahtalerman Feb 3, 2026
5e48a6e
Update teams/workstations.yml
noahtalerman Feb 3, 2026
a22cd28
Update teams/dedicated-devices.yml
noahtalerman Feb 3, 2026
2b21a17
Update teams/employee-issued-mobile-devices.yml
noahtalerman Feb 3, 2026
ea7b15e
Update teams/it-servers.yml
noahtalerman Feb 3, 2026
f6afde6
Update default.yml
noahtalerman Feb 3, 2026
b5fa895
New filename
noahtalerman Feb 3, 2026
83a6a17
Update default.yml
noahtalerman Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,3 @@ jobs:
env:
FLEET_URL: ${{ secrets.FLEET_URL }}
FLEET_API_TOKEN: ${{ secrets.FLEET_API_TOKEN }}
FLEET_GLOBAL_ENROLL_SECRET: ${{ secrets.FLEET_GLOBAL_ENROLL_SECRET }}
FLEET_WORKSTATIONS_ENROLL_SECRET: ${{ secrets.FLEET_WORKSTATIONS_ENROLL_SECRET }}
FLEET_WORKSTATIONS_CANARY_ENROLL_SECRET: ${{ secrets.FLEET_WORKSTATIONS_CANARY_ENROLL_SECRET }}
29 changes: 7 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,25 @@

This is the starter repository for using [Fleet](https://fleetdm.com) with a GitOps workflow.

[Why use GitOps?](https://fleetdm.com/guides/sysadmin-diaries-gitops-a-strategic-advantage#basic-article)
[Why use GitOps?](https://fleetdm.com/guides/sysadmin-diaries-gitops-a-strategic-advantage)

## GitHub setup

1. Clone the [GitHub repository](https://github.com/fleetdm/fleet-gitops), create your own GitHub repository, and push your clone to your new repo. Note that a workflow will run once and fail because the required variables haven't been added (step 2 and 3).
1. Clone the [GitHub repository](https://github.com/fleetdm/fleet-gitops), create your own GitHub repository, and push your clone to your new repo. Note that a workflow will run once and fail because the required variables haven't been added (step 2).

2. Add `FLEET_URL` and `FLEET_API_TOKEN` secrets to your new repository's secrets. Learn how [here](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). Set `FLEET_URL` to your Fleet instance's URL (ex. https://organization.fleet.com). [Create an API-only user](https://fleetdm.com/docs/using-fleet/fleetctl-cli#create-api-only-user) with the "GitOps" role and set `FLEET_API_TOKEN` to your user's API token. If you're using Fleet Free, set the API-only user's role to global admin.

3. Add `FLEET_GLOBAL_ENROLL_SECRET` secret to your new repository's secrets. The enroll secret must be an alphanumeric string of at least 32 and at most 255 characters.
- If you have a Premium Fleet license, also add `FLEET_WORKSTATIONS_ENROLL_SECRET` and `FLEET_WORKSTATIONS_CANARY_ENROLL_SECRET`.
- If you do not have a Premium Fleet license, delete the `teams` directory.

4. If you are using secrets to manage SSO metadata for Fleet SSO login or MDM SSO login, uncomment lines 22 and 23 in `gitops.sh`.
- If you are using different variable names for your secrets, edit the appropriate line to reflect the correct variable name.

5. In GitHub, enable the `Apply latest configuration to Fleet` GitHub Actions workflow, and run workflow manually. Now, when anyone pushes a new commit to the default branch, the action will run and update Fleet. For pull requests, the workflow will do a dry run only.
3. In GitHub, enable the `Apply latest configuration to Fleet` GitHub Actions workflow, and run workflow manually. Now, when anyone pushes a new commit to the default branch, the action will run and update Fleet. For pull requests, the workflow will do a dry run only.

## GitLab setup

1. Clone the [GitLab repository](https://gitlab.com/fleetdm/fleet-gitops), create your own GitLab repository, and push your clone to your new repo. Note that a pipeline will run once and fail because the required variables haven't been added (step 2 and 3).
1. Clone the [GitLab repository](https://gitlab.com/fleetdm/fleet-gitops), create your own GitLab repository, and push your clone to your new repo. Note that a pipeline will run once and fail because the required variables haven't been added (step 2).

2. Add `FLEET_URL` and `FLEET_API_TOKEN` as masked CI/CD variables. Learn how [here](https://docs.gitlab.com/ee/ci/variables/#define-a-cicd-variable-in-the-ui). Set `FLEET_URL` to your Fleet instance's URL (ex. https://organization.fleet.com). Set `FLEET_API_TOKEN` to an API token for an API-only user in Fleet. Learn how [here](https://fleetdm.com/docs/using-fleet/fleetctl-cli#create-api-only-user), then, grant it the `GitOps` role via the **Settings** > **Users** page so it can make changes.

3. Add `FLEET_GLOBAL_ENROLL_SECRET` secret as a masked CI/CD variable. The enroll secret must be an alphanumeric string of at least 32 and at most 255 characters.
- If you have a Premium Fleet license, also add `FLEET_WORKSTATIONS_ENROLL_SECRET` and `FLEET_WORKSTATIONS_CANARY_ENROLL_SECRET`.
- If you do not have a Premium Fleet license, delete the `teams` directory.

4. If you are using secrets to manage SSO metadata for Fleet SSO login or MDM SSO login, uncomment lines 22 and 23 in `gitops.sh`.
- If you are using different variable names for your secrets, edit the appropriate line to reflect the correct variable name.
3. Now, when anyone pushes a new commit to the default branch, the pipeline will run and update Fleet. For merge requests, the pipeline will do a dry run only.

5. Now, when anyone pushes a new commit to the default branch, the pipeline will run and update Fleet. For merge requests, the pipeline will do a dry run only.

6. (Optional) To ensure your Fleet configuration stays up to date even when there are no new commits, set up a scheduled pipeline:
4. To ensure your Fleet configuration stays up to date even when there are no new commits, set up a scheduled pipeline:
- In your GitLab project, go to the left sidebar and navigate to **Build > Pipeline schedules**. (In some GitLab versions, this may appear as **CI/CD > Schedules**.)
- Click **Create a new pipeline schedule** (or **Schedule a new pipeline**).
- Fill in the form:
Expand All @@ -48,11 +34,10 @@ This is the starter repository for using [Fleet](https://fleetdm.com) with a Git

For all configuration options, go to the [YAML files reference](https://fleetdm.com/docs/using-fleet/gitops) in the Fleet docs.

## Fleet UI
## GitOps mode

Once you're set up with GitOps in Fleet, you can optionally put the UI in GitOps mode. This prevents you from making changes in the UI that would be overridden by GitOps workflows.

An admin can enable GitOps mode in **Settings** > **Integrations** > **Change management**.

Note that this is a UI-only setting. API permissions are restricted based on user role.

15 changes: 3 additions & 12 deletions default.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
# For Fleet Free:
# - This file updates policies, queries, agent_options, and controls for all hosts.

# For Fleet Premium:
# - This file updates policies and queries that run on all hosts ("All teams").
# - Remove "controls" and add this to your YAML files in teams/ instead.
# default.yml controls global settings and policies/queries that run on all hosts ("All teams").

policies:
queries:
agent_options:
path: ./lib/agent-options.yml
controls: # This cannot be set here and in no-team.yml
controls:
org_settings:
server_settings:
server_url: $FLEET_URL
org_info:
org_name: Fleet
secrets:
- secret: "$FLEET_GLOBAL_ENROLL_SECRET"
features:
enable_host_users: true
enable_software_inventory: true
- secret: "REPLACE_WITH_ENVIRONMENT_VARIABLE"
7 changes: 4 additions & 3 deletions gitops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ else
FLEET_DELETE_OTHER_TEAMS=false
fi

# Copy/pasting raw SSO metadata into GitHub secrets will result in malformed yaml.
# Adds spaces to all but the first line of metadata keeps the multiline string in bounds.
# See README for more information
# If you are using secrets to manage SSO metadata for Fleet SSO login or MDM SSO login, uncomment the below:

# FLEET_SSO_METADATA=$( sed '2,$s/^/ /' <<< "${FLEET_MDM_SSO_METADATA}")
# FLEET_MDM_SSO_METADATA=$( sed '2,$s/^/ /' <<< "${FLEET_MDM_SSO_METADATA}")

# Copy/pasting raw SSO metadata into GitHub secrets will result in malformed yaml.
# Adds spaces to all but the first line of metadata keeps the multiline string in bounds.

if compgen -G "$FLEET_GITOPS_DIR"/teams/*.yml > /dev/null; then
# Validate that every team has a unique name.
# This is a limited check that assumes all team files contain the phrase: `name: <team_name>`
Expand Down
40 changes: 0 additions & 40 deletions lib/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions lib/agent-options.yml

This file was deleted.

1 change: 1 addition & 0 deletions lib/all/agent-options/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/all/icons/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/all/labels/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/all/queries/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
7 changes: 0 additions & 7 deletions lib/all/queries/collect-failed-login-attempts.queries.yml

This file was deleted.

7 changes: 0 additions & 7 deletions lib/all/queries/collect-fleetd-update-channels.queries.yml

This file was deleted.

7 changes: 0 additions & 7 deletions lib/all/queries/collect-usb-devices.queries.yml

This file was deleted.

1 change: 1 addition & 0 deletions lib/ios/configuration-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/ios/declaration-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/ipados/configuration-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/ipados/declaration-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/linux/policies/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
5 changes: 0 additions & 5 deletions lib/linux/policies/linux-device-health.policies.yml

This file was deleted.

1 change: 1 addition & 0 deletions lib/linux/queries/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/linux/scripts/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/linux/software/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/macos/commands/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/macos/configuration-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
10 changes: 0 additions & 10 deletions lib/macos/configuration-profiles/passcode-settings-ddm.json

This file was deleted.

1 change: 1 addition & 0 deletions lib/macos/declaration-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/macos/enrollment-profiles/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
28 changes: 0 additions & 28 deletions lib/macos/enrollment-profiles/automatic-enrollment.dep.json

This file was deleted.

1 change: 1 addition & 0 deletions lib/macos/misc/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/macos/policies/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
52 changes: 0 additions & 52 deletions lib/macos/policies/macos-device-health.policies.yml

This file was deleted.

1 change: 1 addition & 0 deletions lib/macos/queries/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
1 change: 1 addition & 0 deletions lib/macos/scripts/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore this file. It only exists because git refuses to push empty directories to a remote server.
7 changes: 0 additions & 7 deletions lib/macos/scripts/collect-fleetd-logs.sh

This file was deleted.

2 changes: 0 additions & 2 deletions lib/macos/scripts/install-santa.sh

This file was deleted.

Loading