Skip to content

Commit

Permalink
Change auth instigator trigger field names in proto schema (#142)
Browse files Browse the repository at this point in the history
This PR changes the field names for the `oneof auth_instigator` fields
to have names that are more meaningful for people using JSON event
logging.

---------

Signed-off-by: Matt W <[email protected]>
Co-authored-by: Russell Hancox <[email protected]>
  • Loading branch information
mlw and russellhancox authored Nov 19, 2024
1 parent 736ade8 commit 5d4c9f0
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
18 changes: 9 additions & 9 deletions Source/common/santa.proto
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,13 @@ message AuthenticationOD {
optional ProcessInfoLight instigator = 1;

// The process that triggered authentication
// Note: Due internal system limitations, the process that triggered the
// Note: Due to macOS system limitations, the process that triggered the
// event may have already exited before the event could be generated. This
// results in only a small subset of the information from the triggering
// process to be reported.
oneof auth_instigator {
ProcessInfoLight process = 2;
ProcessID fallback_id = 3;
ProcessInfoLight trigger_process = 2;
ProcessID trigger_id = 3;
}

// OD record type against which OD is authenticating
Expand All @@ -796,13 +796,13 @@ message AuthenticationTouchID {
optional ProcessInfoLight instigator = 1;

// The process that triggered authentication
// Note: Due internal system limitations, the process that triggered the
// Note: Due to macOS system limitations, the process that triggered the
// event may have already exited before the event could be generated. This
// results in only a small subset of the information from the triggering
// process to be reported.
oneof auth_instigator {
ProcessInfoLight process = 2;
ProcessID fallback_id = 3;
ProcessInfoLight trigger_process = 2;
ProcessID trigger_id = 3;
}

enum Mode {
Expand All @@ -825,13 +825,13 @@ message AuthenticationToken {
optional ProcessInfoLight instigator = 1;

// The process that triggered authentication
// Note: Due internal system limitations, the process that triggered the
// Note: Due to macOS system limitations, the process that triggered the
// event may have already exited before the event could be generated. This
// results in only a small subset of the information from the triggering
// process to be reported.
oneof auth_instigator {
ProcessInfoLight process = 2;
ProcessID fallback_id = 3;
ProcessInfoLight trigger_process = 2;
ProcessID trigger_id = 3;
}

// Hash of the public key which CryptoTokenKit is authenticating
Expand Down
12 changes: 6 additions & 6 deletions Source/santad/Logs/EndpointSecurity/Serializers/Protobuf.mm
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,8 @@ void EncodeAuthInstigatorOrFallback(

EncodeProcessInfoLight(pb_od->mutable_instigator(), msg);
EncodeAuthInstigatorOrFallback(
msg, [pb_od] { return pb_od->mutable_process(); },
[pb_od] { return pb_od->mutable_fallback_id(); });
msg, [pb_od] { return pb_od->mutable_trigger_process(); },
[pb_od] { return pb_od->mutable_trigger_id(); });

EncodeStringToken([pb_od] { return pb_od->mutable_record_type(); }, es_od_event->record_type);
EncodeStringToken([pb_od] { return pb_od->mutable_record_name(); }, es_od_event->record_name);
Expand Down Expand Up @@ -1015,8 +1015,8 @@ void EncodeAuthInstigatorOrFallback(

EncodeProcessInfoLight(pb_touchid->mutable_instigator(), msg);
EncodeAuthInstigatorOrFallback(
msg, [pb_touchid] { return pb_touchid->mutable_process(); },
[pb_touchid] { return pb_touchid->mutable_fallback_id(); });
msg, [pb_touchid] { return pb_touchid->mutable_trigger_process(); },
[pb_touchid] { return pb_touchid->mutable_trigger_id(); });

pb_touchid->set_mode(GetAuthenticationTouchIDMode(es_touchid_event->touchid_mode));
if (es_touchid_event->has_uid) {
Expand All @@ -1038,8 +1038,8 @@ void EncodeAuthInstigatorOrFallback(

EncodeProcessInfoLight(pb_token->mutable_instigator(), msg);
EncodeAuthInstigatorOrFallback(
msg, [pb_token] { return pb_token->mutable_process(); },
[pb_token] { return pb_token->mutable_fallback_id(); });
msg, [pb_token] { return pb_token->mutable_trigger_process(); },
[pb_token] { return pb_token->mutable_trigger_id(); });

EncodeStringToken([pb_token] { return pb_token->mutable_pubkey_hash(); },
es_token_event->pubkey_hash);
Expand Down
2 changes: 1 addition & 1 deletion Source/santad/testdata/protobuf/v6/authentication_od.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
2 changes: 1 addition & 1 deletion Source/santad/testdata/protobuf/v7/authentication_od.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
2 changes: 1 addition & 1 deletion Source/santad/testdata/protobuf/v8/authentication_od.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"fallback_id": {
"trigger_id": {
"pid": 98,
"pidversion": 76
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"fallback_id": {
"trigger_id": {
"pid": 98,
"pidversion": 76
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"fallback_id": {
"trigger_id": {
"pid": 98,
"pidversion": 76
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"truncated": false
}
},
"process": {
"trigger_process": {
"id": {
"pid": 23,
"pidversion": 45
Expand Down

0 comments on commit 5d4c9f0

Please sign in to comment.