# Lacework FortiCNAPP

> Read, comment on and close cloud security alerts, route alerts with alert rules, tune policies, and search host and container vulnerabilities, machines and audit logs in Lacework FortiCNAPP.

App · 22 actions. Web page: https://docs.lodol.com/docs/integrations/lacework

## Actions

### Close alert

Close an alert, with the reason and an optional comment.

**Inputs**

- Alert (`alert_id`, text, required): The alert.
- Reason (`reason`, text, required): Why the alert is closed. One of: `other` (Other (explain in the comment)), `false_positive` (False positive), `not_enough_information` (Not enough information), `malicious_and_resolved` (Malicious, and a resolution is in place), `expected_routine_testing` (Expected because of routine testing), `expected_behavior` (Expected behavior).
- Comment (`comment`, text): More about why. Required when the reason is Other.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "alert_id": "example",
    "closed": true,
    "reason": "example"
  }
}
```

### Comment on alert

Add a comment to an alert's timeline.

**Inputs**

- Alert (`alert_id`, text, required): The alert.
- Comment (`comment`, text, required): The comment's text.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "alertId": 1,
        "createdTime": "example",
        "entryType": "example",
        "id": 1,
        "message": {},
        "user": {}
      }
    ]
  }
}
```

### Create alert rule

Route alerts of chosen severities, sources and categories to alert channels.

**Inputs**

- Name (`name`, text, required): The rule's name.
- Severities (`severities`, list, required): The severities the rule applies to. One or more of: `Critical`, `High`, `Medium`, `Low`, `Info`.
- Alert channels (`channels`, list, required): The alert channels to send to.
- Enabled (`enabled`, true/false): Whether the rule is on. Defaults to on.
- Description (`description`, text): What the rule is for.
- Sources (`sources`, list): Only alerts from these sources. Leave empty for every source. One or more of: `AWS`, `Azure`, `GCP` (Google Cloud), `Agent`, `K8s` (Kubernetes).
- Categories (`categories`, list): Only alerts in these categories. Leave empty for every category. One or more of: `Anomaly`, `Policy`, `Composite`, `Platform`.
- Subcategories (`sub_categories`, list): Only alerts in these subcategories. Leave empty for every subcategory. One or more of: `Compliance`, `Application`, `Cloud Activity`, `File`, `Machine`, `User`, `Platform`, `Kubernetes Activity`, `Registry`, `SystemCall` (System call), and 5 more.
- Resource groups (`resource_groups`, list): Only alerts about these resource groups. Leave empty for all.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": {
      "filters": {
        "category": [
          "example"
        ],
        "createdOrUpdatedBy": "example",
        "createdOrUpdatedTime": "example",
        "description": "example",
        "enabled": 1,
        "name": "example",
        "resourceGroups": [
          "example"
        ],
        "severity": [
          1
        ],
        "source": [
          "example"
        ],
        "subCategory": [
          "example"
        ]
      },
      "intgGuidList": [
        "example"
      ],
      "mcGuid": "example",
      "type": "example"
    }
  }
}
```

### Delete alert rule

Delete an alert rule.

**Inputs**

- Alert rule (`rule_id`, text, required): The alert rule.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "deleted": true,
    "id": "example"
  }
}
```

### Get alert

Get an alert's details, or its investigation, events, related alerts, integrations or timeline.

**Inputs**

- Alert (`alert_id`, text, required): The alert.
- Scope (`scope`, text): What to get. Defaults to the details. One of: `Details`, `Investigation`, `Events`, `RelatedAlerts` (Related alerts), `Integrations`, `Timeline`, `ObservationTimeline` (Observation timeline).

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": {}
  }
}
```

### Get alert rule

Get an alert rule: which alerts it routes and where.

**Inputs**

- Alert rule (`rule_id`, text, required): The alert rule.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": {
      "filters": {
        "category": [
          "example"
        ],
        "createdOrUpdatedBy": "example",
        "createdOrUpdatedTime": "example",
        "description": "example",
        "enabled": 1,
        "name": "example",
        "resourceGroups": [
          "example"
        ],
        "severity": [
          1
        ],
        "source": [
          "example"
        ],
        "subCategory": [
          "example"
        ]
      },
      "intgGuidList": [
        "example"
      ],
      "mcGuid": "example",
      "type": "example"
    }
  }
}
```

### Get policy

Get a policy, its remediation advice and its query.

**Inputs**

- Policy (`policy_id`, text, required): The policy, such as lacework-global-1.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": {
      "alertEnabled": true,
      "description": "example",
      "enabled": true,
      "lastUpdateTime": "example",
      "lastUpdateUser": "example",
      "owner": "example",
      "policyId": "example",
      "policyType": "example",
      "queryId": "example",
      "remediation": "example",
      "severity": "example",
      "tags": [
        "example"
      ],
      "title": "example"
    }
  }
}
```

### Get user profile

Get the API key's user and the accounts and sub-accounts it can reach.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "accounts": [
          {
            "accountName": "example",
            "admin": true,
            "custGuid": "example",
            "userEnabled": 1,
            "userGuid": "example"
          }
        ],
        "orgAccount": true,
        "orgAdmin": true,
        "orgUser": true,
        "url": "example",
        "username": "example"
      }
    ],
    "has_more": true
  }
}
```

### List alert channels

List the places alerts are sent: email, Slack, Jira, webhooks and the rest.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "createdOrUpdatedBy": "example",
        "createdOrUpdatedTime": "example",
        "enabled": 1,
        "intgGuid": "example",
        "name": "example",
        "state": {},
        "type": "example"
      }
    ],
    "has_more": true
  }
}
```

### List alert rules

List the rules that route alerts to alert channels.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "filters": {
          "category": [
            "example"
          ],
          "createdOrUpdatedBy": "example",
          "createdOrUpdatedTime": "example",
          "description": "example",
          "enabled": 1,
          "name": "example",
          "resourceGroups": [
            "example"
          ],
          "severity": [
            1
          ],
          "source": [
            "example"
          ],
          "subCategory": [
            "example"
          ]
        },
        "intgGuidList": [
          "example"
        ],
        "mcGuid": "example",
        "type": "example"
      }
    ],
    "has_more": true
  }
}
```

### List alerts

List the alerts raised in a time range: by default the last 24 hours, at most 7 days.

**Inputs**

- From (`start_time`, date and time): The start of the time range. Defaults to 24 hours ago; the range can be at most 7 days.
- To (`end_time`, date and time): The end of the time range. Defaults to now.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "alertId": 1,
        "alertInfo": {
          "description": "example",
          "subject": "example"
        },
        "alertName": "example",
        "alertType": "example",
        "derivedFields": {
          "category": "example",
          "source": "example",
          "subCategory": "example"
        },
        "endTime": "example",
        "internetExposure": "example",
        "lastUserUpdatedTime": "example",
        "reachability": "example",
        "severity": "example",
        "startTime": "example",
        "status": "example"
      }
    ],
    "has_more": true
  }
}
```

### List audit logs

List who did what in FortiCNAPP in a time range: sign-ins, setting changes and the rest.

**Inputs**

- From (`start_time`, date and time): The start of the time range. Defaults to 24 hours ago; the range can be at most 7 days.
- To (`end_time`, date and time): The end of the time range. Defaults to now.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "accountName": "example",
        "createdTime": "example",
        "eventDescription": "example",
        "eventName": "example",
        "userAction": "example",
        "userName": "example"
      }
    ],
    "has_more": true
  }
}
```

### List cloud accounts

List the AWS, Azure, Google Cloud and OCI accounts connected to FortiCNAPP.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "cloudId": "example",
        "cloudIdType": "example",
        "createdOrUpdatedBy": "example",
        "createdOrUpdatedTime": "example",
        "enabled": 1,
        "intgGuid": "example",
        "name": "example",
        "state": {},
        "type": "example"
      }
    ],
    "has_more": true
  }
}
```

### List policies

List the policies FortiCNAPP checks, with their severity and whether they raise alerts.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "alertEnabled": true,
        "description": "example",
        "enabled": true,
        "lastUpdateTime": "example",
        "lastUpdateUser": "example",
        "owner": "example",
        "policyId": "example",
        "policyType": "example",
        "queryId": "example",
        "remediation": "example",
        "severity": "example",
        "tags": [
          "example"
        ],
        "title": "example"
      }
    ],
    "has_more": true
  }
}
```

### List resource groups

List the resource groups that alert rules can be limited to.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "description": "example",
        "enabled": 1,
        "name": "example",
        "resourceGroupId": "example",
        "resourceGuid": "example",
        "resourceType": "example"
      }
    ],
    "has_more": true
  }
}
```

### List team members

List the people who can sign in to the FortiCNAPP account.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "orgAdmin": true,
        "orgUser": true,
        "props": {
          "accountAdmin": true,
          "company": "example",
          "firstName": "example",
          "lastName": "example"
        },
        "userEnabled": 1,
        "userGuid": "example",
        "userName": "example"
      }
    ],
    "has_more": true
  }
}
```

### Search alerts

Find alerts in a time range by severity, status, source, category or type.

**Inputs**

- From (`start_time`, date and time): The start of the time range. Defaults to 24 hours ago; the range can be at most 7 days.
- To (`end_time`, date and time): The end of the time range. Defaults to now.
- Severity (`severity`, text): Only this severity. One of: `Critical`, `High`, `Medium`, `Low`, `Info`.
- Status (`status`, text): Only alerts with this status. One of: `Open`, `In Progress`, `Closed`.
- Source (`source`, text): Only alerts from this source. One of: `AWS`, `Azure`, `GCP` (Google Cloud), `Agent`, `K8s` (Kubernetes).
- Category (`category`, text): Only alerts in this category. One of: `Anomaly`, `Policy`, `Composite`, `Platform`.
- Alert type (`alert_type`, text): Only alerts of this type, such as SuspiciousUserFailedLogin.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "alertId": 1,
        "alertInfo": {
          "description": "example",
          "subject": "example"
        },
        "alertName": "example",
        "alertType": "example",
        "derivedFields": {
          "category": "example",
          "source": "example",
          "subCategory": "example"
        },
        "endTime": "example",
        "internetExposure": "example",
        "lastUserUpdatedTime": "example",
        "reachability": "example",
        "severity": "example",
        "startTime": "example",
        "status": "example"
      }
    ],
    "has_more": true
  }
}
```

### Search container vulnerabilities

Find vulnerabilities found in container images in a time range, by CVE, severity or image.

**Inputs**

- From (`start_time`, date and time): The start of the time range. Defaults to 24 hours ago; the range can be at most 7 days.
- To (`end_time`, date and time): The end of the time range. Defaults to now.
- CVE (`vuln_id`, text): Only this CVE, such as CVE-2018-7169.
- Severity (`severity`, text): Only this severity. One of: `Critical`, `High`, `Medium`, `Low`, `Info`.
- Image ID (`image_id`, text): Only the image with this ID.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "endTime": "example",
        "evalCtx": {},
        "evalGuid": "example",
        "featureKey": {},
        "fixInfo": {},
        "imageId": "example",
        "packageStatus": "example",
        "riskScore": 1,
        "severity": "example",
        "startTime": "example",
        "status": "example",
        "vulnId": "example"
      }
    ],
    "has_more": true
  }
}
```

### Search host vulnerabilities

Find vulnerabilities found on hosts in a time range, by CVE, severity or machine.

**Inputs**

- From (`start_time`, date and time): The start of the time range. Defaults to 24 hours ago; the range can be at most 7 days.
- To (`end_time`, date and time): The end of the time range. Defaults to now.
- CVE (`vuln_id`, text): Only this CVE, such as CVE-2018-7169.
- Severity (`severity`, text): Only this severity. One of: `Critical`, `High`, `Medium`, `Low`, `Info`.
- Machine ID (`machine_id`, text): Only the machine with this ID (its mid).

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "endTime": "example",
        "evalCtx": {},
        "evalGuid": "example",
        "featureKey": {},
        "fixInfo": {},
        "machineTags": {},
        "mid": "example",
        "packageStatus": "example",
        "riskScore": 1,
        "severity": "example",
        "startTime": "example",
        "status": "example",
        "vulnId": "example"
      }
    ],
    "has_more": true
  }
}
```

### Search machines

List the machines seen in a time range, optionally by host name or machine ID.

**Inputs**

- From (`start_time`, date and time): The start of the time range. Defaults to 24 hours ago; the range can be at most 7 days.
- To (`end_time`, date and time): The end of the time range. Defaults to now.
- Host name (`hostname`, text): Only the machine with this host name.
- Machine ID (`machine_id`, text): Only the machine with this ID (its mid).

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "endTime": "example",
        "entityType": "example",
        "hostname": "example",
        "machineTags": {},
        "mid": 1,
        "primaryIpAddr": "example",
        "startTime": "example"
      }
    ],
    "has_more": true
  }
}
```

### Update alert rule

Change an alert rule; only the fields filled in change.

**Inputs**

- Alert rule (`rule_id`, text, required): The alert rule.
- Name (`name`, text): The rule's new name.
- Severities (`severities`, list): The severities the rule applies to. One or more of: `Critical`, `High`, `Medium`, `Low`, `Info`.
- Alert channels (`channels`, list): The alert channels to send to.
- Enabled (`enabled`, true/false): Whether the rule is on.
- Description (`description`, text): What the rule is for.
- Sources (`sources`, list): Only alerts from these sources. Leave empty for every source. One or more of: `AWS`, `Azure`, `GCP` (Google Cloud), `Agent`, `K8s` (Kubernetes).
- Categories (`categories`, list): Only alerts in these categories. Leave empty for every category. One or more of: `Anomaly`, `Policy`, `Composite`, `Platform`.
- Subcategories (`sub_categories`, list): Only alerts in these subcategories. Leave empty for every subcategory. One or more of: `Compliance`, `Application`, `Cloud Activity`, `File`, `Machine`, `User`, `Platform`, `Kubernetes Activity`, `Registry`, `SystemCall` (System call), and 5 more.
- Resource groups (`resource_groups`, list): Only alerts about these resource groups. Leave empty for all.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": {
      "filters": {
        "category": [
          "example"
        ],
        "createdOrUpdatedBy": "example",
        "createdOrUpdatedTime": "example",
        "description": "example",
        "enabled": 1,
        "name": "example",
        "resourceGroups": [
          "example"
        ],
        "severity": [
          1
        ],
        "source": [
          "example"
        ],
        "subCategory": [
          "example"
        ]
      },
      "intgGuidList": [
        "example"
      ],
      "mcGuid": "example",
      "type": "example"
    }
  }
}
```

### Update policy

Turn a policy or its alerts on or off, or change its severity.

**Inputs**

- Policy (`policy_id`, text, required): The policy, such as lacework-global-1.
- Enabled (`enabled`, true/false): Whether the policy is checked.
- Alerts on (`alert_enabled`, true/false): Whether the policy raises alerts.
- Severity (`severity`, text): The policy's severity. One of: `critical`, `high`, `medium`, `low`, `info`.

**Outputs**

- `data` (object): The response from Lacework FortiCNAPP.

**Example output**

```json
{
  "data": {
    "data": {
      "alertEnabled": true,
      "description": "example",
      "enabled": true,
      "lastUpdateTime": "example",
      "lastUpdateUser": "example",
      "owner": "example",
      "policyId": "example",
      "policyType": "example",
      "queryId": "example",
      "remediation": "example",
      "severity": "example",
      "tags": [
        "example"
      ],
      "title": "example"
    }
  }
}
```
