Documentation ¶
Index ¶
- Variables
- func LoadModSecurityConfiguration(logger *logrus.Logger, cfg *ModSecurity) (coraza.WAF, error)
- func ValidateStatusList(fl validator.FieldLevel) bool
- type APIFWMode
- type APIMode
- type AllowIP
- type AllowIPlist
- type Backend
- type CustomFormatter
- type Denylist
- type GraphQL
- type GraphQLMode
- type HTTPStatusCodeList
- type Introspection
- type JWT
- type ModSecurity
- type Oauth
- type ProxyMode
- type Server
- type ShadowAPI
- type TLS
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllHttpStatuses = []int{ http.StatusContinue, http.StatusSwitchingProtocols, http.StatusProcessing, http.StatusEarlyHints, http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNonAuthoritativeInfo, http.StatusNoContent, http.StatusResetContent, http.StatusPartialContent, http.StatusMultiStatus, http.StatusAlreadyReported, http.StatusIMUsed, http.StatusMultipleChoices, http.StatusMovedPermanently, http.StatusFound, http.StatusSeeOther, http.StatusNotModified, http.StatusUseProxy, http.StatusTemporaryRedirect, http.StatusPermanentRedirect, http.StatusBadRequest, http.StatusUnauthorized, http.StatusPaymentRequired, http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed, http.StatusNotAcceptable, http.StatusProxyAuthRequired, http.StatusRequestTimeout, http.StatusConflict, http.StatusGone, http.StatusLengthRequired, http.StatusPreconditionFailed, http.StatusRequestEntityTooLarge, http.StatusRequestURITooLong, http.StatusUnsupportedMediaType, http.StatusRequestedRangeNotSatisfiable, http.StatusExpectationFailed, http.StatusTeapot, http.StatusMisdirectedRequest, http.StatusUnprocessableEntity, http.StatusLocked, http.StatusFailedDependency, http.StatusTooEarly, http.StatusUpgradeRequired, http.StatusPreconditionRequired, http.StatusTooManyRequests, http.StatusRequestHeaderFieldsTooLarge, http.StatusUnavailableForLegalReasons, http.StatusInternalServerError, http.StatusNotImplemented, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout, http.StatusHTTPVersionNotSupported, http.StatusVariantAlsoNegotiates, http.StatusInsufficientStorage, http.StatusLoopDetected, http.StatusNotExtended, http.StatusNetworkAuthenticationRequired, } )
Functions ¶
func LoadModSecurityConfiguration ¶ added in v0.7.0
func LoadModSecurityConfiguration(logger *logrus.Logger, cfg *ModSecurity) (coraza.WAF, error)
func ValidateStatusList ¶
func ValidateStatusList(fl validator.FieldLevel) bool
Types ¶
type APIFWMode ¶ added in v0.6.12
type APIFWMode struct {
Mode string `conf:"default:PROXY" validate:"oneof=PROXY API GRAPHQL"`
}
type APIMode ¶ added in v0.6.13
type APIMode struct { conf.Version APIFWMode ModSecurity AllowIP AllowIP TLS TLS SpecificationUpdatePeriod time.Duration `conf:"default:1m,env:API_MODE_SPECIFICATION_UPDATE_PERIOD"` PathToSpecDB string `conf:"env:API_MODE_DEBUG_PATH_DB"` DBVersion int `conf:"default:0,env:API_MODE_DB_VERSION"` UnknownParametersDetection bool `conf:"default:true,env:API_MODE_UNKNOWN_PARAMETERS_DETECTION"` APIHost string `conf:"default:http://0.0.0.0:8282,env:URL" validate:"required,url"` HealthAPIHost string `conf:"default:0.0.0.0:9667,env:HEALTH_HOST" validate:"required"` ReadTimeout time.Duration `conf:"default:5s"` WriteTimeout time.Duration `conf:"default:5s"` LogLevel string `conf:"default:INFO" validate:"oneof=TRACE DEBUG INFO ERROR WARNING"` LogFormat string `conf:"default:TEXT" validate:"oneof=TEXT JSON"` PassOptionsRequests bool `conf:"default:false,env:PASS_OPTIONS"` }
type AllowIPlist ¶ added in v0.6.16
type AllowIPlist struct {
AllowedIP AllowIP
}
type Backend ¶ added in v0.6.13
type Backend struct { URL string `conf:"default:http://localhost:3000/v1/" validate:"required,url"` ClientPoolCapacity int `conf:"default:1000" validate:"gt=0"` InsecureConnection bool `conf:"default:false"` RootCA string `conf:""` MaxConnsPerHost int `conf:"default:512"` ReadTimeout time.Duration `conf:"default:5s"` WriteTimeout time.Duration `conf:"default:5s"` DialTimeout time.Duration `conf:"default:200ms"` DeleteAcceptEncoding bool `conf:"default:false"` }
type CustomFormatter ¶ added in v0.6.16
type CustomFormatter struct {
logrus.TextFormatter
}
type GraphQL ¶ added in v0.6.13
type GraphQL struct { MaxQueryComplexity int `conf:"required" validate:"required"` MaxQueryDepth int `conf:"required" validate:"required"` MaxAliasesNum int `conf:"required" validate:"required"` NodeCountLimit int `conf:"required" validate:"required"` BatchQueryLimit int `conf:"required" validate:"required"` DisableFieldDuplication bool `conf:"default:false"` Playground bool `conf:"default:false"` PlaygroundPath string `conf:"default:/" validate:"path"` Introspection bool `conf:"required" validate:"required"` Schema string `conf:"required" validate:"required"` WSCheckOrigin bool `conf:"default:false"` WSOrigin []string `conf:"" validate:"url"` RequestValidation string `conf:"required" validate:"required,oneof=DISABLE BLOCK LOG_ONLY"` }
type GraphQLMode ¶ added in v0.6.13
type GraphQLMode struct { conf.Version APIFWMode Graphql GraphQL TLS TLS Server Backend Denylist Denylist AllowIP AllowIP APIHost string `conf:"default:http://0.0.0.0:8282,env:URL" validate:"required,url"` HealthAPIHost string `conf:"default:0.0.0.0:9667,env:HEALTH_HOST" validate:"required"` ReadTimeout time.Duration `conf:"default:5s"` WriteTimeout time.Duration `conf:"default:5s"` LogLevel string `conf:"default:INFO" validate:"oneof=TRACE DEBUG INFO ERROR WARNING"` LogFormat string `conf:"default:TEXT" validate:"oneof=TEXT JSON"` }
type HTTPStatusCodeList ¶
type HTTPStatusCodeList struct {
StatusCodes []int
}
type Introspection ¶
type ModSecurity ¶ added in v0.7.0
type Oauth ¶
type Oauth struct { ValidationType string `conf:"default:JWT"` JWT JWT Introspection Introspection }
type ProxyMode ¶ added in v0.6.13
type ProxyMode struct { conf.Version APIFWMode ModSecurity TLS TLS ShadowAPI ShadowAPI Denylist Denylist Server Server AllowIP AllowIP APIHost string `conf:"default:http://0.0.0.0:8282,env:URL" validate:"required,url"` HealthAPIHost string `conf:"default:0.0.0.0:9667,env:HEALTH_HOST" validate:"required"` ReadTimeout time.Duration `conf:"default:5s"` WriteTimeout time.Duration `conf:"default:5s"` LogLevel string `conf:"default:INFO" validate:"oneof=TRACE DEBUG INFO ERROR WARNING"` LogFormat string `conf:"default:TEXT" validate:"oneof=TEXT JSON"` RequestValidation string `conf:"required" validate:"required,oneof=DISABLE BLOCK LOG_ONLY"` ResponseValidation string `conf:"required" validate:"required,oneof=DISABLE BLOCK LOG_ONLY"` CustomBlockStatusCode int `conf:"default:403" validate:"HttpStatusCodes"` AddValidationStatusHeader bool `conf:"default:false"` APISpecs string `conf:"required,env:API_SPECS" validate:"required"` PassOptionsRequests bool `conf:"default:false,env:PASS_OPTIONS"` }
Click to show internal directories.
Click to hide internal directories.