# Build your Own Connector

Communication with the supported external applications is performed through connectors that you can now build in the Connector designer page in ASM, rather than wait for others to build and install them on your server.The Connector Builder page only supports building custom CMDB connectors for the time being.

{% hint style="info" %}
Available in HERMES (ASM Version 10.6.5) and higher.

**Configuring a connector in ASM requires some knowledge of API's.  If you are not comfortable with this level of detail but wish to begin building your own connector, please reach out to your Technical Account Manager, or Alemba Support.**
{% endhint %}

## What problems does building a connector via the Connector Designer solve?

You can create a custom connector from scratch, build it exactly how you want it and get the information exactly how you need it!&#x20;

You can now build a custom connector in ASM that will allow you to communicate with external applications to discover resources on those applications. Once detected, those resources can be imported into ASM as Federated CMDB records or lined to the existing CMDB records.

To create a custom connector, you must describe the API you want to connect to so that the connector you’re building understands the API’s operations and data structures.&#x20;

In the Connector Builder page, you can determine the types of resources to be imported from the supported categories: Bulletin, CMDB Item, Contract, Cost Center, Knowledge, Location, Organization, Person and Subscriber Group.

## What types of data are supported?

Depending on the 3rd party system and the type of data it provides, you can choose and specify which type of value a variable has.

<figure><img src="https://content.gitbook.com/content/hlW9jKl7dcDggHAPhNU9/blobs/S3VeSA6ZTVsn22C94mSf/Screen%20Shot%202023-01-09%20at%206.06.54%20PM.png" alt=""><figcaption></figcaption></figure>

## What happens after you build the connector in the configuration process?

Once your connector has been built and tested, you can put your custom connector to work. You will need to configure the connector for ASM to successfully connect to the 3rd party source with the specified parameters.

1. Define a source to configure instances of external sources with which ASM can connect in order to import or update objects and exchange information. For integration with the Federated CMDB, a source is the system to which ASM can connect to import objects discovered by a network discovery tool into ASM or import users from a directory server.
2. Configure the resources that you defined in the Connector Builder. This enables you to view the resource type configured on a selected source and create mappings for each of these resource types. This will allow you to create mappings between the external resource and ASM CMDB item fields.
3. You can view and create schedules for running scans on sources for the purpose of importing external resources.
4. You can view the resource link types configured on a selected source and create mappings for each of these link types.
5. You can set up appropriate security rights for Analysts to manage external resources.

## Build Your Own Connector, How-To

Building your connector is a multi-step process and it will be helpful to gather some information before-hand:

* [x] Application ID&#x20;
* [x] Client Secret value (not the client secret ID)
* [x] Determine the necessary security Roles for the type of connector you are building.  For example, Intune requires DeviceManagementManaged, Devices.Read.All, and offline\_access while Azure AD needs User.Read.All and Directory.Read.All
* [x] Required URLs
* [x] The Fields you wish to map (Create a Data Dictionary for future expansion or troubleshooting)

#### Getting Started

1. Access the Connector Builder: System Admin>Integration>Connector Builder
2. Click "Add Connector" to add a new connector
3. Enter the details&#x20;

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FtIopskBTiTKmfYlh3pHj%2FScreenshot%202025-02-25%20at%2011.55.09.png?alt=media&#x26;token=5eae9466-b2b6-479d-bdfa-fcc120c1d260" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2Fa4y1hsqklICuxbt491pZ%2FScreenshot%202025-02-25%20at%2011.56.02.png?alt=media&#x26;token=a44549ee-7f96-48e2-9d83-aee81da61cef" alt=""><figcaption></figcaption></figure>

4. Configure Resource Settings, click the "+" to add a Resource

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FLcvAKMdmVeyud9kVz7PJ%2Fset1.jpg?alt=media&#x26;token=3704802b-f4ad-4c39-8226-2d2a23c10620" alt=""><figcaption></figcaption></figure>

5. Click the "New Resource" Link to expand and enter the details

   <figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2F5BxTLzUqOHHe22zMsAg6%2FScreenshot%202025-02-25%20at%2012.03.07.png?alt=media&#x26;token=5b212442-b9ee-45d3-a1af-7e31441936f4" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2F4rkbdEnfFq9T0vF0sfnv%2FScreenshot%202025-02-25%20at%2012.04.18.png?alt=media&#x26;token=a9664cf0-218d-48cb-a2df-5d9ab8c9399f" alt=""><figcaption></figcaption></figure>
6. Complete the queries as follows:

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2Fdk8KaeV1IVaNssBH5FpA%2FScreenshot%202025-02-25%20at%2012.06.09.png?alt=media&#x26;token=64a78116-e8f0-4c7e-8ffc-1375d64394b7" alt=""><figcaption></figcaption></figure>

<details>

<summary>All</summary>

<img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FTqiUTbBqi5wR59S4GPgv%2FScreenshot%202025-02-25%20at%2012.07.50.png?alt=media&#x26;token=0d0419cc-4178-45b4-989b-85c88cc04ae9" alt="" data-size="original">

**Query:** All&#x20;

**URL:** \[The Url to your end point]

**Nested Objects:** value&#x20;

**Paged?** True&#x20;

**Starting Page No:** 0&#x20;

**Page Size:** Default is 100, increase as needed&#x20;

**Next Page Property: example \[**@odata.nextLin&#x6B;**]**

</details>

<details>

<summary>Search</summary>

<img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FAJO3MWL7yPpjQkBjqVnb%2FScreenshot%202025-02-25%20at%2012.08.36.png?alt=media&#x26;token=81511118-fd57-4a92-a5c7-56c8c1a19ac1" alt="" data-size="original">

**Query:** Search&#x20;

**URL:** \[The URL for the Search query to your endpoint]

**Nested Objects:** value&#x20;

**Paged?** True&#x20;

**Starting Page No:** 0&#x20;

**Page Size:** Default is 100, increase as needed&#x20;

**Next Page Property: example \[**@odata.nextLin&#x6B;**]**

</details>

<details>

<summary>Retrieve</summary>

<img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2Fitx0IU3yY4Q4etLKUlZS%2FScreenshot%202025-02-25%20at%2012.09.37.png?alt=media&#x26;token=a419174e-f75b-4198-a040-c8a58abbc0a7" alt="" data-size="original">

**Query:** Retrieve&#x20;

**URL:** \[The Url to your end point for the search results]

**Nested Objects Paged?** False&#x20;

**Page Size:** Default is 100, increase as needed&#x20;

**Next Page Property: example \[**@odata.nextLin&#x6B;**]**

</details>

7. Complete the Resource Details

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2F2Zd3xruUx3mxGpfmJWyV%2FScreenshot%202025-02-25%20at%2012.10.09.png?alt=media&#x26;token=78bd3076-ee68-4278-81b5-3f62ba68b63c" alt=""><figcaption></figcaption></figure>

#### Resource examples

You will gather the resource details and add these to your data dictionary for the connector.

<details>

<summary>Resource Unique Identifier Field, example</summary>

**Field ID:** id&#x20;

**Data Type:** String&#x20;

</details>

<details>

<summary>Resource Display Field, example</summary>

**Field ID:** DeviceName

**Data Type:** String&#x20;

</details>

<details>

<summary>Resource Last Modified Field, example</summary>

**Field ID:** lastsyncDateTime

**Data Type:** DateTime

</details>

8. Setup fields, Click the "New Fieldset" link. &#x20;

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FQpBugtgR5GY9ImnokhGj%2FScreenshot%202025-02-25%20at%2012.13.38.png?alt=media&#x26;token=9d1b3b62-ff43-44cd-a6ed-75122c1a3568" alt=""><figcaption><p>The Fieldset defines the data set you want to use for this connector.</p></figcaption></figure>

<details>

<summary>Fieldsets Details, example</summary>

**Fieldset id:** DeviceFields&#x20;

**Type:** Relative &#x20;

</details>

9. Add fields to the fieldset, Click the "+" to add a new Field

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FDhYeMiINre9jKPC0cn8u%2FScreenshot%202025-02-25%20at%2012.14.39.png?alt=media&#x26;token=96017d40-492e-4e80-95f2-f21bf384e774" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FdJ6QijZbxHBOwcCWwPne%2FScreenshot%202025-02-25%20at%2012.16.44.png?alt=media&#x26;token=b6411dac-5ff0-4e83-8d37-48183523d192" alt=""><figcaption></figcaption></figure>

10. Click the "+" to repeat and add a new row for all fields you need to add to this fieldset

{% hint style="info" %}
**Link Settings**

This section is not typically applicable to the configuration.  If you need more information about Link Settings, please contact Alemba Support for assistance.
{% endhint %}

11. Save your new Connector
12. Configure your Source
    1. Navigate to System Admin>Integration>Sources
    2. Click the Add icon to add a new source ![](https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FEwD9fFENFjVyi9jvkuPs%2Fimage.png?alt=media\&token=27c2d5ed-56bd-479d-9afe-c31db3f0ab59)
    3. Select the Connector you just defined, in this example we called it "Connector Builder Test", but yours will likely be some version of *Microsoft\_InTune*, *Asset Panda, Solar Winds,* etc...

<figure><img src="https://1375663122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhlW9jKl7dcDggHAPhNU9%2Fuploads%2FMlfly6MsLDphLovDmZIg%2FScreenshot%202025-02-25%20at%2012.30.23.png?alt=media&#x26;token=5a8bb3ae-8f5a-460c-bf45-9e7fa140038e" alt=""><figcaption></figcaption></figure>

13. Complete the Source Properties.

<details>

<summary>Source Properties, example</summary>

**URL:** <https://graph.microsoft.com&#x20>;

**Test URL:** v1.0/deviceManagement/managedDevices&#x20;

**Manage Token**: &#x20;

* Tokenname: Your Client Intune Token
* Grant Type: client\_credentials&#x20;
* Call back URL: <https://yourclienturl.alembacloud.com/production/oauth2callback.htm>&#x20;
* Authorization URL: [https://login.microsoftonline.com/{Azure ](https://login.microsoftonline.com/%7BAzure)Tenant ID}/oauth2/v2.0/authorize&#x20;
* Access Token URL: [https://login.microsoftonline.com/{Azure ](https://login.microsoftonline.com/%7BAzure)Tenant ID}/oauth2/v2.0/token&#x20;
* Client ID: Value from the Azure App Registration&#x20;
* Client Secret: The secret created for the App Registration&#x20;
* Scope: <https://graph.microsoft.com/.default>&#x20;
* State: Any secret value E.g. A complex password&#x20;

</details>

14. [Map Your Fields Under **Resources** ](https://docs.alemba.com/asm/integrate/managing-integration/selecting-fields-for-mapping)&#x20;

{% hint style="info" %}
Please note that there are several fields that bring back data as bytes including Total and Free Storage space in Microsoft Intune and other Asset Discovery tools. If you wish to convert these to GB then you would need to use the transform function in ASM, for example: Math.Round(Convert.toDecimal(PhysicalMemoryinBytes)/1073741824,2)
{% endhint %}

15. [Set up the integration's **scheduled scan**](https://docs.alemba.com/asm/integrate/managing-integration/managing-the-federated-cmdb/managing-scheduled-integration-scans)
