v1

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Overview

Package v1 is the v1 version of the API.

Index

Constants

View Source
const (
	SpaceSlot = iota
	ExclamationSlot
	DoubleQouteSlot
	NumberSlot
	DollarSlot
	PrecentSlot

	SingleQouteSlot
	LeftRoundBrecketSlot
	RightRoundBrecketSlot
	MultSlot // 10
	PlusSlot
	CommentSlot
	MinusSlot
	DotSlot
	DivSlot
	ColonSlot
	SemiSlot
	LtSlot
	EqualSlot
	GtSlot // 20
	QuestionSlot
	CommaSlot
	LeftSquareBrecketSlot
	RdivideSlot
	RightSquareBrecketSlot
	PowerSlot
	UnderscoreSlot
	AccentSlot
	LeftCurlyBrecketSlot
	PipeSlot // 30
	RightCurlyBrecketSlot
	HomeSlot // 32

	UnicodeCharSlot // 34
)

Slots and counters for AsciiDaya: 0-31 (32) nonReadableRCharCounter 32-47 (16) slots 0-15 respectivly 48-57 (10) digitCounter 58-64 (6) slots 16-22 65-90 (26) smallLetterCounter 91-96 (6) slots 23-28 97-122 (26) capitalLetterCounter 123-126 (4) slots 29-32 127 (1) nonReadableRCharCounter Slots: <SPACE> ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~

0    1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
View Source
const (
	SlashAsteriskCommentSlot = iota + 35
	SqlCommentSlot
	HexSlot
	LASTSLOT__
)
View Source
const (
	TotalCounter = iota
	LetterCounter
	DigitCounter
	SpecialCharCounter
	WordCounter
	NumberCounter
	SpareCounter1__
	SpareCounter2__
)

Variables

View Source
var (
	// SchemeBuilder initializes a scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var CounterName = map[int]string{
	TotalCounter:       "TotalCounter",
	LetterCounter:      "LetterCounter",
	DigitCounter:       "DigitCounter",
	SpecialCharCounter: "SpecialCharCounter",
	WordCounter:        "WordCounter",
	NumberCounter:      "NumberCounter",
	SpareCounter1__:    "<UnusedCounter>",
	SpareCounter2__:    "<UnusedCounter>",
}
View Source
var FlagName = map[int]string{
	SpaceSlot:              "Space",
	ExclamationSlot:        "Exclamation",
	DoubleQouteSlot:        "DoubleQoute",
	NumberSlot:             "NumberSign",
	DollarSlot:             "DollarSign",
	PrecentSlot:            "PrecentSign",
	SingleQouteSlot:        "SingleQoute",
	LeftRoundBrecketSlot:   "LeftRoundBrecket",
	RightRoundBrecketSlot:  "RightRoundBrecket",
	MultSlot:               "MultiplySign",
	PlusSlot:               "PlusSign",
	CommentSlot:            "CommentSign",
	MinusSlot:              "MinusSign",
	DotSlot:                "DotSign",
	DivSlot:                "DivideSign",
	ColonSlot:              "ColonSign",
	SemiSlot:               "SemicolonSign",
	LtSlot:                 "LessThenSign",
	EqualSlot:              "EqualSign",
	GtSlot:                 "GreaterThenSign",
	QuestionSlot:           "QuestionMark",
	CommaSlot:              "CommaSign",
	LeftSquareBrecketSlot:  "LeftSquareBrecket",
	RdivideSlot:            "ReverseDivideSign",
	RightSquareBrecketSlot: "RightSquareBrecket",
	PowerSlot:              "PowerSign",
	UnderscoreSlot:         "UnderscoreSign",
	AccentSlot:             "AccentSign",
	LeftCurlyBrecketSlot:   "LeftCurlyBrecket",
	PipeSlot:               "PipeSign",
	RightCurlyBrecketSlot:  "RightCurlyBrecket",

	UnicodeCharSlot:          "UnicodeChar",
	SlashAsteriskCommentSlot: "CommentCombination",
	SqlCommentSlot:           "SqlComment",
	HexSlot:                  "HexCombination",
	// contains filtered or unexported fields
}
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: wsecurity.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func NameFlags

func NameFlags(f uint64) string

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func SetFlags

func SetFlags(slots []int) (f uint64)

Types

type Consult

type Consult struct {
	Active             bool   `json:"active"` // False means never consult guard
	RequestsPerMinuete uint16 `json:"rpm"`    // Maximum rpm allows for consulting guard
}

Decission process If request profile allowed by ReqConfig: - Main Critiria

<Allow> + Log and gather statistics

If Consult.Active and did not cross Consult.RequestsPerMinuete

If request profile allowed by Guard:  - Secondary Critiria
       <Allow> + Log and gather statistics

Log and gather statistics about request not allowed If ForceAllow

<Allow>		// used for example when ReqConfig is not ready

<Block>

func (*Consult) DeepCopy

func (in *Consult) DeepCopy() *Consult

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Consult.

func (*Consult) DeepCopyInto

func (in *Consult) DeepCopyInto(out *Consult)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Guardian

type Guardian struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec *GuardianSpec `json:"spec"`
}

Guardian is a specification for a Guaerdian resource

func (*Guardian) DeepCopy

func (in *Guardian) DeepCopy() *Guardian

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Guardian.

func (*Guardian) DeepCopyInto

func (in *Guardian) DeepCopyInto(out *Guardian)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Guardian) DeepCopyObject

func (in *Guardian) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GuardianList

type GuardianList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Guardian `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object GuardianList is a list of Guaerdian resources

func (*GuardianList) DeepCopy

func (in *GuardianList) DeepCopy() *GuardianList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GuardianList.

func (*GuardianList) DeepCopyInto

func (in *GuardianList) DeepCopyInto(out *GuardianList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GuardianList) DeepCopyObject

func (in *GuardianList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GuardianSpec

type GuardianSpec WsGate

func (*GuardianSpec) DeepCopy

func (in *GuardianSpec) DeepCopy() *GuardianSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GuardianSpec.

func (*GuardianSpec) DeepCopyInto

func (in *GuardianSpec) DeepCopyInto(out *GuardianSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HeadersConfig

type HeadersConfig struct {
	Kv KeyValConfig `json:"kv"`
}

func (*HeadersConfig) AddTypicalVal

func (config *HeadersConfig) AddTypicalVal()

Allow typical values - use for development but not in production

func (*HeadersConfig) Decide

func (config *HeadersConfig) Decide(h *HeadersProfile) string

func (*HeadersConfig) DeepCopy

func (in *HeadersConfig) DeepCopy() *HeadersConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeadersConfig.

func (*HeadersConfig) DeepCopyInto

func (in *HeadersConfig) DeepCopyInto(out *HeadersConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HeadersConfig) Marshal

func (config *HeadersConfig) Marshal(depth int) string

type HeadersProfile

type HeadersProfile struct {
	Kv *KeyValProfile
}

func (*HeadersProfile) DeepCopy

func (in *HeadersProfile) DeepCopy() *HeadersProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeadersProfile.

func (*HeadersProfile) DeepCopyInto

func (in *HeadersProfile) DeepCopyInto(out *HeadersProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HeadersProfile) Profile

func (h *HeadersProfile) Profile(m map[string][]string)

type KeyValConfig

type KeyValConfig struct {
	Vals          map[string]*SimpleValConfig `json:"vals"`          // Profile the value of whitelisted keys
	MinimalSet    map[string]void             `json:"minimalSet"`    // Mandatory keys
	OtherVals     *SimpleValConfig            `json:"otherVals"`     // Profile the values of other keys
	OtherKeynames *SimpleValConfig            `json:"otherKeynames"` // Profile the keynames of other keys
}

func (*KeyValConfig) Decide

func (config *KeyValConfig) Decide(kvp *KeyValProfile) string

func (*KeyValConfig) DeepCopy

func (in *KeyValConfig) DeepCopy() *KeyValConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyValConfig.

func (*KeyValConfig) DeepCopyInto

func (in *KeyValConfig) DeepCopyInto(out *KeyValConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*KeyValConfig) Describe

func (config *KeyValConfig) Describe() string

func (*KeyValConfig) Marshal

func (config *KeyValConfig) Marshal(depth int) string

func (*KeyValConfig) SetMandatoryKeys

func (config *KeyValConfig) SetMandatoryKeys(minimalSet []string)

Define which of the known keynames is mandatory (if any) Must call WhitelistKnownKeys before setting keys as Mandatory

func (*KeyValConfig) WhitelistByExample

func (config *KeyValConfig) WhitelistByExample(k string, v string)

Allow keynames and their values based on examples Can be called multiple times to add examples for keynames or values Use this when the keynames are not known in advance Call multiple times to show the entire range of keynames and values When keys are known in advance, use WhitelistKnownKeys() instead

func (*KeyValConfig) WhitelistKnownKeys

func (config *KeyValConfig) WhitelistKnownKeys(m map[string]string)

Allow a list of specific keys and an example of their values Can be called multiple times to add keys or to add examples for values Use this when the keynames are known in advance Call multiple times to show the entire range of values per key For keys not known in advance, use WhitelistByExample() instead

type KeyValProfile

type KeyValProfile struct {
	Vals map[string]*SimpleValProfile
}

func (*KeyValProfile) DeepCopy

func (in *KeyValProfile) DeepCopy() *KeyValProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyValProfile.

func (*KeyValProfile) DeepCopyInto

func (in *KeyValProfile) DeepCopyInto(out *KeyValProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*KeyValProfile) Profile

func (kvp *KeyValProfile) Profile(m map[string][]string)

Profile a generic map of key vals where we expect: keys belonging to some contstant list of keys vals have some defined charactaristics

type QueryConfig

type QueryConfig struct {
	Kv KeyValConfig `json:"kv"`
}

func (*QueryConfig) AddTypicalVal

func (config *QueryConfig) AddTypicalVal()

Allow typical query string values - use for development but not in production

func (*QueryConfig) Decide

func (config *QueryConfig) Decide(q *QueryProfile) string

func (*QueryConfig) DeepCopy

func (in *QueryConfig) DeepCopy() *QueryConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryConfig.

func (*QueryConfig) DeepCopyInto

func (in *QueryConfig) DeepCopyInto(out *QueryConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*QueryConfig) Marshal

func (config *QueryConfig) Marshal(depth int) string

type QueryProfile

type QueryProfile struct {
	Kv *KeyValProfile
}

func (*QueryProfile) DeepCopy

func (in *QueryProfile) DeepCopy() *QueryProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueryProfile.

func (*QueryProfile) DeepCopyInto

func (in *QueryProfile) DeepCopyInto(out *QueryProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*QueryProfile) Profile

func (q *QueryProfile) Profile(m map[string][]string)

type ReqConfig

type ReqConfig struct {
	Url     UrlConfig     `json:"url"`
	Qs      QueryConfig   `json:"qs"`
	Headers HeadersConfig `json:"headers"`
}

func (*ReqConfig) AddTypicalVal

func (config *ReqConfig) AddTypicalVal()

Allow typical values - use for development but not in production

func (*ReqConfig) Decide

func (config *ReqConfig) Decide(rp *ReqProfile) string

func (*ReqConfig) DeepCopy

func (in *ReqConfig) DeepCopy() *ReqConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReqConfig.

func (*ReqConfig) DeepCopyInto

func (in *ReqConfig) DeepCopyInto(out *ReqConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReqConfig) Marshal

func (config *ReqConfig) Marshal(depth int) string

type ReqProfile

type ReqProfile struct {
	Url     *UrlProfile
	Query   *QueryProfile
	Headers *HeadersProfile
}

func (*ReqProfile) DeepCopy

func (in *ReqProfile) DeepCopy() *ReqProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReqProfile.

func (*ReqProfile) DeepCopyInto

func (in *ReqProfile) DeepCopyInto(out *ReqProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReqProfile) Profile

func (rp *ReqProfile) Profile(req *http.Request)

type SimpleValConfig

type SimpleValConfig struct {
	Flags uint64 `json:"flags"`
	//Counters     [8]U8MinmaxSlice
	Runes        U8MinmaxSlice `json:"runes"`
	Digits       U8MinmaxSlice `json:"digits"`
	Letters      U8MinmaxSlice `json:"letters"`
	SpecialChars U8MinmaxSlice `json:"schars"`
	Words        U8MinmaxSlice `json:"words"`
	Numbers      U8MinmaxSlice `json:"numbers"`
	UnicodeFlags Uint64Slice   `json:"unicodeFlags"` //[]uint64
}

func NewSimpleValConfig

func NewSimpleValConfig(runes, letters, digits, specialChars, words, numbers uint8) *SimpleValConfig

func (*SimpleValConfig) AddValExample

func (config *SimpleValConfig) AddValExample(str string)

Allow generic value based on example (whitelisting) Call multiple times top present multiple examples

func (*SimpleValConfig) Decide

func (config *SimpleValConfig) Decide(svp *SimpleValProfile) string

func (svp *SimpleValProfile) Decide(config *SimpleValConfig) string {

func (*SimpleValConfig) DeepCopy

func (in *SimpleValConfig) DeepCopy() *SimpleValConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleValConfig.

func (*SimpleValConfig) DeepCopyInto

func (in *SimpleValConfig) DeepCopyInto(out *SimpleValConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SimpleValConfig) Describe

func (config *SimpleValConfig) Describe() string

func (*SimpleValConfig) Marshal

func (config *SimpleValConfig) Marshal(depth int) string

func (*SimpleValConfig) NameFlags

func (config *SimpleValConfig) NameFlags() string

type SimpleValProfile

type SimpleValProfile struct {
	Flags uint64
	//BasicCounters [8]uint8
	Runes        uint8
	Digits       uint8
	Letters      uint8
	SpecialChars uint8
	Words        uint8
	Numbers      uint8
	UnicodeFlags Uint64Slice //[]uint64
}

func (*SimpleValProfile) DeepCopy

func (in *SimpleValProfile) DeepCopy() *SimpleValProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleValProfile.

func (*SimpleValProfile) DeepCopyInto

func (in *SimpleValProfile) DeepCopyInto(out *SimpleValProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SimpleValProfile) Describe

func (svp *SimpleValProfile) Describe() string

func (*SimpleValProfile) NameFlags

func (svp *SimpleValProfile) NameFlags() string

func (*SimpleValProfile) Profile

func (svp *SimpleValProfile) Profile(str string)

Profile generic value where we expect: some short combination of chars mainly english letters and/or digits (ascii) potentially some small content of special chars typically no unicode

type U8Minmax

type U8Minmax struct {
	Min uint8 `json:"min"`
	Max uint8 `json:"max"`
}

func (*U8Minmax) DeepCopy

func (in *U8Minmax) DeepCopy() *U8Minmax

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new U8Minmax.

func (*U8Minmax) DeepCopyInto

func (in *U8Minmax) DeepCopyInto(out *U8Minmax)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type U8MinmaxSlice

type U8MinmaxSlice []U8Minmax

func (U8MinmaxSlice) AddValExample

func (mms U8MinmaxSlice) AddValExample(v uint8) U8MinmaxSlice

func (U8MinmaxSlice) Decide

func (mms U8MinmaxSlice) Decide(v uint8) string

func (U8MinmaxSlice) DeepCopy

func (in U8MinmaxSlice) DeepCopy() U8MinmaxSlice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new U8MinmaxSlice.

func (U8MinmaxSlice) DeepCopyInto

func (in U8MinmaxSlice) DeepCopyInto(out *U8MinmaxSlice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (U8MinmaxSlice) Describe

func (mms U8MinmaxSlice) Describe() string

func (U8MinmaxSlice) Marshal

func (mms U8MinmaxSlice) Marshal() string

type Uint64Slice

type Uint64Slice []uint64

func (Uint64Slice) Add

func (base Uint64Slice) Add(val Uint64Slice) Uint64Slice

func (Uint64Slice) Decide

func (base Uint64Slice) Decide(val Uint64Slice) string

func (Uint64Slice) DeepCopy

func (in Uint64Slice) DeepCopy() Uint64Slice

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Uint64Slice.

func (Uint64Slice) DeepCopyInto

func (in Uint64Slice) DeepCopyInto(out *Uint64Slice)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Uint64Slice) Describe

func (uint64Slice Uint64Slice) Describe() string

func (Uint64Slice) Marshal

func (uint64Slice Uint64Slice) Marshal() string

type UrlConfig

type UrlConfig struct {
	Val      SimpleValConfig `json:"val"`
	Segments U8MinmaxSlice   `json:"segments"`
}

func (*UrlConfig) AddTypicalVal

func (config *UrlConfig) AddTypicalVal()

Allow typical URL values - use for development but not in production

func (*UrlConfig) Decide

func (config *UrlConfig) Decide(u *UrlProfile) string

func (*UrlConfig) DeepCopy

func (in *UrlConfig) DeepCopy() *UrlConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UrlConfig.

func (*UrlConfig) DeepCopyInto

func (in *UrlConfig) DeepCopyInto(out *UrlConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UrlConfig) Marshal

func (config *UrlConfig) Marshal(depth int) string

type UrlProfile

type UrlProfile struct {
	Val      *SimpleValProfile
	Segments uint8
}

func (*UrlProfile) DeepCopy

func (in *UrlProfile) DeepCopy() *UrlProfile

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UrlProfile.

func (*UrlProfile) DeepCopyInto

func (in *UrlProfile) DeepCopyInto(out *UrlProfile)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UrlProfile) Profile

func (u *UrlProfile) Profile(path string)

type WsGate

type WsGate struct {
	Req          ReqConfig `json:"req"`        // Main critiria for blocking/allowing
	ConsultGuard Consult   `json:"consult"`    // If blocked by main critiria, consult guard (if avaliable)
	ForceAllow   bool      `json:"forceAllow"` // Allow no matter what! Overides all blocking.
}

func (*WsGate) DeepCopy

func (in *WsGate) DeepCopy() *WsGate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WsGate.

func (*WsGate) DeepCopyInto

func (in *WsGate) DeepCopyInto(out *WsGate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WsGate) Marshal

func (g *WsGate) Marshal(depth int) string

Jump to

Keyboard shortcuts

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