# Semgrep

> Read Semgrep AppSec Platform projects, scans, policies and defensive findings.

App · 10 actions. Web page: https://docs.lodol.com/docs/integrations/semgrep

## Actions

### Get project

Read details for a scanned project.

**Inputs**

- Deployment slug (`deployment_slug`, text, required): Slug of the deployment name. Can be found at `/deployments`, or in your Settings in the web UI.
- Project name (`project_name`, text, required): Name of the project, typically the repository formatted as a path.

**Outputs**

- `data` (object): Successfully retrieved details for the project.

**Example output**

```json
{
  "data": {
    "project": {
      "created_at": "example",
      "default_branch": "example",
      "id": 1.0,
      "latest_scan_at": "example",
      "managed_scan_config": {
        "diff_scan": {
          "enabled": false
        },
        "full_scan": {
          "enabled": false
        }
      },
      "name": "example",
      "primary_branch": "example",
      "tags": "example",
      "url": "example"
    }
  }
}
```

### Get scan

Read the results metadata for a scan.

**Inputs**

- Deployment (`deployment_id`, text, required): Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.
- Scan id (`scan_id`, text, required): Scan ID (numeric). Example: `456`. Can be found at `/deployments/{deploymentId}/scans/search`.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "completed_at": "example",
    "deployment_id": 1,
    "enabled_products": [],
    "exit_code": 1,
    "has_logs": false,
    "id": 1,
    "meta": {
      "branch": "example",
      "ci_job_url": "example",
      "commit": "example",
      "commit_author_email": "example",
      "commit_author_image_url": "example",
      "commit_author_name": "example",
      "commit_author_username": "example",
      "commit_title": "example",
      "config": "example",
      "pull_request_author_image_url": "example",
      "pull_request_author_username": "example",
      "pull_request_id": "example",
      "pull_request_title": "example",
      "repo_url": "example",
      "repository": "example",
      "true": "example"
    },
    "repository_id": 1,
    "started_at": "example",
    "stats": {}
  }
}
```

### List dependencies

Read detected dependencies for software inventory and remediation.

**Inputs**

- Deployment (`deployment_id`, text, required): Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "cursor": "example",
    "dependencies": [],
    "hasMore": false
  }
}
```

### List dependency repositories

Read repositories with dependency inventory.

**Inputs**

- Deployment (`deployment_id`, text, required): Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "cursor": 1.0,
    "hasMore": false,
    "repositorySummaries": []
  }
}
```

### List deployments

Read the connected Semgrep organizations.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "deployments": []
  }
}
```

### List findings

Read existing security findings for defensive triage.

**Inputs**

- Deployment slug (`deployment_slug`, text, required): Slug of the deployment name. Can be found at `/deployments`, or in your Settings in the web UI.
- Issue type (`issue_type`, text): Type of findings to return. If not specified, returns `sast` (Code) findings. Can be `sast` (Code), `sca` (Supply Chain), or `ai_sast` (AI-powered detection). Valid values: sast, sca, ai_sast. One of: `sast`, `sca`, `ai_sast` (Ai sast).
- Since (`since`, date and time): What timestamp should the results start at? If not specified, returns results from all timestamps. Provide epoch timestamp in seconds. Filters using the `relevant_since` field: the timestamp when this finding was detected by Semgrep (the first time, or when reintroduced).
- Page (`page`, number): Which page of the results do you require? If not specified, returns first page. Pages are numbered from zero (0). For pages beyond the first 50,000 results, request pages sequentially.
- Page size (`page_size`, number): Maximum number of records per returned page. If not specified, defaults to 100 records. Minimum: 100, Maximum: 3000. From 100.0 to 3000.0.
- Repos (`repos`, list): Which repositories (by name) do you want to include? If not specified, includes all.
- Status (`status`, text): Which status do you want to include? If not specified, includes all statuses. Findings in the `removed` state are always excluded from this endpoint. Valid values: open, fixed, ignored, reviewing, fixing, provisionally_ignored. One of: `open`, `fixed`, `ignored`, `reviewing`, `fixing`, `provisionally_ignored` (Provisionally ignored).
- Severities (`severities`, list): What severities of issues do you want to include? If not specified, returns all. Valid values: low, medium, high, critical. One or more of: `low`, `medium`, `high`, `critical`.
- Ref (`ref`, text): Which ref (branch) do you want to filter for?

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "findings": []
  }
}
```

### List policies

Read an organization’s security policies.

**Inputs**

- Deployment (`deployment_id`, text, required): Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "policies": []
  }
}
```

### List policy rules

Read the rules associated with a security policy.

**Inputs**

- Deployment (`deployment_id`, text, required): Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.
- Policy id (`policy_id`, text, required): Policy ID (numeric). Example: `456`. Can be found at `/deployments/{deploymentId}/policies`.
- Cursor (`cursor`, text): Cursor to paginate through the rules. Provide a cursor value from the response to retrieve the next page.
- Limit (`limit`, number): Page size to paginate through the rules. The default page size is `500` and the maximum allowed page size is `2000`.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "cursor": "example",
    "policy": {
      "id": "example",
      "isDefault": false,
      "name": "example",
      "productType": "PRODUCT_TYPE_SAST",
      "slug": "example"
    },
    "rules": []
  }
}
```

### List projects

Read one page of scanned projects in an organization.

**Inputs**

- Deployment slug (`deployment_slug`, text, required): Slug of the deployment name. Can be found at `/deployments`, or in your Settings in the web UI.
- Page (`page`, number): Which page of the results do you require? If not specified, returns first page. Pages are numbered from zero (0).
- Page size (`page_size`, number): Maximum number of records per returned page. If not specified, defaults to 100 records.

**Outputs**

- `data` (object): Return the list of projects in an organization.

**Example output**

```json
{
  "data": {
    "projects": []
  }
}
```

### List scans

Read scan history and results metadata.

**Inputs**

- Deployment (`deployment_id`, text, required): Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.

**Outputs**

- `data` (object): The response from Semgrep.

**Example output**

```json
{
  "data": {
    "cursor": "example",
    "scans": []
  }
}
```
