> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/c/checkmarx-sast-self-hosted.md).

# Checkmarx Sast Self Hosted

Checkmarx Sast Self Hosted is the on-premises Checkmarx static analysis platform. OctoXLabs reads its users and the projects with a finished scan and adds them to the user and source code inventories.

## Use cases

* **Find Checkmarx users with no directory account.** List Checkmarx SAST users that are not found in Active Directory. How accounts are matched depends on your user merge settings.

```
Adapters = checkmarx-sast-sh AND NOT Adapters = active-directory
```

* **Review scanned projects by language.** The primary language comes from the latest finished scan. Review it in the Source codes inventory.

## Before you begin

### Network

| Source              | Destination                     | Port                            | Protocol                     |
| ------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
| OctoXLabs connector | Checkmarx server (IP parameter) | 443 by default (Port parameter) | HTTPS (HTTP when SSL is off) |

The port can be a custom, non-default port, depending on your installation. The connector uses the path `/cxrestapi`. If a proxy is set, requests go through it as `http://<value>`.

### Required permissions

| Scope or role          | Permission                                             | Needed for                        |
| ---------------------- | ------------------------------------------------------ | --------------------------------- |
| Checkmarx user account | Access to the SAST REST API and the access control API | Reading projects, scans and users |

The connector requests the scopes `sast_rest_api` and `access_control_api`. The sources do not name a specific Checkmarx role.

## Create credentials in Checkmarx Sast Self Hosted

{% stepper %}
{% step %}

### Choose a user

Use a Checkmarx user name and password that can log in to the Checkmarx platform.
{% endstep %}

{% step %}

### Check the access

Make sure the user can read projects, scans and users through the REST API. The user is used for the password grant at `/cxrestapi/auth/identity/connect/token`.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter           | Required | Type    | Default | Description                                                                                                                 |
| ------------------- | -------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| IP (or Server Name) | Yes      | String  | None    | IP address or domain name of the server that hosts the Checkmarx services. All requests, including authentication, go here. |
| Port                | No       | Integer | 443     | Port on which the Checkmarx server accepts API requests.                                                                    |
| Username            | Yes      | String  | None    | Checkmarx user name.                                                                                                        |
| Password            | Yes      | String  | None    | Checkmarx password.                                                                                                         |
| SSL                 | No       | Boolean | True    | Use HTTPS.                                                                                                                  |
| Timeout             | No       | Integer | 30      | Seconds to wait for an API response.                                                                                        |
| Proxy               | No       | String  | None    | Proxy address.                                                                                                              |

## Troubleshooting

| Error message                                                  | Cause                                  | Fix                                                      |
| -------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------- |
| Please check your credentials.                                 | The token request answered 401.        | Check the username and password.                         |
| Status Code: `, followed by URL, Method and the response body` | The API answered with an error status. | Check the host, port, SSL setting and the user's access. |

## Change history
