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

[v16] Add Contacts Audit Events #50548

Merged
merged 3 commits into from
Dec 23, 2024
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
97 changes: 97 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4635,6 +4635,8 @@ message OneOf {
events.UserTaskCreate UserTaskCreate = 188;
events.UserTaskUpdate UserTaskUpdate = 189;
events.UserTaskDelete UserTaskDelete = 190;
events.ContactCreate ContactCreate = 192;
events.ContactDelete ContactDelete = 193;
events.WorkloadIdentityCreate WorkloadIdentityCreate = 194;
events.WorkloadIdentityUpdate WorkloadIdentityUpdate = 195;
events.WorkloadIdentityDelete WorkloadIdentityDelete = 196;
Expand Down Expand Up @@ -7672,3 +7674,98 @@ message UserLoginAccessListInvalid {
(gogoproto.jsontag) = ""
];
}

// ContactCreate is emitted when a contact is created.
message ContactCreate {
// Metadata is a common event metadata
Metadata Metadata = 1 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// ResourceMetadata is a common resource event metadata
ResourceMetadata Resource = 2 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// User is a common user event metadata
UserMetadata User = 3 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// ConnectionMetadata holds information about the connection
ConnectionMetadata Connection = 4 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// Status indicates whether the creation was successful.
Status Status = 5 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// Email is the Email of the contact being deleted
string Email = 6 [(gogoproto.jsontag) = "email"];

// ContactType is the type of the contact being deleted ('Business' or 'Security')
ContactType ContactType = 7 [(gogoproto.jsontag) = "contact_type"];
}

// ContactDelete is emitted when a contact is deleted.
message ContactDelete {
// Metadata is a common event metadata
Metadata Metadata = 1 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// ResourceMetadata is a common resource event metadata
ResourceMetadata Resource = 2 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// User is a common user event metadata
UserMetadata User = 3 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// ConnectionMetadata holds information about the connection
ConnectionMetadata Connection = 4 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// Status indicates whether the deletion was successful.
Status Status = 5 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// Email is the Email of the contact being deleted
string Email = 6 [(gogoproto.jsontag) = "email"];

// ContactType is the type of the contact being deleted ('Business' or 'Security')
ContactType ContactType = 7 [(gogoproto.jsontag) = "contact_type"];
}

// ContactType is the type of contact being added.
enum ContactType {
CONTACT_TYPE_UNSPECIFIED = 0;
CONTACT_TYPE_BUSINESS = 1;
CONTACT_TYPE_SECURITY = 2;
}
8 changes: 8 additions & 0 deletions api/types/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2387,3 +2387,11 @@ func (m *WorkloadIdentityUpdate) TrimToMaxSize(maxSize int) AuditEvent {
func (m *WorkloadIdentityDelete) TrimToMaxSize(_ int) AuditEvent {
return m
}

func (m *ContactCreate) TrimToMaxSize(_ int) AuditEvent {
return m
}

func (m *ContactDelete) TrimToMaxSize(_ int) AuditEvent {
return m
}
Loading
Loading