Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

santad: Log team ID in execution logs, where available #850

Merged
merged 3 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/common/santa.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ message Execution {
optional string original_path = 11;
repeated string args = 12;
optional string machine_id = 13;
optional string team_id = 14;
}

message DiskAppeared {
Expand Down
1 change: 1 addition & 0 deletions Source/santad/Logs/SNTProtobufEventLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ - (void)logExecution:(santa_message_t)message withDecision:(SNTCachedDecision *)
exec.argsArray = [(__bridge NSArray *)message.args_array mutableCopy];
exec.machineId =
[[SNTConfigurator configurator] enableMachineIDDecoration] ? self.machineID : nil;
exec.teamId = cd.teamID;

[self logWithSantaMessage:&message
wrapper:^(SNTPBSantaMessage *sm) {
Expand Down
6 changes: 5 additions & 1 deletion Source/santad/Logs/SNTSyslogEventLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,15 @@ - (void)logExecution:(santa_message_t)message withDecision:(SNTCachedDecision *)

[outLog appendFormat:@"|sha256=%@", cd.sha256];

if (cd.certSHA256) {
if (cd.certSHA256.length) {
[outLog appendFormat:@"|cert_sha256=%@|cert_cn=%@", cd.certSHA256,
[self sanitizeString:cd.certCommonName]];
}

if (cd.teamID.length) {
[outLog appendFormat:@"|teamid=%@", cd.teamID];
}

if (cd.quarantineURL) {
[outLog appendFormat:@"|quarantine_url=%@", [self sanitizeString:cd.quarantineURL]];
}
Expand Down