Skip to content

Commit

Permalink
Add audit events for static host users
Browse files Browse the repository at this point in the history
Emits audit events in response to users modifying or creating
StaticHostUser resources.

Updates #42712
  • Loading branch information
rosstimothy committed Sep 4, 2024
1 parent f1d68ca commit 5ac5cb1
Show file tree
Hide file tree
Showing 11 changed files with 5,163 additions and 3,393 deletions.
116 changes: 116 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4586,6 +4586,9 @@ message OneOf {
events.PluginCreate PluginCreate = 170;
events.PluginUpdate PluginUpdate = 171;
events.PluginDelete PluginDelete = 172;
events.StaticHostUserCreate StaticHostUserCreate = 173;
events.StaticHostUserUpdate StaticHostUserUpdate = 174;
events.StaticHostUserDelete StaticHostUserDelete = 175;
}
}

Expand Down Expand Up @@ -6858,3 +6861,116 @@ message SPIFFEFederationDelete {
(gogoproto.jsontag) = ""
];
}

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

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

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

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

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

// StaticHostUserUpdate is emitted when a static host user is updated.
message StaticHostUserUpdate {
// 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) = ""
];

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

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

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

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

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

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

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

0 comments on commit 5ac5cb1

Please sign in to comment.