# Apiiro

{% hint style="info" %}
Cortex connects to many third-party vendors whose system interfaces frequently change. As a result, integration behavior or configuration steps may shift without notice. If you encounter unexpected issues, check with your system administrator or refer to the vendor's documentation for the most current information. Additionally, integration sync times vary and are subject to scheduling overrides and timing variance.
{% endhint %}

[Apiiro](https://apiiro.com/) is an application security posture management (ASPM) platform that helps you understand and manage application security risks.

Integrating Apiiro with Cortex allows you to:

* [View risks on entity pages](#viewing-apiiro-risks-on-an-entity) in Cortex, quickly connecting issues to entities and their owners
* Use [Scorecards](#scorecards-and-cql) to drive quality improvements to your security practices relating to Apiiro applications, and set [Initiatives](/improve/initiatives.md) to prioritize tasks and set deadlines.

## How to configure Apiiro with Cortex

### Prerequisites

Before getting started:

* Create an [Apiiro API key](https://docs.apiiro.com/admin-apiiro/access-tokens). Include the following permissions:
  * `Risks > Read`
  * `Inventory management > Applications > Read`
  * `Inventory management > Repositories > Read`

### Configure the integration in Cortex

1. In Cortex, navigate to the [Apiiro settings page](https://app.getcortexapp.com/admin/integrations/apiiro).
   * Click **Integrations** from the main nav. Search for and select **Apiiro**.
2. Click **Add configuration**.
3. Configure the integration form:
   * **Alias**: Enter an alias for your configuration.
   * **API key**: Enter the API key you generated in Apiiro.
   * **Host**: Enter the base URL of your Apiiro instance. If left blank, the default host will be used.
4. Click **Save**.

After saving your configuration, you are redirected to the Apiiro integration settings page in Cortex. In the upper right corner of the page, click **Test configuration** to ensure Apiiro was configured properly.

To modify the integration configuration, see [Modifying an existing integration configuration](/ingesting-data-into-cortex/integrations.md#modifying-an-existing-integration-configuration).

## How to connect Cortex entities to Apiiro

### Discovery

Cortex uses the entity name, [Cortex tag](/ingesting-data-into-cortex/entities-overview/entities.md#cortex-tag), or repository as the "best guess" for the corresponding Apiiro application. For example, if your entity name is "My Service" or your tag is `my-service`, then the corresponding application name in Apiiro should also be My Service or `my-service`.

If your Apiiro application names don’t cleanly match the Cortex entity name or tag, you can override this in the Cortex entity descriptor.

### Editing the entity descriptor

You can define repositories and applications in the [entity descriptor](/ingesting-data-into-cortex/entities-overview/entities.md#defining-entities-via-yaml-file) under the `x-cortex-apiiro` block:

```yaml
x-cortex-apiiro:
  repositories:
    - alias: alias-one
      repositoryId: repository-one
    - alias: alias-two
      repositoryId: repository-two
  applications:
    - alias: alias-one
      applicationId: application-one
    - alias: alias-two
      applicationId: application-two
```

## Using the Apiiro integration

### Viewing Apiiro risks on an entity

#### Entity page overview

On an [entity details page](/ingesting-data-into-cortex/entities-overview/entities/details.md) overview, see risks listed under the **Code & security** block. Within this block, issues and vulnerabilities are grouped by severity: `Critical`, `High`, `Medium`, and `Low`. Click into any of these to open a list of all applicable issues and vulnerabilities.

#### Entity code & security sidebar

In an entity's sidebar, click **Code & security > Apiiro** to view risks from Apiiro.

### Scorecards and CQL

With the Apiiro integration, you can create Scorecard rules and write CQL queries based on Apiiro risks.

See more examples in the [CQL Explorer](https://app.getcortexapp.com/admin/cql-explorer) in Cortex.

<details>

<summary>List risks</summary>

List all risks for a given entity's Apiiro application.

**Definition**: `apiiro.risks()`

**Example**

A Scorecard's top level might include a rule to ensure that entities have a low number of Apiiro risks:

```
apiiro.risks().length < 3
```

</details>

<details>

<summary>Check if Apiiro application is set</summary>

Check if entity has a registered Apiiro application in its entity descriptor.

**Definition:** `apiiro ≠ null`

**Example**

An initial level in a security Scorecard might include a rule to make sure entities are associated with an Apiiro application. Without this, Cortex won't pick up data about applications in Apiiro:

```
apiiro != null
```

</details>

### View integration logs <a href="#still-need-help" id="still-need-help"></a>

{% hint style="info" %}
This feature is available in Cortex cloud.
{% endhint %}

While viewing an integration's settings page, click the **Logs** tab to view error logs from the last 7 days. You can filter the logs list by configuration and by operation (for example, you could filter to view errors surfaced only via Scorecards).

<div align="left" data-with-frame="true"><figure><img src="/files/x8JmoPqXZTJ7YHeFJpOA" alt="The &#x27;Logs&#x27; tab on an integration&#x27;s settings page shows error information over the past 7 days."><figcaption></figcaption></figure></div>

Click into a row to get more information, including time stamp, status code, full error, and request path.

## Still need help?[​](https://docs.cortex.io/docs/reference/integrations/aws#still-need-help) <a href="#still-need-help" id="still-need-help"></a>

The following options are available to get assistance from the Cortex Customer Engineering team:

* **Email**: <help@cortex.io>, or open a support ticket in the in app Resource Center
* **Slack**: Users with a connected Slack channel will have a workflow added to their account. From here, you can either @CortexTechnicalSupport or add a `:ticket:` reaction to a question in Slack, and the team will respond directly.

Don’t have a Slack channel? Talk with your Customer Success Manager.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortex.io/ingesting-data-into-cortex/integrations/apiiro.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
