> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oasm.io/llms.txt
> Use this file to discover all available pages before exploring further.

# manifest.yaml

> 声明一个连接器：必填和可选字段、输入和配置 schema，以及目录的生成方式

`manifest.yaml` 与连接器代码放在一起手工编写，并在汇总目录时进行校验。未知字段会被拒绝，因此拼写错误会导致构建失败，而不是悄无声息地不起作用。

```yaml theme={null}
name: Nuclei
slug: nuclei
version: 3.4.1
image: ghcr.io/oasm-platform/connector-nuclei:3.4.1
author: 'oasm'
pricingTier: [free]
homepage: 'https://projectdiscovery.io'
repositoryUrl: 'https://github.com/oasm-platform/oasm-connectors'
supportUrl: 'https://github.com/oasm-platform/oasm-connectors/issues'
shortDescription: 'Fast template-based vulnerability scanner'
description: 'Runs template-based scans against a target URL to detect known vulnerabilities, misconfigurations, and exposed secrets.'
capabilities:
  - name: vulnerabilities
    targetTypes: [domain, ip, cidr]
    inputs: [host, web]
    produces: [vulnerability]
    inputsSchema:
      type: object
      required: [target]
      properties:
        target:
          type: string
          format: uri
          title: Scan target
          description: 'Target URL or hostname to scan.'
          examples: [https://example.com]
          ui:placeholder: 'https://example.com'
      additionalProperties: false
configSchema:
  type: object
  additionalProperties: false
  properties:
    severity:
      type: array
      items:
        type: string
        enum: [info, low, medium, high, critical]
      title: Severity levels
      description: 'Only report findings at the selected severity levels.'
      default: [high, critical]
resourceDefaults:
  cpu: 500m
  memory: 4096Mi
  timeoutSeconds: 600
```

## 字段

| 字段 | 必填 | 说明 |
| - | - | - |
| `name` | 是 | 人类可读的显示名称。格式自由，可以包含空格和大写字母。 |
| `slug` | 是 | 全系统唯一的 ID，`^[a-z0-9-]+$`。决定镜像标签和容器命名。 |
| `version` | 是 | 所封装工具的版本。用作默认镜像标签。 |
| `image` | 是 | 构建所用的完整镜像引用。 |
| `author` | 是 | 维护者。 |
| `pricingTier` | 是 | 由 `free` / `paid` 组成的非空列表（大小写会被规范化）。 |
| `shortDescription` | 是 | 一行文字，在列表视图中显示。 |
| `description` | 是 | 详情视图中显示的完整段落。 |
| `capabilities` | 是 | 有序的模式列表，至少包含一个。参见[能力](#capabilities)。第一个能力还决定按分类进行的目录分组。 |
| `homepage` | 否 | 设置时必须为非空字符串。 |
| `repositoryUrl` | 否 | 设置时必须为非空字符串。 |
| `supportUrl` | 否 | 设置时必须为非空字符串。 |
| `configSchema` | 否 | 工具配置档案的 JSON Schema，所有能力共用。adapter 以 `OASM_CONFIG` 读取它。 |
| `resourceDefaults` | 否 | 调度器提示，例如 `cpu`、`memory`、`timeoutSeconds`。 |

## 能力

每个能力是连接器运行的一种模式。当工作流步骤未指定 `category` 时，第一个能力为默认能力。

| 键 | 必填 | 说明 |
| - | - | - |
| `name` | 是 | `subdomains`、`http_probe`、`ports_scanner`、`vulnerabilities`、`screenshot`、`url_discovery` 之一，对于仓库扫描器则为 `secrets`、`sca`、`sast`。不能重复；`secrets`、`sca` 和 `sast` 都以 `vulnerabilities` 运行，因此一个连接器最多声明其中一个。 |
| `targetTypes` | 是 | `domain`、`ip`、`cidr`、`git_org` 中的一个或多个。无论由哪个工作流运行，平台都不会向此模式发送其他目标类型的资产。 |
| `inputs` | 是 | 此模式接受的数据类型，按优先级排列：`target`、`host`、`service`、`web`、`url`、`repository`。 |
| `produces` | 是 | 其发现结果为后续工作流步骤新增的数据类型：`host`、`service`、`web`、`url`、`vulnerability`。若不为其他步骤提供数据，则为 `[]`。 |
| `inputsSchema` | 否 | 此模式每次运行输入的 JSON Schema。可使用 YAML 锚点在多个模式之间共享同一个 schema。 |

### 输入与输出

[工作流](https://docs.oasm.io/zh/workflows.md)将工具串联起来：端口扫描器发现服务，HTTP 探测从中找出 Web 服务，Web 扫描器再扫描这些服务。`inputs` 和 `produces` 告诉平台连接器在这条链中所处的位置。

`inputs` 是一个优先级列表。对于一次运行中的每个资产，平台选取第一个有可用数据的类型，并对每一项运行一次连接器。使用 `inputs: [web, host]` 时，一个在 443 和 8443 上有 Web 服务的主机会运行两次，分别针对 `https://host` 和 `https://host:8443`；尚未被探测过的主机则针对裸主机运行一次。工作流步骤可以用 `input:` 缩小列表或调整顺序，但不能新增类型。

连接器始终只接收一个 `target` 输入；只是其内容取决于数据类型：

| 类型 | `target` 的内容 |
| - | - |
| `target` | 创建目标时使用的域名或 IP |
| `host` | 主机名或 IP，例如 `app.example.com` |
| `service` | 开放端口的 `host:port` |
| `web` | Web 服务的基础 URL，保留端口，例如 `https://app.example.com:8443` |
| `url` | 带路径的已发现 URL |
| `repository` | 扁平的 `repository`、`ref` 和凭据输入，而不是 `target` |

根据 adapter 对 `target` 的处理方式选择 `inputs`：

* 将其裁剪为主机（gau、katana）：`[host]`，这样同一主机不会按端口被重复爬取；
* 扫描单个 Web 应用（nikto、zap、dirsearch）：`[web, host]`；
* 探测主机本身，同时也接受 URL（nuclei）：`[host, web]`；
* 需要真实存在的页面（arjun）：`[url, web]`。

列出 `web` 的连接器必须能在 `target` 中接受带端口的 URL。只有 `git_org` 能力可以接受 `repository`，而仅支持 `git_org` 的能力不能接受其他任何类型。

参见[数据类型](https://docs.oasm.io/zh/workflows.md#data-kinds)，了解平台如何决定每次运行接收的内容。

## 输入和配置 schema

`inputsSchema`（按能力定义）描述**每次运行**的输入，例如目标、范围。`configSchema` 描述**工具配置档案**，即跨运行持久保存的设置。两者都是普通的 JSON Schema，外加两个注解键：

* `title` 和 `description` 为控制台中的字段提供标签。
* `ui:placeholder` 提供输入提示。

只有 `type`、`required`、`properties`、`items`、`enum`、`default`、`examples` 和 `format` 参与校验；注解仅用于渲染。

参见[输入与配置](https://docs.oasm.io/zh/connectors/inputs-and-config.md)，了解这些值如何传递到 adapter。

## 图标

可选的同级文件 `logo.png` 如果较大，会被缩小到长边 128px，然后以 base64 嵌入到生成的 `manifest.json` 中。logo 从不出现在 YAML 中。

## 汇总规则

`manifest.json` 是一个**生成的产物**：请重新生成，切勿手工编辑。

```bash theme={null}
task manifest
```

* 整个仓库中出现重复的 slug 会直接报错。
* 未知、为空或重复的能力，未知的能力键，缺少 `targetTypes`、`inputs` 或 `produces` 的能力，未知的目标类型或数据类型，以及无效的 `pricingTier` 条目都会导致构建失败。
* `manifest.json` 中的条目按 `name` 排序；`generatedAt` 时间戳使每次重新生成都会产生 diff。
* 过大的 `logo.png` 会被原地重写，使仓库中的文件与嵌入的图标逐字节一致。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.