Documentation ¶
Overview ¶
Package v1 is the v1 version of the API.
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func NameFlags(f uint64) string
- func Resource(resource string) schema.GroupResource
- func SetFlags(slots []int) (f uint64)
- type Consult
- type Guardian
- type GuardianList
- type GuardianSpec
- type HeadersConfig
- type HeadersProfile
- type KeyValConfig
- func (config *KeyValConfig) Decide(kvp *KeyValProfile) string
- func (in *KeyValConfig) DeepCopy() *KeyValConfig
- func (in *KeyValConfig) DeepCopyInto(out *KeyValConfig)
- func (config *KeyValConfig) Describe() string
- func (config *KeyValConfig) Marshal(depth int) string
- func (config *KeyValConfig) SetMandatoryKeys(minimalSet []string)
- func (config *KeyValConfig) WhitelistByExample(k string, v string)
- func (config *KeyValConfig) WhitelistKnownKeys(m map[string]string)
- type KeyValProfile
- type QueryConfig
- type QueryProfile
- type ReqConfig
- type ReqProfile
- type SimpleValConfig
- func (config *SimpleValConfig) AddValExample(str string)
- func (config *SimpleValConfig) Decide(svp *SimpleValProfile) string
- func (in *SimpleValConfig) DeepCopy() *SimpleValConfig
- func (in *SimpleValConfig) DeepCopyInto(out *SimpleValConfig)
- func (config *SimpleValConfig) Describe() string
- func (config *SimpleValConfig) Marshal(depth int) string
- func (config *SimpleValConfig) NameFlags() string
- type SimpleValProfile
- type U8Minmax
- type U8MinmaxSlice
- func (mms U8MinmaxSlice) AddValExample(v uint8) U8MinmaxSlice
- func (mms U8MinmaxSlice) Decide(v uint8) string
- func (in U8MinmaxSlice) DeepCopy() U8MinmaxSlice
- func (in U8MinmaxSlice) DeepCopyInto(out *U8MinmaxSlice)
- func (mms U8MinmaxSlice) Describe() string
- func (mms U8MinmaxSlice) Marshal() string
- type Uint64Slice
- func (base Uint64Slice) Add(val Uint64Slice) Uint64Slice
- func (base Uint64Slice) Decide(val Uint64Slice) string
- func (in Uint64Slice) DeepCopy() Uint64Slice
- func (in Uint64Slice) DeepCopyInto(out *Uint64Slice)
- func (uint64Slice Uint64Slice) Describe() string
- func (uint64Slice Uint64Slice) Marshal() string
- type UrlConfig
- type UrlProfile
- type WsGate
Constants ¶
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
const ( SlashAsteriskCommentSlot = iota + 35 SqlCommentSlot HexSlot LASTSLOT__ )
const ( TotalCounter = iota LetterCounter DigitCounter SpecialCharCounter WordCounter NumberCounter SpareCounter1__ SpareCounter2__ )
Variables ¶
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 )
var CounterName = map[int]string{ TotalCounter: "TotalCounter", LetterCounter: "LetterCounter", DigitCounter: "DigitCounter", SpecialCharCounter: "SpecialCharCounter", WordCounter: "WordCounter", NumberCounter: "NumberCounter", SpareCounter1__: "<UnusedCounter>", SpareCounter2__: "<UnusedCounter>", }
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 }
var SchemeGroupVersion = schema.GroupVersion{Group: wsecurity.GroupName, Version: "v1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Consult.
func (*Consult) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Guardian.
func (*Guardian) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Guardian) DeepCopyObject ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReqConfig.
func (*ReqConfig) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 ¶
func (*U8Minmax) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new U8Minmax.
func (*U8Minmax) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UrlConfig.
func (*UrlConfig) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WsGate.
func (*WsGate) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.