types

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeviceInformationQueries = []string{"ActiveManagedUsers", "AppAnalyticsEnabled", "AutoSetupAdminAccounts", "AvailableDeviceCapacity", "AwaitingConfiguration", "BatteryLevel", "BluetoothMAC", "BuildVersion", "CarrierSettingsVersion", "CellularTechnology", "CurrentMCC", "CurrentMNC", "DataRoamingEnabled", "DeviceCapacity", "DeviceID", "DeviceName", "DiagnosticSubmissionEnabled", "EASDeviceIdentifier", "ICCID", "IMEI", "IsActivationLockEnabled", "IsCloudBackupEnabled", "IsDeviceLocatorServiceEnabled", "IsDoNotDisturbInEffect", "IsMDMLostModeEnabled", "IsMultiUser", "IsNetworkTethered", "IsRoaming", "IsSupervised", "iTunesStoreAccountHash", "iTunesStoreAccountIsActive", "LastCloudBackupDate", "MaximumResidentUsers", "MDMOptions", "MEID", "Model", "ModelName", "ModemFirmwareVersion", "OrganizationInfo", "OSUpdateSettings", "OSVersion", "PersonalHotspotEnabled", "PhoneNumber", "ProductName", "PushToken", "SerialNumber", "ServiceSubscriptions", "SIMCarrierNetwork", "SIMMCC", "SIMMNC", "SubscriberCarrierNetwork", "SubscriberMCC", "SubscriberMNC", "SystemIntegrityProtectionEnabled", "UDID", "VoiceRoamingEnabled", "WiFiMAC", "EthernetMAC"}

Functions

func BumpDeviceLastUpdated

func BumpDeviceLastUpdated(udid string)

Types

type AcknowledgeEvent

type AcknowledgeEvent struct {
	UDID        string            `json:"udid"`
	Params      map[string]string `json:"url_params"`
	RawPayload  []byte            `json:"raw_payload"`
	CommandUUID string            `json:"command_uuid"`
	Status      string            `json:"status"`
}

type Certificate

type Certificate struct {
	ID         uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	CommonName string
	Subject    string
	NotAfter   time.Time
	NotBefore  time.Time
	Data       []byte
	Issuer     string
	DeviceUDID string
}

Certificate represents a certificate.

type CertificateList

type CertificateList struct {
	CommonName string `plist:"CommonName"`
	Data       []byte `plist:"Data"`
	IsIdentity bool   `plist:"IsIdentity"`
}

CertificateList Each item from CertificateList

type CertificateListData

type CertificateListData struct {
	CertificateList []CertificateList
}

CertificateListData - returned data from the CertificateList MDM command

type CheckinEvent

type CheckinEvent struct {
	UDID       string            `json:"udid"`
	Params     map[string]string `json:"url_params"`
	RawPayload []byte            `json:"raw_payload"`
}

type Command

type Command struct {
	UpdatedAt    time.Time
	CommandUUID  string `gorm:"primaryKey"`
	Status       string
	DeviceUDID   string         `json:"udid"`
	RequestType  string         `json:"request_type"`
	Payload      string         `json:"payload,omitempty"`
	Queries      pq.StringArray `json:"Queries,omitempty" gorm:"type:text[]"`
	Identifier   string         `json:"identifier,omitempty"`
	ManifestURL  string         `json:"manifest_url,omitempty"`
	ErrorString  string
	AttemptCount int
}

type CommandPayload

type CommandPayload struct {
	UDID        string   `json:"udid"`
	RequestType string   `json:"request_type"`
	Payload     string   `json:"payload,omitempty"`
	Queries     []string `json:"Queries,omitempty"`
	Identifier  string   `json:"identifier,omitempty"`
	ManifestURL string   `json:"manifest_url,omitempty"`
	Pin         string   `json:"pin,omitempty"`
}

type CommandResponse

type CommandResponse struct {
	Payload struct {
		CommandUUID string `json:"command_uuid"`
		Command     CommandPayload
	} `json:"payload"`
}

type DeleteProfilePayload

type DeleteProfilePayload struct {
	SerialNumbers []string                     `json:"serial_numbers,omitempty"`
	DeviceUDIDs   []string                     `json:"udids,omitempty"`
	PushNow       bool                         `json:"push_now"`
	Mobileconfigs []DeletedMobileconfigPayload `json:"profiles"`
	Metadata      bool                         `json:"metadata"`
}

type DeletedMobileconfigPayload

type DeletedMobileconfigPayload struct {
	PayloadIdentifier string `json:"payload_identifier"`
}

type Device

type Device struct {
	DeviceName                       string
	BuildVersion                     string
	ModelName                        string
	Model                            string
	OSVersion                        string
	ProductName                      string
	SerialNumber                     string
	DeviceCapacity                   float32
	AvailableDeviceCapacity          float32
	BatteryLevel                     float32
	CellularTechnology               int
	IMEI                             string
	MEID                             string
	ModemFirmwareVersion             string
	IsSupervised                     bool
	IsDeviceLocatorServiceEnabled    bool
	IsActivationLockEnabled          bool
	IsDoNotDisturbInEffect           bool
	DeviceID                         string
	EASDeviceIdentifier              string
	IsCloudBackupEnabled             bool
	OSUpdateSettings                 OSUpdateSettings `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	LocalHostName                    string
	HostName                         string
	SystemIntegrityProtectionEnabled bool
	// ActiveManagedUsers               []string
	AppAnalyticsEnabled bool
	// AutoSetupAdminAccounts interface
	IsMDMLostModeEnabled        bool
	AwaitingConfiguration       bool `gorm:"default:false"`
	MaximumResidentUsers        int
	BluetoothMAC                string
	CarrierSettingsVersion      string
	CurrentCarrierNetwork       string
	CurrentMCC                  string
	CurrentMNC                  string
	DataRoamingEnabled          string
	DiagnosticSubmissionEnabled bool
	ICCID                       string
	IsMultiUser                 bool
	IsNetworkTethered           bool
	IsRoaming                   bool

	LastCloudBackupDate time.Time
	//MDMOptions                  string
	// EthernetMACs []string
	// OrganizationInfo interface{}
	PersonalHotspotEnabled bool
	PhoneNumber            string
	PushToken              string
	// ServiceSubscriptions interface{}
	SIMCarrierNetwork        string
	SIMMCC                   string
	SIMMNC                   string
	SubscriberCarrierNetwork string
	SubscriberMCC            string
	SubscriberMNC            string
	VoiceRoamingEnabled      bool
	WiFiMAC                  string
	EthernetMAC              string
	UDID                     string `gorm:"primaryKey"`
	Active                   bool
	Profiles                 []DeviceProfile            `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	Commands                 []Command                  `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	Certificates             []Certificate              `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	InstallApplications      []DeviceInstallApplication `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	SecurityInfo             SecurityInfo               `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	ProfileList              []ProfileList              `gorm:"foreignKey:DeviceUDID" json:",omitempty"`
	UpdatedAt                time.Time
	AuthenticateRecieved     bool `gorm:"default:false"`
	TokenUpdateRecieved      bool `gorm:"default:false"`
	InitialTasksRun          bool `gorm:"default:false"`
	Erase                    bool `gorm:"default:false"`
	Lock                     bool `gorm:"default:false"`
	UnlockPin                string
	TempUnlockPin            UnlockPin `gorm:"foreignKey:DeviceUDID"`
	LastInfoRequested        time.Time
	NextPush                 time.Time
	// LastScheduledPush        time.Time
	LastCheckedIn       time.Time
	LastCertificateList time.Time
	LastProfileList     time.Time
	LastDeviceInfo      time.Time
	LastSecurityInfo    time.Time
	// contains filtered or unexported fields
}

func (*Device) UpdateLastCertificateList added in v0.0.8

func (device *Device) UpdateLastCertificateList() error

func (*Device) UpdateLastDeviceInfo added in v0.0.8

func (device *Device) UpdateLastDeviceInfo() error

func (*Device) UpdateLastProfileList added in v0.0.8

func (device *Device) UpdateLastProfileList() error

func (*Device) UpdateLastSecurityInfo added in v0.0.8

func (device *Device) UpdateLastSecurityInfo() error

type DeviceCommandPayload

type DeviceCommandPayload struct {
	SerialNumbers []string `json:"serial_numbers,omitempty"`
	DeviceUDIDs   []string `json:"udids,omitempty"`
	Value         bool     `json:"value"`
	PushNow       bool     `json:"push_now"`
	Metadata      bool     `json:"metadata"`
	Pin           string   `json:"pin,omitempty"`
}

type DeviceFromMDM

type DeviceFromMDM struct {
	SerialNumber     string `json:"serial_number"`
	UDID             string `json:"udid"`
	EnrollmentStatus bool   `json:"enrollment_status"`
	LastSeen         string `json:"last_seen"`
}

type DeviceInformationQueryResponses

type DeviceInformationQueryResponses struct {
	QueryResponses Device `plist:"QueryResponses"`
}

type DeviceInstallApplication

type DeviceInstallApplication struct {
	ID          uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	ManifestURL string
	DeviceUDID  string
}

type DeviceProfile

type DeviceProfile struct {
	// ID                uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	PayloadUUID       string
	PayloadIdentifier string `gorm:"primaryKey"`
	HashedPayloadUUID string
	MobileconfigData  []byte
	MobileconfigHash  []byte
	DeviceUDID        string `gorm:"primaryKey"`
	Installed         bool   `gorm:"default:true"`
}

DeviceProfile (s) are profiles that are individual to the device.

func (*DeviceProfile) AfterCreate

func (profile *DeviceProfile) AfterCreate(tx *gorm.DB) (err error)

func (*DeviceProfile) AfterUpdate

func (profile *DeviceProfile) AfterUpdate(tx *gorm.DB) (err error)

type DevicesFromMDM

type DevicesFromMDM struct {
	Devices []DeviceFromMDM `json:"devices"`
}

type EscrowPayload

type EscrowPayload struct {
	Serial     string `form:"serial"`
	Pin        string `form:"recovery_password"`
	Username   string `form:"username"`
	SecretType string `form:"secret_type"`
}

type FirewallSettings added in v0.0.8

type FirewallSettings struct {
	// FirewallSettingsApplications []FirewallSettingsApplication `plist:"Applications"gorm"foreignKey:DeviceUDID"`
	BlockAllIncoming bool   `plist:"BlockAllIncoming"`
	FirewallEnabled  bool   `plist:"FirewallEnabled"`
	StealthMode      bool   `plist:"StealthMode"`
	DeviceUDID       string `gorm:"primaryKey"`
}

type FirmwarePasswordStatus

type FirmwarePasswordStatus struct {
	PasswordExists bool   `plist:"PasswordExists"`
	ChangePending  bool   `plist:"ChangePending"`
	AllowOroms     bool   `plist:"AllowOroms"`
	DeviceUDID     string `gorm:"primaryKey"`
}

type InstallApplicationPayload

type InstallApplicationPayload struct {
	SerialNumbers []string      `json:"serial_numbers,omitempty"`
	DeviceUDIDs   []string      `json:"udids,omitempty"`
	ManifestURLs  []ManifestURL `json:"manifest_urls"`
}

type ManagementStatus

type ManagementStatus struct {
	EnrolledViaDEP             bool   `plist:"EnrolledViaDEP"`
	UserApprovedEnrollment     bool   `plist:"UserApprovedEnrollment"`
	IsUserEnrollment           bool   `plist:"IsUserEnrollment"`
	IsActivationLockManageable bool   `plist:"IsActivationLockManageable"`
	DeviceUDID                 string `gorm:"primaryKey"`
}

type ManifestURL

type ManifestURL struct {
	URL           string `json:"url"`
	BootstrapOnly bool   `json:"bootstrap_only"`
}

type MetadataItem

type MetadataItem struct {
	// Device          Device            `json:"device"`
	ProfileMetadata []ProfileMetadata `json:"profile_metadata"`
}

type OSUpdateSettings

type OSUpdateSettings struct {
	DeviceUDID                      string `gorm:"primaryKey"`
	CatalogURL                      string
	IsDefaultCatalog                bool
	PreviousScanDate                time.Time
	PreviousScanResult              int
	PerformPeriodicCheck            bool
	AutomaticCheckEnabled           bool
	BackgroundDownloadEnabled       bool
	AutomaticAppInstallationEnabled bool
	AutomaticOSInstallationEnabled  bool
	AutomaticSecurityUpdatesEnabled bool
}

type PostPayload

type PostPayload struct {
	Topic            string            `json:"topic"`
	EventID          string            `json:"event_id"`
	CheckinEvent     *CheckinEvent     `json:"checkin_event,omitempty"`
	AcknowledgeEvent *AcknowledgeEvent `json:"acknowledge_event,omitempty"`
}

type ProfileList

type ProfileList struct {
	ID                       uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	DeviceUDID               string
	HasRemovalPasscode       bool          `plist:"HasRemovalPasscode"`
	IsEncrypted              bool          `plist:"IsEncrypted"`
	IsManaged                bool          `plist:"IsManaged"`
	PayloadContent           []interface{} `plist:"PaylodContent" gorm:"-"`
	PayloadDescription       string        `plist:"PayloadDescription"`
	PayloadDisplayName       string        `plist:"PayloadDisplayName"`
	PayloadIdentifier        string        `plist:"PayloadIdentifier"`
	PayloadOrganization      string        `plist:"PayloadOrganization"`
	PayloadRemovalDisallowed bool          `plist:"PayloadRemovalDisallowed"`
	PayloadUUID              string        `plist:"PayloadUUID" gorm:"not null"`
	PayloadVersion           int           `plist:"PayloadVersion"`
	FullPayload              bool          `plist:"FullPayload"`
}

type ProfileListData

type ProfileListData struct {
	ProfileList []ProfileList
}

ProfileList - returned data from the ProfileList MDM command

type ProfileMetadata

type ProfileMetadata struct {
	Status            string `json:"status"`
	PayloadIdentifier string `json:"payload_identifier"`
	PayloadUUID       string `json:"payload_uuid"`
	HashedPayloadUUID string `json:"hashed_payload_uuid"`
}

type ProfilePayload

type ProfilePayload struct {
	SerialNumbers []string `json:"serial_numbers,omitempty"`
	DeviceUDIDs   []string `json:"udids,omitempty"`
	Mobileconfigs []string `json:"profiles"`
	PushNow       bool     `json:"push_now"`
	Metadata      bool     `json:"metadata"`
}

ProfilePayload - struct to unpack the payload sent to mdmdirector

type SecureBoot added in v0.0.8

type SecureBoot struct {
	ExternalBootLevel         string                    `plist:"ExternalBootLevel"`
	SecureBootLevel           string                    `plist:"SecureBootLevel"`
	SecureBootReducedSecurity SecureBootReducedSecurity `plist:"ReducedSecurity" gorm:"foreignKey:DeviceUDID"`
	DeviceUDID                string                    `gorm:"primaryKey"`
}

type SecureBootReducedSecurity added in v0.0.8

type SecureBootReducedSecurity struct {
	AllowsAnyAppleSignedOS bool   `plist:"AllowsAnyAppleSignedOS"`
	AllowsMDM              bool   `plist:"AllowsMDM"`
	AllowsUserKextApproval bool   `plist:"AllowsUserKextApproval"`
	DeviceUDID             string `gorm:"primaryKey"`
}

type SecurityInfo

type SecurityInfo struct {
	AuthenticatedRootVolumeEnabled                   bool                   `plist:"AuthenticatedRootVolumeEnabled"`
	BootstrapTokenAllowedForAuthentication           string                 `plist:"BootstrapTokenAllowedForAuthentication"`
	BootstrapTokenRequiredForKernelExtensionApproval bool                   `plist:"BootstrapTokenRequiredForKernelExtensionApproval"`
	BootstrapTokenRequiredForSoftwareUpdate          bool                   `plist:"BootstrapTokenRequiredForSoftwareUpdate"`
	HardwareEncryptionCaps                           int                    `plist:"HardwareEncryptionCaps"`
	PasscodePresent                                  bool                   `plist:"PasscodePresent"`
	PasscodeCompliant                                bool                   `plist:"PasscodeCompliant"`
	PasscodeCompliantWithProfiles                    bool                   `plist:"PasscodeCompliantWithProfiles"`
	PasscodeLockGracePeriod                          int                    `plist:"PasscodeLockGracePeriod"`
	PasscodeLockGracePeriodEnforced                  int                    `plist:"PasscodeLockGracePeriodEnforced"`
	FDEEnabled                                       bool                   `plist:"FDE_Enabled"`
	FDEHasPersonalRecoveryKey                        bool                   `plist:"FDE_HasPersonalRecoveryKey"`
	FDEHasInstitutionalRecoveryKey                   bool                   `plist:"FDE_HasInstitutionalRecoveryKey"`
	FDEPersonalRecoveryKeyCMS                        []byte                 `plist:"FDE_PersonalRecoveryKeyCMS"`
	FDEPersonalRecoveryKeyDeviceKey                  string                 `plist:"FDE_PersonalRecoveryKeyDeviceKey" gorm:"-"`
	FirewallSettings                                 FirewallSettings       `plist:"FirewallSettings" gorm:"foreignKey:DeviceUDID"`
	SystemIntegrityProtectionEnabled                 bool                   `plist:"SystemIntegrityProtectionEnabled"`
	FirmwarePasswordStatus                           FirmwarePasswordStatus `plist:"FirmwarePasswordStatus" gorm:"foreignKey:DeviceUDID"`
	ManagementStatus                                 ManagementStatus       `plist:"ManagementStatus" gorm:"foreignKey:DeviceUDID"`
	RemoteDesktopEnabled                             bool                   `plist:"RemoteDesktopEnabled"`
	SecureBoot                                       SecureBoot             `plist:"SecureBoot" gorm:"foreignKey:DeviceUDID"`
	DeviceUDID                                       string                 `gorm:"primaryKey"`
}

type SecurityInfoData

type SecurityInfoData struct {
	SecurityInfo SecurityInfo
}

type SharedInstallApplication

type SharedInstallApplication struct {
	ID          uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	ManifestURL string
}

type SharedProfile

type SharedProfile struct {
	ID                uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	PayloadUUID       string
	HashedPayloadUUID string
	PayloadIdentifier string
	MobileconfigData  []byte
	MobileconfigHash  []byte
	Installed         bool `gorm:"default:true"`
}

SharedProfile (s) are profiles that go on every device.

type UnlockPin

type UnlockPin struct {
	ID         uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
	UnlockPin  string
	PinSet     time.Time
	DeviceUDID string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL