Documentation
¶
Overview ¶
Package profile composes, signs and parses Apple configuration profiles.
Design ¶
The package supplies the top-level envelope and common payload keys around generated schema/profiles values. Callers choose stable PayloadIdentifier and PayloadUUID values; a Resolver selects typed payloads during parsing. Attached CMS signing and signature-required parsing use mdmprotocol/cms.
Payload selection for MDM enrollment and OTA delivery belong to mdmprotocol/enroll. Preserving identifiers across updates is the caller's responsibility.
References ¶
- Decision record 0009: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0009-enrollment-profiles.md
- Decision record 0010: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/research/decisions/0010-ota-profile-service.md
- Threat model: https://github.com/deploymenttheory/go-apple-dm/blob/main/docs/security/threat-model.md (Enrollment profile row)
- Apple: https://developer.apple.com/documentation/devicemanagement/profile-specific-payload-keys
- Apple: https://developer.apple.com/documentation/devicemanagement/deploying-device-management-enrollment-profiles
- Schema: third_party/device-management/mdm/profiles/TopLevel.yaml, CommonPayloadKeys.yaml
- RFC 5652 (Cryptographic Message Syntax): https://www.rfc-editor.org/rfc/rfc5652
Index ¶
Constants ¶
const ( ScopeSystem = "System" ScopeUser = "User" )
Scope values for PayloadScope.
const PayloadTypeConfiguration = "Configuration"
PayloadTypeConfiguration is the top-level PayloadType of every profile.
Variables ¶
var ( ErrInvalid = errors.New("profile: invalid") ErrParse = errors.New("profile: parse") )
Errors returned by this package.
Functions ¶
func DefaultResolver ¶
DefaultResolver resolves a payload type through schema/profiles.
Types ¶
type ParseOptions ¶
type ParseOptions struct {
// Verify is applied when the data is CMS-signed. Roots nil means any
// embedded chain is accepted; see cms.VerifyOptions.
Verify cms.VerifyOptions
// RequireSignature rejects unsigned input.
RequireSignature bool
// Resolve overrides the registry lookup. The default resolves payload
// types with exactly one generated type and keeps the rest raw.
Resolve Resolver
// MaxBytes bounds the plist (default plist.Decoder default).
MaxBytes int
}
ParseOptions configure Parse.
type Parsed ¶
type Parsed struct {
Profile *Profile
// Signer is the certificate that signed the profile, nil when unsigned.
Signer *x509.Certificate
// Plist is the decoded (unsigned) plist bytes.
Plist []byte
}
Parsed is the result of Parse.
type Payload ¶
type Payload struct {
Identifier string
UUID string
Version int64 // default 1
DisplayName string
Description string
Organization string
// Content is the payload body, a type from schema/profiles or a Raw.
Content profiles.Payload
}
Payload is one entry in PayloadContent: the common keys plus a typed body.
type Profile ¶
type Profile struct {
Identifier string
UUID string
Version int64 // default 1
DisplayName string
Description string
Organization string
Scope string
RemovalDisallowed bool
Payloads []Payload
// Extra top-level keys emitted verbatim (ConsentText, RemovalDate...).
// Reserved keys set by the builder are ignored here.
Extra map[string]any
}
Profile is a configuration profile.
type Raw ¶
Raw is a payload whose body is kept as plist keys, for payload types with no generated type or where the registry cannot pick one.
func (*Raw) PayloadTypeName ¶
PayloadTypeName implements profiles.Payload.