Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions lib/usagereporter/teleport/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ func ConvertAuditEvent(event apievents.AuditEvent) Anonymizable {
Days: e.Days,
IsSuccess: e.Status.Success,
}
case *apievents.ValidateMFAAuthResponse:
return &MFAAuthenticationEvent{
UserName: e.User,
DeviceId: e.MFADevice.DeviceID,
DeviceType: e.MFADevice.DeviceType,
MfaChallengeScope: e.ChallengeScope,
}
}

return nil
Expand Down
17 changes: 17 additions & 0 deletions lib/usagereporter/teleport/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,23 @@ func (e *DiscoveryFetchEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEven
}
}

// MFAAuthenticationEvent is emitted when a user performs MFA authentication.
type MFAAuthenticationEvent prehogv1a.MFAAuthenticationEvent

// Anonymize anonymizes the event.
func (e *MFAAuthenticationEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEventRequest {
return prehogv1a.SubmitEventRequest{
Event: &prehogv1a.SubmitEventRequest_MfaAuthenticationEvent{
MfaAuthenticationEvent: &prehogv1a.MFAAuthenticationEvent{
UserName: a.AnonymizeString(e.UserName),
DeviceId: a.AnonymizeString(e.DeviceId),
DeviceType: e.DeviceType,
MfaChallengeScope: e.MfaChallengeScope,
},
},
}
}

// ConvertUsageEvent converts a usage event from an API object into an
// anonymizable event. All events that can be submitted externally via the Auth
// API need to be defined here.
Expand Down