Documentation
¶
Index ¶
- Constants
- Variables
- func GetCloudConfigUpdatedAt() time.Time
- func Init(environmentConfig *aikido_types.EnvironmentConfigData, ...) error
- func IsBlockingEnabled() bool
- func IsIPAllowed(ip string) bool
- func IsIPBlocked(ip string) (bool, string)
- func IsIPBypassed(ip string) bool
- func IsUserAgentBlocked(userAgent string) (bool, string)
- func IsUserBlocked(userID string) bool
- func IsZenDisabled() bool
- func IsZenLoaded() bool
- func SetBlocking(blocking bool)
- func SetUserBlocked(userID string)
- func SetZenDisabled(disabled bool)
- func SetZenLoaded(loaded bool)
- func ShouldBlockHostname(hostname string) bool
- func ShouldProtect() bool
- func Uninit()
- func UpdateServiceConfig(cloudConfig *aikido_types.CloudConfigData, ...)
- type Endpoint
- type EndpointKey
- type RateLimiting
- type ServiceConfigData
Constants ¶
View Source
const ( GuardEndpointEU = "https://guard.aikido.dev/" GuardEndpointUS = "https://guard.us.aikido.dev/" GuardEndpointME = "https://guard.me.aikido.dev/" RuntimeEndpoint = "https://runtime.aikido.dev/" )
View Source
const (
Version = "0.0.0"
)
Variables ¶
View Source
var CollectAPISchema bool
Functions ¶
func GetCloudConfigUpdatedAt ¶
func Init ¶
func Init(environmentConfig *aikido_types.EnvironmentConfigData, aikidoConfig *aikido_types.AikidoConfigData) error
Init initializes the configuration system, extracting region from token to determine default endpoint URL if not set. Returns an error if setting the log level fails.
func IsBlockingEnabled ¶
func IsBlockingEnabled() bool
func IsIPAllowed ¶
IsIPAllowed checks that the IP is allowed if the global allowed IP list is set. Private/local IP addresses are always allowed, even when an allow list is configured.
func IsIPBlocked ¶
IsIPBlocked function checks the cloud config mutex for blocked IP addresses.
func IsIPBypassed ¶
func IsUserAgentBlocked ¶
IsUserAgentBlocked returns true if we block (e.g. bot blocking), and a string with the reason why.
func IsUserBlocked ¶
func IsZenDisabled ¶
func IsZenDisabled() bool
func IsZenLoaded ¶
func IsZenLoaded() bool
func SetBlocking ¶
func SetBlocking(blocking bool)
func SetUserBlocked ¶
func SetUserBlocked(userID string)
func SetZenDisabled ¶
func SetZenDisabled(disabled bool)
func SetZenLoaded ¶
func SetZenLoaded(loaded bool)
func ShouldBlockHostname ¶
func ShouldProtect ¶
func ShouldProtect() bool
ShouldProtect returns true if protection should run. Protection runs when zen is not disabled AND has been loaded successfully.
func UpdateServiceConfig ¶
func UpdateServiceConfig(cloudConfig *aikido_types.CloudConfigData, blockListConfig *aikido_types.ListsConfigData)
Types ¶
type Endpoint ¶
type Endpoint struct {
Method string `json:"method"`
Route string `json:"route"`
ForceProtectionOff bool `json:"forceProtectionOff"`
Graphql any `json:"graphql"`
AllowedIPAddresses ipaddr.MatchList `json:"allowedIPAddresses"`
RateLimiting aikido_types.RateLimiting `json:"rateLimiting"`
}
func GetEndpoints ¶
func GetEndpoints() []Endpoint
type EndpointKey ¶
type RateLimiting ¶
type ServiceConfigData ¶
type ServiceConfigData struct {
ConfigUpdatedAt time.Time
Endpoints []Endpoint
BlockedUserIDs map[string]bool
BypassedIPs ipaddr.MatchList
AllowedIPs map[string]ipaddr.MatchList
BlockedIPs map[string]ipaddr.MatchList
BlockedUserAgents *regexp.Regexp
Block bool
BlockNewOutgoingRequests bool
Domains []aikido_types.OutboundDomain
}
Click to show internal directories.
Click to hide internal directories.