# Manage OSMates for an organization

Set OSMates on your organization's Macs from your MDM.

A key you set wins over each person's settings, in every edition.

## Set the keys with a profile

1. Download the [sample profile](https://osmates.com/reference/managed-preferences.mobileconfig).
2. Change its keys to what your organization needs. Leave a key out to let people decide.
3. Add it to your MDM as a custom profile.
4. Assign it to the Macs or the people that use OSMates.

The keys reach running machines within 30 seconds.

If your MDM builds custom settings from a JSON schema, import the [schema of the keys](https://osmates.com/reference/managed-preferences.json) instead. The domain is `com.osmates.OSMates`.

## Keys

| Key | Value | Effect |
|---|---|---|
| `AllowShares` | `false` | No shared folders |
| `AllowClipboard` | `false` | No clipboard between machines and the Mac |
| `AllowDragAndDrop` | `false` | No files dragged onto or off a machine's window |
| `AllowRemoteLocal` | `false` | No MCP over HTTP on the Mac |
| `AllowRemoteNetwork` | `false` | No connections from the person's other Macs |
| `AllowRemoteTailnet` | `false` | No browser at the Mac's tailnet name, and no cloud clients |
| `AllowRemoteCloudClients` | `false` | No cloud clients through Tailscale Funnel |
| `RequiredEgress` | `allowlist` or `blocked` | The widest network access a machine may have |
| `EgressRules` | Rules, such as `preset:packages` | The only destinations an allowlist may hold |
| `AuditExportFolder` | A folder, such as `~/Library/Logs/OSMates Audit` | Where the [audit trail is exported](https://osmates.com/docs/audit-export) each day |
| `AuditExportKeep` | A number from 1 to 3650 | How many exports that folder keeps, 30 by default |
| `ImageRepositories` | Repositories, such as `ghcr.io/acme/templates` | Where your team's templates come from |
| `AllowOtherMachineSources` | `false` | New machines come only from those templates |
| `ImageSigningKeys` | Public keys from `cosign.pub` | Every template pulled must be signed with one of them |
| `AllowsReports` | `false` | No [crash reports or usage statistics](https://osmates.com/docs/diagnostics#send-crash-reports-and-usage-statistics) |

Rules use the syntax in [Limit what a machine reaches](https://osmates.com/docs/egress). `EgressRules` on its own requires an allowlist.

For the Windows guest agent under Smart App Control or Intune, see [Allow the Windows guest agent](https://osmates.com/docs/windows-guest-agent).

## Require your team's templates

1. Push each template with a publisher, as in [Share templates through a registry](https://osmates.com/docs/registries).
2. Sign the digest the push printed with [cosign](https://docs.sigstore.dev/cosign/signing/signing_with_containers/).
3. Add `ImageRepositories` to the profile, with the repository.
4. Add `ImageSigningKeys`, with the text of `cosign.pub`.
5. To allow no other source for new machines, add `AllowOtherMachineSources` set to `false`.

To push and sign a template named `base`, replacing `<digest>` with the digest the push printed:

```sh
osmates template push base ghcr.io/acme/templates:1.0 --publisher "Platform team"
cosign sign --key cosign.key --tlog-upload=false ghcr.io/acme/templates@sha256:<digest>
```

People see the images in New Machine and with `osmates template list --remote`. Each pull is checked against the image's digest and signature before anything is written. An unsigned image, or one signed with another key, is refused.

With `AllowOtherMachineSources` set to `false`, people can't install a system, import a machine, or clone anything but your templates.

## See what applies on a Mac

A setting a key manages is dimmed, with "Managed by your organization." under it. Look in **Remote** settings, and in the **Sharing** and **Network** panes of Machine Settings.

To list each managed key with its value:

```sh
osmates policy
```

## What people see

A request a key forbids fails and names the key, in the app, in Terminal, and for agents.

A machine keeps its own settings, and each start runs it within your keys. Open network access becomes the destinations `EgressRules` allows. Remove the profile, and the machine's own settings come back at its next start.

## Limits

- Only a profile sets a key, from an MDM or installed in System Settings. A person's own preferences set nothing.
- With `RequiredEgress` and no `EgressRules`, people choose the destinations.
- A value of the wrong type turns its key off, or to `blocked`. `osmates policy` shows the problem.
- `osmates policy` doesn't list `AllowsReports`. Once it goes, reports stay off until the person turns them on.
- Whether this Mac can connect to another Mac depends on that Mac's `AllowRemoteNetwork`.
- A key in `ImageSigningKeys` is an ECDSA P-256 key, as `cosign generate-key-pair` makes. OSMates reads cosign 3's default signature format.
- Signatures aren't checked against Sigstore's transparency log. Remove a key from the profile to stop trusting it.
