TMAegis

插件

安装、配置与编写插件。

插件在扫描后运行,并通过标准输入接收 JSON 报告。可用它们发送通知、创建工单或推送到 SIEM。

安装与启用

shell
tmaegis plugin install github.com/tmaegis/plugin-slack-notify   # file, URL or GitHub release
tmaegis plugin install ./my-plugin.wasm --sha256 <digest>       # pin the digest
tmaegis plugin list
tmaegis scan --auto-detect --plugin slack,jira

插件会在插件目录中查找(默认 ./plugins,可用 --plugin-dir 更改)。在 config.yaml 的 plugins.enabled 下可永久启用它们。

编写自己的插件

可执行插件是名为 tmaegis-plugin-<name> 的文件(任何语言均可)。它从 stdin 读取 JSON 扫描报告,并从环境变量读取其设置。

shell
#!/usr/bin/env sh
# TMAegis notifier plugin: posts a scan summary somewhere.
set -eu
PAYLOAD=$(cat)
FAILED=$(printf '%s' "$PAYLOAD" | grep -o '"failed_count":[0-9]*' | head -n1 | cut -d: -f2)
echo "failed controls: ${FAILED:-0}"

WebAssembly 插件在沙箱(wazero)中运行,除非获得授权,否则无法访问主机。

可用插件

  • jira官方类型: executable

    TMAegis ITSM plugin: opens one Jira issue per failed critical/high control.

    plugins/tmaegis-plugin-jira.py

  • notify-webhook官方类型: executable

    Sample TMAegis Executable Plugin

    plugins/tmaegis-plugin-notify-webhook.sh

  • slack官方类型: executable

    TMAegis notifier plugin: posts a scan summary to a Slack incoming webhook.

    plugins/tmaegis-plugin-slack.sh

  • telegram官方类型: executable

    TMAegis notifier plugin: sends a scan summary to a Telegram chat.

    plugins/tmaegis-plugin-telegram.sh

  • pci-dss-v4社区类型: wasm

    Maps findings to PCI DSS v4.0 requirements. Community plugin: contributions welcome.

    github.com/tmaegis/plugin-pci-dss

在 GitHub 上编辑此页