---
title: Creating a Policy
slug: getting-started-guide-legacy-ui/creating-a-policy
description: Learn how to apply policies to different connection types like SSH/Telnet, SQL, and HTTP with this comprehensive document. Understand the two types of policies, White Key and Black Key, and how they allow or restrict user commands. Discover how to create 
docTags: 
createdAt: 2022-08-04T08:13:19.000Z
---

Policies are applied to SSH/Telnet, SQL, and HTTP connections. RDP and SFTP connections don’t need policies. Policies might be White Key and/or Black Key. White Key permits users to use the white key commands, and Black Key restricts users to use black key commands.&#x20;

:::hint{type="info"}
Policies are created based on Regex Classes:

- “**.\***” means all commands.
- If “**.\***” is used after a command, it means all commands starting with that command.
:::

To create a White Key Policy:

1. Navigate t&#x6F;**&#x20;Policy Control** > **Session Policy**.
2. Fill mandatory fields: **Key**, **Element Type**(s).
3. Select the **Type** as **White Key**.
4. Click **Save**.

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/7fViy0jWRYlGnh0SKcz2j_image.png "Defining a White Key to permits all commands")

To create a Black Key Policy:

1. Navigate to **Policy Control** > **Session Policy**.
2. Fill mandatory fields: **Key**, **Element Type**(s).
3. Select the **Type** as **Black Key**.
4. Click **Save**.

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/gXkAnI69KkhTtT-6ugraj_image.png "Defining a Black Key to restrict all commands starting with sudo")

