Creating a custom rule
To work with custom rules, you need the security-deck.rules.editor role or higher in the workspace.
-
Go to Yandex Security Deck
. -
In the left-hand panel, select
Rules and exceptions. -
At the top of the window, select the workspace.
-
Navigate to the Kubernetes® tab and click Create rule.
-
Under Main parameters:
-
Enter the rule name and description.
-
Select the Check type, which determines the type of rules that apply to the Kubernetes cluster. Currently only Admission is supported: the rule applies when you create or change a Kubernetes object.
By default, a new rule is created in the
Auditmode. After you create a rule, you can change the mode. -
Select the rule criticality.
-
In the Recommendations field, describe the set of actions required to fix the violation.
-
-
Under Policy rules, insert the YAML code of the rule. For Admission type rules, only Kyverno ClusterPolicy
is supported. Copy only the rule list itself starting with the- namefield (without the thespecorrulesfields).Click Check to check that the code you entered is correct. The check will also start automatically if you save the rule.
-
Click Save.
The new rule will appear in the Custom tab. When the rule triggers, the system sends an alert. To view alerts, select