Configuration Using CRDs - v1beta2
Beta Feature Notice This new CRD version v1beta2 is currently in beta and may undergo changes based on user feedback and testing. Please note that some functionality may be subject to updates or improvements in future releases.
We encourage you to explore this feature and share your feedback to help us enhance it. If you encounter any issues or have suggestions, please contact us at info@openappsec.io .
In order to configure open-appsec declaratively using the improved v1beta2 CRD version as explained on this page, you must deploy open-appsec using the new HELM-based installation flow described here:
Install Using Helm - new flow (beta)Using open-appsec K8S Custom Resources
open-appsec configuration is done using Kubernetes Custom Resource Definitions (CRDs). Custom Resources are extensions of the Kubernetes API that allow powerful yet standard way of managing configuration in a declarative way as well as using infrastructure-as-code paradigm. This support allows you to manage configuration changes as part of your GitOps CD processes.
open-appsec CRD version v1beta2 provides nine CRD types. The main one is policy - which defines default behaviors for the inspected traffic but also allows you to define different behaviours for specific resources by configuring "specific rules". The policy resource refers to all other CRDs.
In order to activate the policy there's two options:
If your deployed proxy solution provides Ingress Controller functionality and you are using ingress resources in your environment: Add an annotation with the desired open-appsec policy you want to activate for the ingress resource which you want to protect (make sure to also have the correct
ingressClassNameset in your ingress resource specification).
openappsec.io/policy: open-appsec-best-practice-policyIf your deployed proxy solution does not provide any ingress controller functionality, then you can alternatively use the
policyActivationCRD to activate your desired security policy for specific hosts directly (does not require any ingress resource or annotation). You find the specification further below.
Custom Resources Specifications
You can download all the custom resource examples shown below in a single file here:
wget https://raw.githubusercontent.com/openappsec/openappsec/main/config/k8s/v1beta2/open-appsec-k8s-full-example-config-v1beta2.yamlYou can download custom resources shown below in a single file here:
wget https://raw.githubusercontent.com/openappsec/openappsec/main/config/crds/open-appsec-crd-v1beta2.yamlAvailability of namespace-scoped CRDs
For every CRD listed and explained below, there's also a separate namespace-scoped version available. These are mainly relevant for larger scale deployments. Find more details about usage of namespace-scoped custom resources here: Using namespace-scoped custom resources Examples:
To define cluster-scoped custom resources for defining an open-appsec policy, use kind:
Policy
To define namespace-scoped custom resources for defining an open-appsec policy, use kind:
PolicyNS
To define cluster-scoped custom resources for defining a threat prevention practice, use kind:
ThreatPreventionPractice
To define namespace-scoped custom resources for defining a threat prevention practice, use kind:ThreatPreventionPracticeNS
The same naming pattern applies to all other custom resource definition types which open-appsec supports for declarative configuration.
Policy
Policy resources define default behaviors that will apply to all inspected traffic and optional policies that you wish to apply just to specific rules.
They must be activated in order to become effective, see "Using open-appsec K8s Custom Resources" above. You can activate them either by adding an annotation in the ingress resources you want to protect which links the policy to that ingress, or by specifying the hosts for which your policy should be activcated in the policyActivation CRD.
Policy Activation
The PolicyActivation Custom Resource Definition (CRD) defines a Kubernetes resource that manages the activation of security policies within the openappsec.io ecosystem. This CRD enables the association of security policies with specific hosts.
This serves as an alterantive to adding the annotation to the ingress (see above) which references the desired policy.
Threat Prevention Practice
Access Control Practice
Custom Response
Log Trigger
Exceptions
Source Identifiers
Trusted Sources
Last updated