Skip to content

Commit

Permalink
Add UserTask audit events
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Oct 17, 2024
1 parent 3e75921 commit cf75cbb
Show file tree
Hide file tree
Showing 14 changed files with 3,806 additions and 1,558 deletions.
147 changes: 147 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4613,6 +4613,9 @@ message OneOf {
events.AutoUpdateAgentPlanCreate AutoUpdateAgentPlanCreate = 185;
events.AutoUpdateAgentPlanUpdate AutoUpdateAgentPlanUpdate = 186;
events.AutoUpdateAgentPlanDelete AutoUpdateAgentPlanDelete = 187;
events.UserTaskCreate UserTaskCreate = 188;
events.UserTaskUpdate UserTaskUpdate = 189;
events.UserTaskDelete UserTaskDelete = 190;
}
}

Expand Down Expand Up @@ -7406,3 +7409,147 @@ message AutoUpdateAgentPlanDelete {
(gogoproto.jsontag) = ""
];
}

// UserTaskCreate is emitted when a user task is created.
message UserTaskCreate {
// 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) = ""
];

// UserTaskMetadata holds information about the user task.
UserTaskMetadata UserTask = 6 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];
}

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

// UserTaskMetadata holds information about the user task.
UserTaskMetadata UserTask = 6 [
(gogoproto.nullable) = false,
(gogoproto.embed) = true,
(gogoproto.jsontag) = ""
];

// CurrentUserTaskState is the current UserTask State.
string CurrentUserTaskState = 7 [(gogoproto.jsontag) = "current_user_task_state"];

// UpdatedUserTaskState is the updated UserTask State.
string UpdatedUserTaskState = 8 [(gogoproto.jsontag) = "updated_user_task_state"];
}

// UserTaskMetadata contains key fields for the UserTask.
message UserTaskMetadata {
// TaskType is type of the task.
string TaskType = 1 [(gogoproto.jsontag) = "user_task_type"];
// IssueType is type of the issue task.
string IssueType = 2 [(gogoproto.jsontag) = "user_task_issue_type"];
// Integration is type of associated integration.
string Integration = 3 [(gogoproto.jsontag) = "user_task_integration"];
}

// UserTaskDelete is emitted when a user task is deleted.
message UserTaskDelete {
// 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) = ""
];
}
12 changes: 12 additions & 0 deletions api/types/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2290,3 +2290,15 @@ func (m *CrownJewelUpdate) TrimToMaxSize(_ int) AuditEvent {
func (m *CrownJewelDelete) TrimToMaxSize(_ int) AuditEvent {
return m
}

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

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

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

0 comments on commit cf75cbb

Please sign in to comment.