Skip to content

Commit

Permalink
santad: Log quarantine URL if one exists.
Browse files Browse the repository at this point in the history
Fixes google#34
  • Loading branch information
russellhancox committed Mar 10, 2016
1 parent 6834507 commit e9ec9a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/santad/SNTCachedDecision.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@property NSString *sha256;
@property NSString *certSHA256;
@property NSString *certCommonName;
@property NSString *quarantineURL;

@property NSString *customMsg;
@property BOOL silentBlock;
Expand Down
5 changes: 5 additions & 0 deletions Source/santad/SNTEventLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ - (void)logExecution:(santa_message_t)message withDecision:(SNTCachedDecision *)
cd.certSHA256, [self sanitizeString:cd.certCommonName]];
}

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

NSString *user, *group;
struct passwd *pw = getpwuid(message.uid);
if (pw) user = @(pw->pw_name);
Expand Down
1 change: 1 addition & 0 deletions Source/santad/SNTExecutionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ - (void)validateBinaryWithMessage:(santa_message_t)message {
cd.certCommonName = csInfo.leafCertificate.commonName;
cd.certSHA256 = csInfo.leafCertificate.SHA256;
cd.vnodeId = message.vnode_id;
cd.quarantineURL = binInfo.quarantineDataURL;
cd.decision = [self makeDecision:cd binaryInfo:binInfo];

// Save decision details for logging the execution later.
Expand Down

0 comments on commit e9ec9a7

Please sign in to comment.