[Yandex Cloud documentation](../../index.md) > [Yandex Security Deck](../index.md) > [Concepts](index.md) > Custom rules

# Custom rules

Custom rules allow you to customize [CSPM](cspm.md) and [KSPM](kspm.md) standard security rules for the in-house requirements.

To work with custom rules, you need the `security-deck.rules.editor` [role](../security/index.md) or higher.

{% note info %}

To check rule compliance, [add](../operations/custom-rules-sets/update-set.md) the rule to a new or existing custom rule set. Then check the [workspace settings](../operations/workspaces/update.md) to make sure the rule set is active.

{% endnote %}

## Custom rules in CSPM {#cspm-rules}

Custom rules in CSPM are created based on a basic standard rule. A basic rule defines the verification logic you can supplement or modify.

The following settings are available:

* Editing a name and description.
* Changing severity.
* Supplementing or editing resolution guidelines.
* Editing configurable parameters specific to a basic rule.

## Custom rules in KSPM {#kspm-rules}

Custom rules in KSPM are created from scratch based on the internal security policies. As opposed to CSPM rules, they do not require a basic rule.

The following settings are available:

* Rule name and description.
* Check type: sets when to apply a rule. Currently, only the Admission option is supported: a rule applies when creating or changing a Kubernetes object.
* Rule severity.
* Guidelines on fixing violations.
* Policy rule YAML code.

By default, a new rule is created in the `Audit` mode. After creating a rule, you can [change the mode](../operations/kspm/manage-rule-modes.md).

#### Useful links {#see-also}

* [Creating a custom rule in CSPM](../operations/cspm/create-custom-rule.md)
* [Creating a custom rule in KSPM](../operations/kspm/create-custom-rule.md)
* [How to work with custom rule sets](../operations/custom-rules-sets/index.md)