* feat (events): Add new options needed for AuditConfig WithAuditWrapper and WithFilterOperations all for optional paramters when creating AuditConfig types. * refactor (event): Change EventerConfig.Sinks to a ptr We need to modify the SinkConfig.AuditConfig during the NewEventer factory, so we have to use a ptr not a ref. * feat (events): Add audit configuration types * feat (events): add audit config to sink configuration. * feat (events): add redact/encrypt node for audit events to Eventer Integrate the encrypt.Filter node from the eventlogger into the event.Eventer, so audit events can be redacted/encrypted based on data classifications. * test (events) Add test protobufs for events Add test protobufs along with a test service for testing the audit event encrypt node
54 lines
1.7 KiB
Go
54 lines
1.7 KiB
Go
package event
|
|
|
|
import (
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
type (
|
|
Id string
|
|
Op string
|
|
)
|
|
|
|
// RequestInfo defines the fields captured about a Boundary request.
|
|
type RequestInfo struct {
|
|
EventId string `json:"-"`
|
|
Id string `json:"id,omitempty" class:"public"`
|
|
Method string `json:"method,omitempty" class:"public"`
|
|
Path string `json:"path,omitempty" class:"public"`
|
|
PublicId string `json:"public_id,omitempty" class:"public"`
|
|
}
|
|
|
|
// UserInfo defines the fields captured about a user for a Boundary request.
|
|
type UserInfo struct {
|
|
UserId string `json:"id,omitempty" class:"public"`
|
|
AuthAccountId string `json:"auth_account_id,omitempty" class:"public"`
|
|
}
|
|
|
|
type GrantsInfo struct {
|
|
Grants []GrantsPair `json:"grants_pair,omitempty"`
|
|
}
|
|
|
|
type GrantsPair struct {
|
|
Grant string `json:"grant,omitempty" class:"public"`
|
|
ScopeId string `json:"scope_id,omitempty" class:"public"`
|
|
}
|
|
|
|
type Auth struct {
|
|
AuthTokenId string `json:"auth_token_id" class:"public"`
|
|
UserInfo *UserInfo `json:"user_info,omitempty"` // boundary field
|
|
GrantsInfo *GrantsInfo `json:"grants_info,omitempty"`
|
|
UserEmail string `json:"email,omitempty" class:"sensitive"`
|
|
UserName string `json:"name,omitempty" class:"sensitive"`
|
|
}
|
|
|
|
type Request struct {
|
|
Operation string `json:"operation,omitempty" class:"public"` // std audit field
|
|
Endpoint string `json:"endpoint,omitempty" class:"public"` // std audit field
|
|
Details proto.Message `json:"details,omitempty"` // boundary field
|
|
}
|
|
|
|
type Response struct {
|
|
StatusCode int `json:"status_code,omitempty"` // std audit
|
|
Details proto.Message `json:"details,omitempty"` // boundary field
|
|
}
|