Skip to content

Enhance configuration profiles with name and description - #52986

Merged
rachaelshaw merged 6 commits into
docs-v4.94.0from
melpike-add-configuration-page-51814
Sep 24, 2026
Merged

rachaelshaw merged 6 commits into
docs-v4.94.0from
melpike-add-configuration-page-51814

Conversation

@melpike

@melpike melpike commented Sep 10, 2026

Copy link
Copy Markdown
Member

Added 'name' and 'description' fields for configuration profiles in macOS and Windows settings.

Related issue: Resolves #51814

Added 'name' and 'description' fields for configuration profiles in macOS and Windows settings.
Added optional 'description' field for profiles in the API documentation.
@melpike
melpike marked this pull request as ready for review September 24, 2026 16:46
Updated the parameters section to include payload_display_name for configuration profiles.
@rachaelshaw
rachaelshaw merged commit 51a42da into docs-v4.94.0 Sep 24, 2026
6 checks passed
@rachaelshaw
rachaelshaw deleted the melpike-add-configuration-page-51814 branch September 24, 2026 22:17
jbelbo added a commit that referenced this pull request Oct 2, 2026
**Related issue:** #51814

Third of four stacked PRs for #51814, based on #54195 (the API). This
one carries `name` and `description` through GitOps YAML. The new
add/edit profile page follows in the last PR.

## What

- **YAML**: entries under `configuration_profiles` (`apple_settings`,
`windows_settings`, `android_settings`) take optional `name` and
`description`, and fleetctl sends them to the batch endpoint. Without
`name`, the name is derived as before: `PayloadDisplayName` for
.mobileconfig, the file name for .xml and .json.
- **Globs**: `name` is only valid on `path:` or on a `paths:` glob that
matches a single file, since names are unique per fleet. On a glob that
matches more than one file, GitOps fails with an error naming the
pattern. `description` applies to every matched file, like labels.
- **Omitted description**: GitOps replaces the whole set, so removing
`description` from the YAML clears it, like labels.
- **Renames**: renaming a .mobileconfig through `name` keeps the same
profile (matched by `PayloadIdentifier`) and doesn't re-send it.
Windows, Android and declaration profiles are matched by name, so
renaming one through GitOps re-creates it and hosts install it again.
This is the exception noted in the changes file.
- **generate-gitops**: always writes `name`, because the generated file
name is a sanitized copy of it (e.g. `defender-rtp-(yaml-v2).xml`), and
leaving it out would rename profiles on the next run. It writes
`description` when set.
- **Policies**: `resend_configuration_profile` resolves against the YAML
name when one is set.
- **Stored settings**: fleet specs keep `name` and `description` in
`apple_settings.configuration_profiles` (`MacOSSettings.FromMap` copies
them now), and the legacy `fleetctl apply` path reads them.

## Steps to reproduce

On `main`, a profile's name can't be set from YAML: GitOps always
derives it from the file, and there's no `description`. With this PR:

1. Add `name: Camera off` and `description: Blocks the camera` to a
.mobileconfig entry and run `fleetctl gitops`. The profile is listed as
"Camera off" with that description.
2. Change the `name` and run again. The profile keeps its UUID and
upload time.
3. Put `name` on a `paths:` glob that matches two files. `fleetctl
gitops` fails with `"name" can't be used with a "paths" glob that
matches more than one file`.

## How I tested

- Unit tests: `go test ./pkg/spec/ ./server/fleet/`, `go test
./server/service/ -run TestGetProfilesContentsNameAndDescription`, and
`go test ./cmd/fleetctl/fleetctl/ -run 'TestGenerate|GitOps'` with
`MYSQL_TEST=1 REDIS_TEST=1`. New tests cover the glob rule, description
fan-out, the policy reference, `MDMProfileSpecsMatch`, `FromMap`, the
legacy apply path, and generate-gitops output.
- `MYSQL_TEST=1 REDIS_TEST=1 go test
./cmd/fleetctl/integrationtest/gitops/` passes.
- `make lint-go-incremental`: 0 issues.
- End to end with `fleetctl gitops` against a local server with Apple
and Windows MDM, checked in the UI and API:
- A new fleet with named and unnamed .mobileconfig, Windows and
declaration profiles, and a glob with a description.
- Re-applying the same YAML changes nothing and logs no profile
activities.
  - Renames, description changes and removals behave as described above.
  - A UI edit is reverted by the next run.
  - generate-gitops output applies with no changes.
  - Unassigned profiles work the same way.
- Not tested: Android end to end, since the local server has no Android
MDM. The same code path is covered by the unit tests.

# Checklist for submitter

- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
Not in this PR: the changes file is in #54195 and already covers GitOps.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.

## Testing

- [x] Added/updated automated tests

- [x] QA'd all new/changed functionality manually

## New Fleet configuration settings

- [ ] Setting(s) is/are explicitly excluded from GitOps

If you didn't check the box above, follow this checklist for
GitOps-enabled settings:

- [x] Verified that the setting is exported via `fleetctl
generate-gitops`
- [x] Verified the setting is documented in a separate PR to [the GitOps
documentation](https://github.com/fleetdm/fleet/blob/main/docs/Configuration/yaml-files.md#L485)
  #52986, against `docs-v4.94.0`.
- [x] Verified that the setting is cleared on the server if it is not
supplied in a YAML file (or that it is documented as being optional)
An omitted `description` is cleared; an omitted `name` falls back to the
derived name.
- [x] Verified that any relevant UI is disabled when GitOps mode is
enabled
Editing name and description in the UI comes with the page PR, which
disables it in GitOps mode.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* GitOps configuration profiles now support explicit names and
descriptions across Apple, Windows, and Android profiles. Explicit names
are used to identify profiles for resend operations.
* **Bug Fixes**
* Profiles whose names sanitize to the same filename now receive
separate output files.
* GitOps validation reports an error when a named profile uses a `paths`
pattern matching multiple files; use `path` to specify a single profile.
* Batch profile updates can exchange or pass names between profiles
without failing due to duplicate-name conflicts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

This branch was previously deployed

1 inactive deployment
Docker Hub — 92bac4d8 Deployed Sep 24, 2026 by melpike via publish #105997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants