filtering

package
v0.0.0-...-05145c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

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

func WithExcludes(excludes ...string) Option

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

func WithIncludes(includes ...string) Option

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

Process with receiver PrincipalEmailMatcher filters log requests when the principal email matches an `include` or `exclude` regular expression. We use the following filtering logic:

  1. If include == nil and exclude == nil, we pass the request.

  2. If include != nil and exclude == nil, we only pass the request when the principal matches include.

  3. If include == nil and exclude != nil, we only drop the request when the principal matches exclude.

  4. If include != nil and exclude != nil, we drop the request when the principal doesn't match include and matches exclude.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL