Repository: micromdm/micromdm
Pull request #801 (2022-02-17 18:20:09)

Fix RotateFileVaultKey panics
There's currently an issue as noted on the MacAdmins slack with the RotateFileVaultKey command panicking in certain cases due to a edge case in the plist library.

This PR adds a test for the panic case and updates the plist library to [the fixed version](https://github.com/groob/plist/pull/36).


Patch:
diff --git a/go.mod b/go.mod
index 6bb2001..f307661 100644
--- a/go.mod
+++ b/go.mod
@@ -9,7 +9,7 @@ require (
 	github.com/gorilla/handlers v1.5.1
 	github.com/gorilla/mux v1.6.2
 	github.com/groob/finalizer v0.0.0-20170707115354-4c2ed49aabda
-	github.com/groob/plist v0.0.0-20180203051248-dd56909aee38
+	github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5
 	github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0
 	github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0
 	github.com/lib/pq v1.0.0
diff --git a/go.sum b/go.sum
index 4e57767..a9b27f3 100644
--- a/go.sum
+++ b/go.sum
@@ -38,6 +38,8 @@ github.com/groob/finalizer v0.0.0-20170707115354-4c2ed49aabda h1:5ikpG9mYCMFiZX0
 github.com/groob/finalizer v0.0.0-20170707115354-4c2ed49aabda/go.mod h1:MyndkAZd5rUMdNogn35MWXBX1UiBigrU8eTj8DoAC2c=
 github.com/groob/plist v0.0.0-20180203051248-dd56909aee38 h1:afbUddvIjPRC7XHHgeSTRfzZtIxEsSl4VCxumLBGDJU=
 github.com/groob/plist v0.0.0-20180203051248-dd56909aee38/go.mod h1:qg2Nek0ND/hIr+nY8H1oVqEW2cLzVVNaAQ0QexOyjyc=
+github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5 h1:saaSiB25B1wgaxrshQhurfPKUGJ4It3OxNJUy0rdOjU=
+github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5/go.mod h1:itkABA+w2cw7x5nYUS/pLRef6ludkZKOigbROmCTaFw=
 github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 h1:5B0uxl2lzNRVkJVg+uGHxWtRt4C0Wjc6kJKo5XYx8xE=
 github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU=
 github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0 h1:8UB0NJBoB/lN2O9zG9+U2klyYE0UhvN2Zrn7HBjhwNY=
diff --git a/mdm/mdm/command.go b/mdm/mdm/command.go
index 30ba52a..3d3b8ee 100644
--- a/mdm/mdm/command.go
+++ b/mdm/mdm/command.go
@@ -280,6 +280,7 @@ type OSUpdate struct {
 	InstallAction    string `json:"install_action"`
 	MaxUserDeferrals *int64 `plist:",omitempty" json:"max_user_deferrals,omitempty"`
 	ProductVersion   string `plist:",omitempty" json:"product_version,omitempty"`
+	Priority         string `plist:",omitempty" json:"priority,omitempty"`
 }
 
 type ScheduleOSUpdate struct {
diff --git a/mdm/mdm/internal/mdmproto/mdm.pb.go b/mdm/mdm/internal/mdmproto/mdm.pb.go
index 1a58a1c..6f3b696 100644
--- a/mdm/mdm/internal/mdmproto/mdm.pb.go
+++ b/mdm/mdm/internal/mdmproto/mdm.pb.go
@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.26.0
-// 	protoc        v3.18.1
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.19.3
 // source: mdm.proto
 
 package mdmproto
@@ -4219,6 +4219,7 @@ type Update struct {
 	ProductVersion   string `protobuf:"bytes,2,opt,name=product_version,json=productVersion,proto3" json:"product_version,omitempty"`
 	InstallAction    string `protobuf:"bytes,3,opt,name=install_action,json=installAction,proto3" json:"install_action,omitempty"`
 	MaxUserDeferrals int64  `protobuf:"varint,4,opt,name=max_user_deferrals,json=maxUserDeferrals,proto3" json:"max_user_deferrals,omitempty"`
+	Priority         string `protobuf:"bytes,5,opt,name=priority,proto3" json:"priority,omitempty"`
 }
 
 func (x *Update) Reset() {
@@ -4281,6 +4282,13 @@ func (x *Update) GetMaxUserDeferrals() int64 {
 	return 0
 }
 
+func (x *Update) GetPriority() string {
+	if x != nil {
+		return x.Priority
+	}
+	return ""
+}
+
 type ScheduleOSUpdateScan struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -5364,7 +5372,7 @@ var file_mdm_proto_rawDesc = []byte{
 	0x4f, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61,
 	0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x64, 0x6d, 0x70,
 	0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x75, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
+	0x61, 0x74, 0x65, 0x73, 0x22, 0xc3, 0x01, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
 	0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4b, 0x65, 0x79,
 	0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73,
@@ -5374,72 +5382,74 @@ var file_mdm_proto_rawDesc = []byte{
 	0x09, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
 	0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x66,
 	0x65, 0x72, 0x72, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6d, 0x61,
-	0x78, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x73, 0x22, 0x2c,
-	0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x53, 0x55, 0x70, 0x64, 0x61,
-	0x74, 0x65, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x4c, 0x0a, 0x12,
-	0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
-	0x6e, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x78, 0x74,
-	0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20,
-	0x03, 0x28, 0x09, 0x52, 0x15, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e,
-	0x73, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x12, 0x52,
-	0x6f, 0x74, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x65,
-	0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x10,
-	0x66, 0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63,
-	0x6b, 0x52, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f,
-	0x63, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66,
-	0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6e, 0x65, 0x77,
-	0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x1c, 0x72,
-	0x65, 0x70, 0x6c, 0x79, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
-	0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69,
-	0x6f, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x9a, 0x01,
-	0x0a, 0x0f, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63,
-	0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a,
-	0x12, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70,
-	0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61,
-	0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3d, 0x0a, 0x1b, 0x70,
-	0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72,
-	0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x18, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70, 0x6f,
-	0x72, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x3c, 0x0a, 0x11, 0x53, 0x65,
-	0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
-	0x27, 0x0a, 0x0f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b,
-	0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74,
-	0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73,
-	0x75, 0x6c, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x64,
-	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x64, 0x69, 0x64, 0x12, 0x21,
-	0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x55, 0x75, 0x69,
-	0x64, 0x12, 0x35, 0x0a, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e,
-	0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x0a, 0x65, 0x72,
-	0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x22, 0x53, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74,
-	0x75, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67,
-	0x65, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12,
-	0x16, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74,
-	0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x64, 0x6c, 0x65, 0x10,
-	0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x77, 0x10, 0x04, 0x22, 0xb9, 0x01,
-	0x0a, 0x0a, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x33, 0x0a, 0x15,
-	0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
-	0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6c, 0x6f, 0x63,
-	0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
-	0x6e, 0x12, 0x34, 0x0a, 0x16, 0x75, 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x5f,
-	0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x14, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x65, 0x73, 0x63,
-	0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72,
-	0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65,
-	0x72, 0x72, 0x6f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72,
-	0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
-	0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74,
-	0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64, 0x6d,
-	0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64,
-	0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x64, 0x6d, 0x70, 0x72,
-	0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x78, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x73, 0x12, 0x1a,
+	0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x0a, 0x14, 0x53, 0x63,
+	0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63,
+	0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x4c, 0x0a, 0x12, 0x41, 0x63, 0x74, 0x69,
+	0x76, 0x65, 0x4e, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x36,
+	0x0a, 0x17, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
+	0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
+	0x15, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
+	0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x12, 0x52, 0x6f, 0x74, 0x61, 0x74,
+	0x65, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a,
+	0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65,
+	0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69,
+	0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x0f, 0x66,
+	0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x27,
+	0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+	0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6e, 0x65, 0x77, 0x43, 0x65, 0x72, 0x74,
+	0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x1c, 0x72, 0x65, 0x70, 0x6c, 0x79,
+	0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x65, 0x72, 0x74,
+	0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x72,
+	0x65, 0x70, 0x6c, 0x79, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x65,
+	0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x46, 0x69,
+	0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a,
+	0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x69,
+	0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
+	0x79, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3d, 0x0a, 0x1b, 0x70, 0x72, 0x69, 0x76, 0x61,
+	0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61,
+	0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x70, 0x72,
+	0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61,
+	0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x3c, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x42, 0x6f, 0x6f,
+	0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x62,
+	0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54,
+	0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x50,
+	0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x64, 0x69, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x64, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f,
+	0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x55, 0x75, 0x69, 0x64, 0x12, 0x35, 0x0a,
+	0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x03,
+	0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x72,
+	0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43,
+	0x68, 0x61, 0x69, 0x6e, 0x22, 0x53, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10,
+	0x0a, 0x0c, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x64, 0x10, 0x00,
+	0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x43,
+	0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x45, 0x72, 0x72, 0x6f,
+	0x72, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x64, 0x6c, 0x65, 0x10, 0x03, 0x12, 0x0a, 0x0a,
+	0x06, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x77, 0x10, 0x04, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x45, 0x72,
+	0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x6c, 0x6f, 0x63, 0x61,
+	0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
+	0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a,
+	0x65, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a,
+	0x16, 0x75, 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x64, 0x65, 0x73, 0x63,
+	0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x75,
+	0x73, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
+	0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x64, 0x6f, 0x6d,
+	0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72,
+	0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f,
+	0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f,
+	0x72, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
+	0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x69, 0x63,
+	0x72, 0x6f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64, 0x6d, 0x2f, 0x69, 0x6e,
+	0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
diff --git a/mdm/mdm/internal/mdmproto/mdm.proto b/mdm/mdm/internal/mdmproto/mdm.proto
index 207531b..7176703 100644
--- a/mdm/mdm/internal/mdmproto/mdm.proto
+++ b/mdm/mdm/internal/mdmproto/mdm.proto
@@ -400,6 +400,7 @@ message Update {
   string product_version = 2;
   string install_action = 3;
   int64 max_user_deferrals = 4;
+  string priority = 5;
 }
 
 message ScheduleOSUpdateScan {
diff --git a/mdm/mdm/marshal_proto.go b/mdm/mdm/marshal_proto.go
index 5f5245f..7f82381 100644
--- a/mdm/mdm/marshal_proto.go
+++ b/mdm/mdm/marshal_proto.go
@@ -369,6 +369,7 @@ func commandToProto(cmd *Command) (*mdmproto.Command, error) {
 				InstallAction:    u.InstallAction,
 				MaxUserDeferrals: zeroInt64IfNil(u.MaxUserDeferrals),
 				ProductVersion:   u.ProductVersion,
+				Priority:         u.Priority,
 			})
 		}
 		cmdproto.Request = &mdmproto.Command_ScheduleOsUpdate{
diff --git a/mdm/mdm/unmarshal_proto.go b/mdm/mdm/unmarshal_proto.go
index 64a6344..18bfc76 100644
--- a/mdm/mdm/unmarshal_proto.go
+++ b/mdm/mdm/unmarshal_proto.go
@@ -335,6 +335,7 @@ func protoToCommand(pb *mdmproto.Command) *Command {
 				InstallAction:    up.GetInstallAction(),
 				MaxUserDeferrals: nilIfZeroInt64(up.GetMaxUserDeferrals()),
 				ProductVersion:   up.GetProductVersion(),
+				Priority:         up.GetPriority(),
 			})
 		}
 		cmd.ScheduleOSUpdate = &ScheduleOSUpdate{


Test patch:
diff --git a/mdm/mdm/mdm_command_test.go b/mdm/mdm/mdm_command_test.go
index 8d635e7..2947e2a 100644
--- a/mdm/mdm/mdm_command_test.go
+++ b/mdm/mdm/mdm_command_test.go
@@ -121,11 +121,23 @@ func TestMarshalCommand(t *testing.T) {
 							InstallAction:    "InstallLater",
 							MaxUserDeferrals: &deferrals,
 							ProductVersion:   "1.0.0",
+							Priority:         "Low",
 						},
 					},
 				},
 			},
 		},
+		{
+			Command: Command{
+				RequestType: "RotateFileVaultKey",
+				RotateFileVaultKey: &RotateFileVaultKey{
+					KeyType: "personal",
+					FileVaultUnlock: FileVaultUnlock{
+						Password: "password",
+					},
+				},
+			},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.Command.RequestType+"_json", func(t *testing.T) {
@@ -334,7 +346,7 @@ func TestEndToEnd(t *testing.T) {
 		{
 			name: "ScheduleOSUpdate",
 			requestBytes: []byte(
-				`{"request_type":"ScheduleOSUpdate","updates":[{"product_key":"io.micromdm.micromdm","install_action":"InstallLater","max_user_deferrals":3,"product_version":"1.0.0"}]}`,
+				`{"request_type":"ScheduleOSUpdate","updates":[{"product_key":"io.micromdm.micromdm","install_action":"InstallLater","max_user_deferrals":3,"product_version":"1.0.0","priority":"Low"}]}`,
 			),
 			testFn: func(t *testing.T, parts endToEndParts) {
 				needToSee := [][]byte{
@@ -347,6 +359,8 @@ func TestEndToEnd(t *testing.T) {
 					[]byte(`3`),
 					[]byte(`ProductVersion`),
 					[]byte(`1.0.0`),
+					[]byte(`Priority`),
+					[]byte(`Low`),
 				}
 				for _, b := range needToSee {
 					if !bytes.Contains(parts.plistData, b) {