dlp

package
v1.6.0-beta19 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Action_ActionType_name = map[int32]string{
		0: "CUSTOM",
		1: "SSN",
		2: "MASTERCARD",
		3: "VISA",
		4: "AMEX",
		5: "DISCOVER",
		6: "JCB",
		7: "DINERS_CLUB",
		8: "CREDIT_CARD_TRACKERS",
		9: "ALL_CREDIT_CARDS",
	}
	Action_ActionType_value = map[string]int32{
		"CUSTOM":               0,
		"SSN":                  1,
		"MASTERCARD":           2,
		"VISA":                 3,
		"AMEX":                 4,
		"DISCOVER":             5,
		"JCB":                  6,
		"DINERS_CLUB":          7,
		"CREDIT_CARD_TRACKERS": 8,
		"ALL_CREDIT_CARDS":     9,
	}
)

Enum value maps for Action_ActionType.

View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_dlp_dlp_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Action

type Action struct {

	// The action type to implement.
	ActionType Action_ActionType `` /* 140-byte string literal not displayed */
	// The custom user action to be applied.
	// This field will only be used if the custom action type is specified above.
	CustomAction *CustomAction `protobuf:"bytes,2,opt,name=custom_action,json=customAction,proto3" json:"custom_action,omitempty"`
	// Shadow represents whether the action should be taken, or just recorded.
	Shadow bool `protobuf:"varint,3,opt,name=shadow,proto3" json:"shadow,omitempty"`
	// contains filtered or unexported fields
}

A single action meant to mask sensitive data. The action type represents a set of pre configured actions, as well as the ability to create custom actions. These actions can also be shadowed, a shadowed action will be recorded in the statistics, and debug logs, but not actually committed in the response body.

To use a pre-made action simply set the action type to anything other than `CUSTOM`

``` yaml actionType: VISA ```

To create a custom action set the custom action field. The default enum value is custom, so that can be left empty.

``` yaml customAction: name: test regex: - "hello" - "world" maskChar: Y percent: 60 ```

func (*Action) Descriptor deprecated

func (*Action) Descriptor() ([]byte, []int)

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) Equal

func (m *Action) Equal(that interface{}) bool

Equal function

func (*Action) GetActionType

func (x *Action) GetActionType() Action_ActionType

func (*Action) GetCustomAction

func (x *Action) GetCustomAction() *CustomAction

func (*Action) GetShadow

func (x *Action) GetShadow() bool

func (*Action) Hash added in v1.2.13

func (m *Action) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect added in v1.6.0

func (x *Action) ProtoReflect() protoreflect.Message

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type Action_ActionType

type Action_ActionType int32

The following pre-made action types map to the following regex matchers:

SSN: - '(?!\D)[0-9]{9}(?=\D|$)' - '(?!\D)[0-9]{3}\-[0-9]{2}\-[0-9]{4}(?=\D|$)' - '(?!\D)[0-9]{3}\ [0-9]{2}\ [0-9]{4}(?=\D|$)'

MASTERCARD: - '(?!\D)5[1-5][0-9]{2}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(?=\D|$)'

VISA: - '(?!\D)4[0-9]{3}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(?=\D|$)'

AMEX: - '(?!\D)(34|37)[0-9]{2}(\ |\-|)[0-9]{6}(\ |\-|)[0-9]{5}(?=\D|$)'

DISCOVER: - '(?!\D)6011(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(?=\D|$)'

JCB: - '(?!\D)3[0-9]{3}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(\ |\-|)[0-9]{4}(?=\D|$)' - '(?!\D)(2131|1800)[0-9]{11}(?=\D|$)'

DINERS_CLUB: - '(?!\D)30[0-5][0-9](\ |\-|)[0-9]{6}(\ |\-|)[0-9]{4}(?=\D|$)' - '(?!\D)(36|38)[0-9]{2}(\ |\-|)[0-9]{6}(\ |\-|)[0-9]{4}(?=\D|$)'

CREDIT_CARD_TRACKERS: - '[1-9][0-9]{2}\-[0-9]{2}\-[0-9]{4}\^\d' - '(?!\D)\%?[Bb]\d{13,19}\^[\-\/\.\w\s]{2,26}\^[0-9][0-9][01][0-9][0-9]{3}' - '(?!\D)\;\d{13,19}\=(\d{3}|)(\d{4}|\=)'

ALL_CREDIT_CARDS: - (All credit card related regexes from above)

const (
	Action_CUSTOM               Action_ActionType = 0
	Action_SSN                  Action_ActionType = 1
	Action_MASTERCARD           Action_ActionType = 2
	Action_VISA                 Action_ActionType = 3
	Action_AMEX                 Action_ActionType = 4
	Action_DISCOVER             Action_ActionType = 5
	Action_JCB                  Action_ActionType = 6
	Action_DINERS_CLUB          Action_ActionType = 7
	Action_CREDIT_CARD_TRACKERS Action_ActionType = 8
	Action_ALL_CREDIT_CARDS     Action_ActionType = 9
)

func (Action_ActionType) Descriptor added in v1.6.0

func (Action_ActionType) Enum added in v1.6.0

func (Action_ActionType) EnumDescriptor deprecated

func (Action_ActionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Action_ActionType.Descriptor instead.

func (Action_ActionType) Number added in v1.6.0

func (Action_ActionType) String

func (x Action_ActionType) String() string

func (Action_ActionType) Type added in v1.6.0

type Config

type Config struct {

	// List of data loss prevention actions to be applied.
	// These actions will be applied in order, one at a time.
	Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

Route/Vhost level config for dlp filter

If a config is present on the route or vhost level it will completely overwrite the listener level config.

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) Equal

func (m *Config) Equal(that interface{}) bool

Equal function

func (*Config) GetActions

func (x *Config) GetActions() []*Action

func (*Config) Hash added in v1.2.13

func (m *Config) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect added in v1.6.0

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type CustomAction

type CustomAction struct {

	// The name of the custom action.
	// This name is used for logging and debugging purposes.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The list of regex strings which will be applied in order.
	Regex []string `protobuf:"bytes,2,rep,name=regex,proto3" json:"regex,omitempty"`
	// The masking character for the sensitive data.
	// default value: X
	MaskChar string `protobuf:"bytes,3,opt,name=mask_char,json=maskChar,proto3" json:"mask_char,omitempty"`
	// The percent of the string which will be masked by the mask_char
	// default value: 75%
	// rounds ratio (percent/100) by std::round http://www.cplusplus.com/reference/cmath/round/
	Percent *_type.Percent `protobuf:"bytes,4,opt,name=percent,proto3" json:"percent,omitempty"`
	// contains filtered or unexported fields
}

A user defined custom action to carry out on the response body.

The list of regex strings are applied in order. So for instance, if there is a response body with the content: `hello world`

And there is a custom action ``` yaml customAction: name: test regex: - "hello" - "world" maskChar: Y percent: 60 ```

the result would be: `YYYlo YYYld`

If the mask_char, and percent were left to default, the result would be: `XXXXo XXXXd`

func (*CustomAction) Descriptor deprecated

func (*CustomAction) Descriptor() ([]byte, []int)

Deprecated: Use CustomAction.ProtoReflect.Descriptor instead.

func (*CustomAction) Equal

func (m *CustomAction) Equal(that interface{}) bool

Equal function

func (*CustomAction) GetMaskChar

func (x *CustomAction) GetMaskChar() string

func (*CustomAction) GetName

func (x *CustomAction) GetName() string

func (*CustomAction) GetPercent

func (x *CustomAction) GetPercent() *_type.Percent

func (*CustomAction) GetRegex

func (x *CustomAction) GetRegex() []string

func (*CustomAction) Hash added in v1.2.13

func (m *CustomAction) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*CustomAction) ProtoMessage

func (*CustomAction) ProtoMessage()

func (*CustomAction) ProtoReflect added in v1.6.0

func (x *CustomAction) ProtoReflect() protoreflect.Message

func (*CustomAction) Reset

func (x *CustomAction) Reset()

func (*CustomAction) String

func (x *CustomAction) String() string

type DlpRule

type DlpRule struct {

	// Matcher by which to determine if the given transformation should be applied
	// if omitted, will it match all (i.e., default to / prefix matcher)
	Matcher *matchers.Matcher `protobuf:"bytes,1,opt,name=matcher,proto3" json:"matcher,omitempty"`
	// List of data loss prevention actions to be applied.
	// These actions will be applied in order, one at a time.
	Actions []*Action `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
	// contains filtered or unexported fields
}

Rule which applies a given set of actions to a matching route. The route matching functions exactly the same as the envoy routes in the virtual host.

func (*DlpRule) Descriptor deprecated

func (*DlpRule) Descriptor() ([]byte, []int)

Deprecated: Use DlpRule.ProtoReflect.Descriptor instead.

func (*DlpRule) Equal

func (m *DlpRule) Equal(that interface{}) bool

Equal function

func (*DlpRule) GetActions

func (x *DlpRule) GetActions() []*Action

func (*DlpRule) GetMatcher

func (x *DlpRule) GetMatcher() *matchers.Matcher

func (*DlpRule) Hash added in v1.2.13

func (m *DlpRule) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*DlpRule) ProtoMessage

func (*DlpRule) ProtoMessage()

func (*DlpRule) ProtoReflect added in v1.6.0

func (x *DlpRule) ProtoReflect() protoreflect.Message

func (*DlpRule) Reset

func (x *DlpRule) Reset()

func (*DlpRule) String

func (x *DlpRule) String() string

type FilterConfig

type FilterConfig struct {

	// The list of transformation, matcher pairs.
	// The first rule which matches will be applied.
	DlpRules []*DlpRule `protobuf:"bytes,1,rep,name=dlp_rules,json=dlpRules,proto3" json:"dlp_rules,omitempty"`
	// contains filtered or unexported fields
}

Listener level config for dlp filter

func (*FilterConfig) Descriptor deprecated

func (*FilterConfig) Descriptor() ([]byte, []int)

Deprecated: Use FilterConfig.ProtoReflect.Descriptor instead.

func (*FilterConfig) Equal

func (m *FilterConfig) Equal(that interface{}) bool

Equal function

func (*FilterConfig) GetDlpRules

func (x *FilterConfig) GetDlpRules() []*DlpRule

func (*FilterConfig) Hash added in v1.2.13

func (m *FilterConfig) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*FilterConfig) ProtoMessage

func (*FilterConfig) ProtoMessage()

func (*FilterConfig) ProtoReflect added in v1.6.0

func (x *FilterConfig) ProtoReflect() protoreflect.Message

func (*FilterConfig) Reset

func (x *FilterConfig) Reset()

func (*FilterConfig) String

func (x *FilterConfig) String() string

Jump to

Keyboard shortcuts

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