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

Add audit events to Crown Jewel methods #46641

Merged
merged 2 commits into from
Sep 20, 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
126 changes: 126 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4598,6 +4598,9 @@ message OneOf {
events.StaticHostUserCreate StaticHostUserCreate = 179;
events.StaticHostUserUpdate StaticHostUserUpdate = 180;
events.StaticHostUserDelete StaticHostUserDelete = 181;
events.CrownJewelCreate CrownJewelCreate = 182;
events.CrownJewelUpdate CrownJewelUpdate = 183;
events.CrownJewelDelete CrownJewelDelete = 184;
}
}

Expand Down Expand Up @@ -7169,3 +7172,126 @@ message StaticHostUserDelete {
(gogoproto.jsontag) = ""
];
}

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

// Status indicates whether the update was successful.
Status Status = 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) = ""
];

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

// CrownJewelQuery is the query used to track the crown jewel.
string CrownJewelQuery = 6 [(gogoproto.jsontag) = "crown_jewel_query"];
}

// CrownJewelUpdate is emitted when a Access Graph CrownJewel is updated.
message CrownJewelUpdate {
// Metadata is a common event metadata
Metadata Metadata = 1 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// Status indicates whether the update was successful.
Status Status = 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) = ""
];

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

// CurrentCrownJewelQuery is the current query used to track the crown jewel.
string CurrentCrownJewelQuery = 6 [(gogoproto.jsontag) = "current_crown_jewel_query"];

// UpdatedCrownJewelQuery is the new query used to track the crown jewel.
string UpdatedCrownJewelQuery = 7 [(gogoproto.jsontag) = "updated_crown_jewel_query"];
}

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

// Status indicates whether the update was successful.
Status Status = 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) = ""
];

// ResourceMetadata is a common resource event metadata.
ResourceMetadata resource = 5 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];
}
12 changes: 12 additions & 0 deletions api/types/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2278,3 +2278,15 @@ func (m *StaticHostUserUpdate) TrimToMaxSize(maxSize int) AuditEvent {
func (m *StaticHostUserDelete) TrimToMaxSize(maxSize int) AuditEvent {
return m
}

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

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

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