# Active Directory

## Active Directory Guide

In this article, we illustrate how to properly set up the **Active Directory** functionality of the admin portal. Whether you utilise **on-premises** Active Directory or you are dependent in one from the **cloud** (**Azure AD**), by enabling this option, the **CYBERAWARE SECURITY** platform will retrieve and synchronise your groups and recipients accordingly.

&#x20;

**Prerequisites (Only for Azure AD Domain Services):**

Before you can integrate an Active Directory using **Azure AD Domain Services,** please make sure to visit and establish either of the following:

* [Create and configure an Azure Active Directory Domain Services managed domain](https://learn.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-create-instance)
* [Configure secure LDAP for an Azure Active Directory Domain Services managed domain](https://learn.microsoft.com/en-us/azure/active-directory-domain-services/tutorial-configure-ldaps)

&#x20;&#x20;

**1.** As a reference point, let's have a look at our [Groups](https://docs.cyberawaresecurity.com/admin-portal/groups) and [Recipients](https://docs.cyberawaresecurity.com/admin-portal/recipients). Before synchronisation, they are both empty:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FTnHEeWusFvwHr9Z1xhzZ%2FActive_Directory_Guide_1.jpg?alt=media&#x26;token=6874acc0-2f31-48bd-98b5-8131e8aab9c6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FOsxJueZmouaEPGbzaLHn%2FActive_Directory_Guide_2.jpg?alt=media&#x26;token=850784d0-8ecb-4c20-8f70-52cb4d060ae1" alt=""><figcaption></figcaption></figure>

**2.** Navigate to **Active Directory:**

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FGMOXL2aquBz1AkcrSfpn%2FActive_Directory_Guide_3.jpg?alt=media&#x26;token=782ded49-53c0-40f2-9c1a-520bbd752401" alt=""><figcaption></figcaption></figure>

**3.** Go ahead and select the **Enable AD Synchronisation** option:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FZovXogDqBTDNj91El1M3%2FActive_Directory_Guide_4.jpg?alt=media&#x26;token=19f2f730-370f-46e3-a671-e26294387a33" alt=""><figcaption></figcaption></figure>

You should get the following output:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2F4pr11awFuaI8wq9EVeY5%2FActive_Directory_Guide_5.jpg?alt=media&#x26;token=def1db2c-7fd5-4067-9f0d-616c124d4967" alt=""><figcaption></figcaption></figure>

**4.** Click on the **AD Sync installer.msi** in order to **download** it. You'll later need to install it.

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FTT9wcQ6k21OSM0zmMIWu%2FActive_Directory_Guide_6.jpg?alt=media&#x26;token=ff1ca856-5c8d-40d9-b7c5-1a78edbac194" alt=""><figcaption></figcaption></figure>

After the installation, this service tool will be used to synchronise both ends, our **platform's client** with your **AD server.**

&#x20;

**5.** When enabling the **Active Directory Synchronisation,** you will be deprived of the opportunity  for **manual creation** of **groups** and **recipients.** To be able to once again have the ability to manually create groups and recipients, click on the indicated buttons shown below:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FqbrYNS7iWsbbz6cdV6lD%2FActive_Directory_Guide_7.jpg?alt=media&#x26;token=cb6e2b39-f35c-4bae-98fe-6d910121a392" alt=""><figcaption></figcaption></figure>

**6.** Before you **Confirm,** **copy,** and essentially **store temporarily** the provided **configuration key;** you'll be required to use it when setting up the **config** file for the sync service (we will discuss this further down the line).

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2F8byGSJH3ewW2tDRjWAeJ%2FActive_Directory_Guide_8.jpg?alt=media&#x26;token=36916456-4b98-454e-914c-54ea740c14e7" alt=""><figcaption></figcaption></figure>

**7.** On the confirmation prompt that pops up, select to **Confirm** or **Cancel** accordingly:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FA3hWgy6jLz2ne6fkDYT5%2FActive_Directory_Guide_9.jpg?alt=media&#x26;token=33cf7148-9c8a-410a-ba8a-e856bd2ae63b" alt=""><figcaption></figcaption></figure></div>

**8.** If you’ve confirmed the action, click **OK** to proceed:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FkgJV2smsFQfEEYOXtEWJ%2FActive_Directory_Guide_10.jpg?alt=media&#x26;token=7c563c31-dc96-4b47-866e-18e3b30c9fb3" alt=""><figcaption></figcaption></figure></div>

**9.** As we can see, the Active Directory Synchronisation has been enabled!

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2Fko5AZJiqHOXZsGOZNV3I%2FActive_Directory_Guide_11.jpg?alt=media&#x26;token=23bd8592-bee7-4d29-bbdd-b33f53802f70" alt=""><figcaption></figcaption></figure>

**10.** Now, let's go ahead and **open** up the installer you've downloaded earlier in order to **install** the sync service.

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FCg5eEC21d2eZuIxEVj6m%2FActive_Directory_Guide_12.jpg?alt=media&#x26;token=fc9c6129-d801-49c7-b370-ae3b60f4f532" alt=""><figcaption></figcaption></figure>

You will be prompted with the **Setup Wizard:**

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FQD4YBfiHDW1goqnkA0IA%2FActive_Directory_Guide_13.jpg?alt=media&#x26;token=23ce2eb8-95b3-4947-880d-b0ee7e62d3cd" alt=""><figcaption></figcaption></figure></div>

**11.** To continue, click on **Next:**

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FvHmh1atEQZVGfT2OfgZa%2FActive_Directory_Guide_14.jpg?alt=media&#x26;token=31a20cf8-973c-407e-bd00-dc8cbf1009e2" alt=""><figcaption></figcaption></figure></div>

You will be met with the **End-User License Agreement:**

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FRCfzMow0dRrd9rW5Z1Yy%2FActive_Directory_Guide_15.jpg?alt=media&#x26;token=0b08a863-1e30-42bd-9542-fe65f620f5f5" alt=""><figcaption></figcaption></figure></div>

**12. Accept** the terms and select **Next:**

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2F28nypAkkHx0bLCiHk4Wi%2FActive_Directory_Guide_16.jpg?alt=media&#x26;token=8582c729-b4f3-4feb-a98f-3c0b7a042a18" alt=""><figcaption></figcaption></figure></div>

**13. Choose** the destination for your folder and click on **Next** to proceed accordingly:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FfjmPeMFzNF3Um7dGWIqp%2FActive_Directory_Guide_17.jpg?alt=media&#x26;token=915dcad1-1130-43ae-abeb-eadaf21b85f0" alt=""><figcaption></figcaption></figure></div>

**14.** Click on **Install** to finally install the machine:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FabrcCtTBJ0Kta6h5oEJb%2FActive_Directory_Guide_18.jpg?alt=media&#x26;token=745255fd-d8be-43a0-985f-62378c77d3b5" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FLjzJfUgqvOCS6urNJUbY%2FActive_Directory_Guide_19.jpg?alt=media&#x26;token=06835cea-7eb2-4cb6-85a2-a1133a64bcb8" alt=""><figcaption></figcaption></figure></div>

**15. Untick** the box to **avoid launching** the **AD Sync Manager** as we are yet to set up the config file. Click **Finish** to close the window.

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FT20ureVHj754ZbBZHH7n%2FActive_Directory_Guide_20.jpg?alt=media&#x26;token=2a404651-9950-41fa-b487-677881c07a09" alt=""><figcaption></figcaption></figure></div>

**16.** Finally, navigate to the **directory/path** you've chosen during the installation steps and **open** up the **config** file:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2F80Mkyg7kIWSekxq3zhcg%2FActive_Directory_Guide_21.jpg?alt=media&#x26;token=446044ce-fd3e-4817-8734-4a3aa045b051" alt=""><figcaption></figcaption></figure>

In this instance, we are using **notepad** to open it. As always, you may use any **text editor** you might prefer.

&#x20;

**17.** When the file opens up, you will come across the following configuration:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FoERMuzqo0HtW8PowfoD9%2FActive_Directory_Guide_22.jpg?alt=media&#x26;token=3acc5f60-99b5-4494-99dd-686238a7ffc0" alt=""><figcaption></figcaption></figure>

**18.** It is a **must** to edit and **fill** the following fields:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2Fqhu97idy2mAa2UhpznQn%2FActive_Directory_Guide_23.jpg?alt=media&#x26;token=1728b9a7-b889-4380-8ff2-5b37b9b47d9b" alt=""><figcaption></figcaption></figure>

*Please refer to the table below for more:*

| Attributes                | Details                                                                                                                                                                                                                                                                                                                                                |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **workspace\_key**        | This is the **configuration key** we've previously stored when enabling the Active Directory Synchronisation.                                                                                                                                                                                                                                          |
| **\[ldap] - host**        | If the organisation is using a **local machine** to run the Active Directory role, you should add its **IP.** Otherwise, if your Active Directory runs on top of **Azure,** you should add the external IP address (**public**) or the **FQDN** of the Active Directory Services. Use **localhost** if the tool is installed on the Domain Controller. |
| **\[ldap] - port**        | Could be port **389** or **636** for a **local** setup. For **Azure AD,** you can only use port **636.**                                                                                                                                                                                                                                               |
| **\[ldap] - user**        | For an **on-premises** configuration, this is the **username** of the profile you are using to **administer** Active Directory. If you are rather managing **Azure Active Directory Services,** you should leave this attribute **blank.**                                                                                                             |
| **\[ldap] - pass**        | This is the **password** required to gain access to the admin role.                                                                                                                                                                                                                                                                                    |
| **\[ldap] - enable\_tls** | Assuming you are using port **636,** for **secure ldap** (**ldaps**), the value of this attribute should be set to **true,** otherwise you should leave it as its **default** (**false**).                                                                                                                                                             |
| **\[ldap] - #bind\_str**  | This attribute is a **comment** by **default.** It should only be **uncommented** if you are using **Azure.** It can take parameters such as the **user** managing the Azure AD, his/her **group,** and the **domain.**                                                                                                                                |
| **\[ldap.ad] - base\_dn** | Here, you should add the **domain** as a parameter. It should match the one you've added in the **bind\_str** attribute.                                                                                                                                                                                                                               |

**19.** It is **recommended** to **edit** the following fields as well, but they are **optional:**

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FauiBEHGJJulnt4eiZB5g%2FActive_Directory_Guide_34.jpg?alt=media&#x26;token=08cbdddc-0c43-4a99-a392-b79072c428e3" alt=""><figcaption></figcaption></figure>

You may essentially exclude groups which aren't needed, such as the group of **enterprise admins,** etc.

&#x20;

**20.** After **saving** the changes, go ahead and **load** the **manager** application that exists within the same folder:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FEWQYRfXC3DszXLnLf7gY%2FActive_Directory_Guide_24.jpg?alt=media&#x26;token=82a66f1e-694d-493f-bf46-ba4e6e5b5fff" alt=""><figcaption></figcaption></figure>

The following window should then pop up:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2F975tfhl2H0K57kOu1FaD%2FActive_Directory_Guide_25.jpg?alt=media&#x26;token=be062ada-4f4d-4d43-892a-ab5da9c7fa92" alt=""><figcaption></figcaption></figure></div>

**21.** Click on the **Start service** button to **start** the service:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FByE1BMjg8HOmwLOlTBtT%2FActive_Directory_Guide_26.jpg?alt=media&#x26;token=c78654d7-ed87-4870-9831-f1c771df3504" alt=""><figcaption></figcaption></figure></div>

**22.** The service is now **Running** as expected!

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2Fp5cC5KPd4Nc9A7rmk6OT%2FActive_Directory_Guide_27.jpg?alt=media&#x26;token=5a196e7b-5796-4f88-9491-ed6feb9faa97" alt=""><figcaption></figcaption></figure></div>

**23.** After some time, when the **synchronisation** is **complete,** we may distinguish that the **changes** have been **applied. Groups** and **Recipients** sections should now appear **updated:**

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FhCIUYtUdiJdJSdu4Wt9C%2FActive_Directory_Guide_28.jpg?alt=media&#x26;token=6b646957-145b-4f69-8e94-99ca8524900d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FgRvmAGNd38CRaHiNSezE%2FActive_Directory_Guide_29.jpg?alt=media&#x26;token=d3dc3218-2992-47ff-8f74-2eafbe309dee" alt=""><figcaption></figcaption></figure>

**24.** As always, you may **disable** the Active Directory Synchronisation feature from the button shown below:

<figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2Ft1iRDVaCBvn0Q1HxLkmk%2FActive_Directory_Guide_30.jpg?alt=media&#x26;token=7160a898-608c-4f91-8138-577031fca718" alt=""><figcaption></figcaption></figure>

**25.** On the prompt that will pop up, press on **Disable** or **Cancel** accordingly:

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FZWApePyV3YwJ1QN6RZE5%2FActive_Directory_Guide_31.jpg?alt=media&#x26;token=a4c42ca1-4009-451d-9bda-70311a57f14d" alt=""><figcaption></figcaption></figure></div>

**26.** At the **last confirmation,** click **OK** to finalise.

<div align="left"><figure><img src="https://787872742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbDWFUV8KfahpvaDhzuK%2Fuploads%2FvnKCT0nAEpcQIihwhciE%2FActive_Directory_Guide_32.jpg?alt=media&#x26;token=787cdd6c-1dea-44b2-a012-54b471d58c05" alt=""><figcaption></figcaption></figure></div>
