mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-16 12:51:44 +00:00
81 lines
No EOL
2.9 KiB
Protocol Buffer
81 lines
No EOL
2.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
import "buf/validate/validate.proto";
|
|
|
|
package audit.v1;
|
|
|
|
option go_package = "./audit;auditV1";
|
|
option java_multiple_files = true;
|
|
option java_package = "com.schwarz.stackit.audit.v1";
|
|
|
|
enum Visibility {
|
|
VISIBILITY_UNSPECIFIED = 0;
|
|
// Will be routed to customer data sinks
|
|
VISIBILITY_PUBLIC = 1;
|
|
// Will NOT be routed to customer data sinks
|
|
VISIBILITY_PRIVATE = 2;
|
|
}
|
|
|
|
// Identifier of an object.
|
|
//
|
|
// For system events, the nil UUID must be used: 00000000-0000-0000-0000-000000000000.
|
|
message ObjectIdentifier {
|
|
// Identifier of the respective entity (e.g. Identifier of an organization)
|
|
string identifier = 1 [(buf.validate.field).required = true, (buf.validate.field).string.uuid = true];
|
|
|
|
// Entity data type relevant for routing - one of the list of supported singular types.
|
|
string type = 2 [(buf.validate.field).required = true, (buf.validate.field).string.min_len = 1];
|
|
}
|
|
|
|
message EncryptedData {
|
|
// Encrypted serialized protobuf content (the actual audit event)
|
|
bytes data = 1 [(buf.validate.field).required = true, (buf.validate.field).bytes.min_len = 1];
|
|
|
|
// Name of the protobuf type
|
|
string protobuf_type = 2 [(buf.validate.field).required = true, (buf.validate.field).string.min_len = 1];
|
|
|
|
// The password taken to derive the encryption key from
|
|
string encrypted_password = 3 [(buf.validate.field).required = true, (buf.validate.field).string.min_len = 1];
|
|
|
|
// Version of the encrypted key
|
|
int32 key_version = 4 [(buf.validate.field).int32.gte = 1];
|
|
}
|
|
|
|
message UnencryptedData {
|
|
// Unencrypted serialized protobuf content (the actual audit event)
|
|
bytes data = 1 [(buf.validate.field).required = true, (buf.validate.field).bytes.min_len = 1];
|
|
|
|
// Name of the protobuf type
|
|
string protobuf_type = 2 [(buf.validate.field).required = true, (buf.validate.field).string.min_len = 1];
|
|
}
|
|
|
|
message RoutableAuditEvent {
|
|
|
|
// Functional event name with pattern
|
|
//
|
|
// Format: stackit.<product>.<version>.<type>.<operation>
|
|
//
|
|
// Examples:
|
|
// "stackit.resource-manager.v1.organization.created"
|
|
// "stackit.authorization.v2.organization.moved"
|
|
// "stackit.authorization.v2.folder.moved"
|
|
string operation_name = 1 [
|
|
(buf.validate.field).required = true,
|
|
(buf.validate.field).string.pattern = "^stackit\\.[a-z0-9-]+\\.v[1-9][0-9]*\\.[a-z0-9-]+\\.[a-z0-9-]+$"
|
|
];
|
|
|
|
// Visibility relevant for differentiating between internal and public events
|
|
Visibility visibility = 2 [(buf.validate.field).required = true, (buf.validate.field).enum.defined_only = true];
|
|
|
|
// Identifier the audit log event refers to.
|
|
//
|
|
// System events, will not be routed to the end-user.
|
|
ObjectIdentifier object_identifier = 3 [(buf.validate.field).required = true];
|
|
|
|
// The actual audit event is transferred in one of the attributes below
|
|
oneof data {
|
|
option (buf.validate.oneof).required = true;
|
|
UnencryptedData unencrypted_data = 4;
|
|
EncryptedData encrypted_data = 5;
|
|
}
|
|
} |