Documentation
¶
Overview ¶
Package filtering provides a processor to filter audit log requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(m *PrincipalEmailMatcher) error
An Option is a configuration Option for a PrincipalEmailMatcher.
func WithExcludes ¶
WithExcludes adds include filters by compiling strings into regular expressions. When an audit log request has a principal email that matches one of the regular expressions, the audit log request is dropped by the client. Passing an empty string in `excludes` is a noop.
func WithIncludes ¶
WithIncludes adds include filters by compiling strings into regular expressions. When an audit log request has a principal email that matches one of the regular expressions, the audit log request is allowed for further processing. Passing an empty string in `includes` is a noop.
type PrincipalEmailMatcher ¶
type PrincipalEmailMatcher struct {
// contains filtered or unexported fields
}
PrincipalEmailMatcher applies regexp filters on AuditLogRequest field `Payload.AuthenticationInfo.PrincipalEmail`.
func NewPrincipalEmailMatcher ¶
func NewPrincipalEmailMatcher(opts ...Option) (*PrincipalEmailMatcher, error)
NewPrincipalEmailMatcher creates a PrincipalEmailMatcher with the given options.
func (*PrincipalEmailMatcher) Process ¶
func (p *PrincipalEmailMatcher) Process(_ context.Context, logReq *api.AuditLogRequest) error
Process with receiver PrincipalEmailMatcher filters log requests when the principal email matches an `include` or `exclude` regular expression. We use the following filtering logic:
If include == nil and exclude == nil, we pass the request.
If include != nil and exclude == nil, we only pass the request when the principal matches include.
If include == nil and exclude != nil, we only drop the request when the principal matches exclude.
If include != nil and exclude != nil, we drop the request when the principal doesn't match include and matches exclude.