> 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/cfengine.md).

# CFEngine

CFEngine is an IT automation framework that keeps systems in their desired state. OctoXLabs reads the hosts reported to your CFEngine hub and adds them to the device inventory.

## Use cases

* **Find managed hosts missing from endpoint protection.** List hosts that CFEngine manages but an endpoint tool does not report. Replace `falcon-crowdstrike` with your own endpoint adapter slug.

```
Adapters = cfengine AND NOT Adapters = falcon-crowdstrike
```

* **Find hosts that stopped reporting.** List CFEngine hosts not seen for 30 days.

```
Adapters = cfengine AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination                         | Port                          | Protocol                           |
| ------------------- | ----------------------------------- | ----------------------------- | ---------------------------------- |
| OctoXLabs connector | hub.cfengine.com (Domain parameter) | Not specified (default HTTPS) | HTTPS (HTTP when Is Secure is off) |

The connector builds the URL from the domain only, so the default port of the scheme is used.

### Required permissions

| Scope or role                      | Permission | Needed for    |
| ---------------------------------- | ---------- | ------------- |
| User account that can fetch assets | Read       | Listing hosts |

Some CFEngine resources require that the request user is a member of the admin role. Roles are managed with `/api/role`. Role Based Access Control (RBAC) is configurable in the settings.

## Create credentials in CFEngine

{% stepper %}
{% step %}

### Choose a user

Use a CFEngine user account that has permission to fetch assets.
{% endstep %}

{% step %}

### Check the role

If the host list is not accessible, check the user's roles. Some resources require the admin role.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required | Type    | Default          | Description                                        |
| --------- | -------- | ------- | ---------------- | -------------------------------------------------- |
| Domain    | No       | String  | hub.cfengine.com | CFEngine hub host, without a scheme.               |
| Username  | Yes      | String  | None             | User with permission to fetch assets.              |
| Password  | Yes      | String  | None             | Password of the user. Stored as a sensitive value. |
| Is Secure | No       | Boolean | True             | Use HTTPS. Advanced option.                        |

## Troubleshooting

| Error message                                                  | Cause                                  | Fix                                                    |
| -------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------ |
| Status Code: `, followed by URL, Method and the response body` | The API answered with an error status. | Check the credentials, the user's role and the domain. |

## Change history

{% hint style="info" %}
Available starting from version 6.0.0.
{% endhint %}
