mcpField
C
clawsec-nanoclaw

clawsec-nanoclaw

github.com/prompt-securityセキュリティ1.1k186 回インストール今日更新
リポジトリ

clawsec-nanoclaw について

clawsec-nanoclawは、NanoClaw向けのセキュリティアドバイザリ監視スキルで、WhatsAppボットの運用者を対象とします。署名付きフィードで導入前後のスキルを検査し、悪用可能性の情報や整合性確認機能も提供します。

主な機能

  1. 01導入前のスキル安全性チェック
  2. 02アドバイザリに基づく導入済みスキルの監査
  3. 03重要度と悪用可能性によるアドバイザリ閲覧
  4. 04スキルパッケージの署名検証
  5. 05ファイル変更の確認と承認
  6. 06アドバイザリキャッシュ更新と監査ログ検証

活用シーン

  1. 01ボットへのスキル追加前の確認
  2. 02導入済みスキルの既知脆弱性監査
  3. 03重要度と悪用可能性を使ったアラート優先順位付け
  4. 04予期しないファイル変更の調査

MCP 対応

このスキルは、スキル安全性チェック、アドバイザリ監査、フィード閲覧、パッケージ検証、整合性操作などのClawSec MCPツールを使用します。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/prompt-security/clawsec --skill clawsec-nanoclaw

インストール後、Claude Code で/clawsec-nanoclawを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

CHANGELOG.md
INSTALL.md
README.md
skill.json
advisories/
feed-signing-public.pem
docs/
INTEGRITY.md
SKILL_SIGNING.md
guardian/
integrity-monitor.ts
policy.json
host-services/
advisory-cache.ts
integrity-handler.ts
ipc-handlers.ts
skill-signature-handler.ts
lib/
advisories.ts
local_file_io.ts
risk.ts
signatures.ts
types.ts
mcp-tools/
advisory-tools.ts
integrity-tools.ts
signature-verification.ts
test/
security-hardening.test.mjs

詳細

NanoClaw 向け ClawSec

スキルや依存関係に既知の脆弱性がないか監視し、WhatsApp ボットを保護します。

Vercel Skills のインストール

このハーネスには、Vercel Skills CLI を使用してインストールします。

npx skills add prompt-security/clawsec --skill clawsec-nanoclaw -a openclaw -y

概要

ClawSec は、インストール済みのスキルを厳選されたセキュリティアドバイザリーフィードと照合する MCP ツールを提供します。脆弱なスキルのインストールを防ぎ、トリアージに役立つ悪用可能性の情報を含め、既存スキルの問題を通知します。

基本原則: インストール前にチェックする。稼働中のものを監視する。

使用するタイミング

次の場合に ClawSec ツールを使用します。

  • 新しいスキルをインストールするとき(まず安全性をチェック)
  • ユーザーから「自分のスキルは安全ですか?」と尋ねられたとき
  • 不審な動作を調査するとき
  • 定期的なセキュリティ監査を行うとき
  • セキュリティ通知を受け取った後

次の用途には使用しないでください。

  • コードレビュー(他のツールを使用)
  • パフォーマンスの問題(別の懸念事項)
  • 一般的なデバッグ

使用可能な MCP ツール

インストール前のチェック
// Before installing any skill
const safety = await tools.clawsec_check_skill_safety({
  skillName: 'new-skill',
  skillVersion: '1.0.0'  // optional
});

if (!safety.safe) {
  // Show user the risks before proceeding
  console.warn(`Security issues: ${safety.advisories.map(a => a.id)}`);
}
セキュリティ監査
// Check all installed skills (defaults to ~/.claude/skills in the container)
const result = await tools.clawsec_check_advisories({
  installRoot: '/home/node/.claude/skills'  // optional
});

if (result.matches.some((m) =>
  m.advisory.severity === 'critical' || m.advisory.exploitability_score === 'high'
)) {
  // Alert user immediately
  console.error('Urgent advisories found!');
}
アドバイザリーの閲覧
// List advisories with filters
const advisories = await tools.clawsec_list_advisories({
  severity: 'high',               // optional
  exploitabilityScore: 'high'     // optional
});

クイックリファレンス

タスクツール主なパラメーター
インストール前のチェックclawsec_check_skill_safetyskillName
すべてのスキルを監査clawsec_check_advisoriesinstallRoot(任意)
フィードを閲覧clawsec_list_advisoriesseverity、type、exploitabilityScore(任意)
パッケージ署名を検証clawsec_verify_skill_packagepackagePath
アドバイザリーキャッシュを更新clawsec_refresh_cache(なし)
ファイルの整合性をチェックclawsec_check_integritymode、autoRestore(任意)
ファイル変更を承認clawsec_approve_changepath
ベースラインの状態を表示clawsec_integrity_statuspath(任意)
監査ログを検証clawsec_verify_audit(なし)

よくあるパターン

パターン 1:安全なスキルのインストール
// ALWAYS check before installing
const safety = await tools.clawsec_check_skill_safety({
  skillName: userRequestedSkill
});

if (safety.safe) {
  // Proceed with installation
  await installSkill(userRequestedSkill);
} else {
  // Show user the risks and get confirmation
  await showSecurityWarning(safety.advisories);
  if (await getUserConfirmation()) {
    await installSkill(userRequestedSkill);
  }
}
パターン 2:定期的なセキュリティチェック
// Add to scheduled tasks
schedule_task({
  prompt: "Check advisories using clawsec_check_advisories and alert when critical or high-exploitability matches appear",
  schedule_type: "cron",
  schedule_value: "0 9 * * *"  // Daily at 9am
});
パターン 3:ユーザーからのセキュリティに関する質問
User: "Are my skills secure?"

You: I'll check installed skills for known vulnerabilities.
[Use clawsec_check_advisories]

Response:
✅ No urgent issues found.
- 2 low-severity/low-exploitability advisories
- All skills up to date

よくある間違い

❌ チェックせずにインストールする
// DON'T
await installSkill('untrusted-skill');
// DO
const safety = await tools.clawsec_check_skill_safety({
  skillName: 'untrusted-skill'
});
if (safety.safe) await installSkill('untrusted-skill');
❌ 悪用可能性に関する情報を無視する
// DON'T: Use severity only
if (advisory.severity === 'high') {
  notifyNow(advisory);
}
// DO: Use exploitability + severity
if (
  advisory.exploitability_score === 'high' ||
  advisory.severity === 'critical'
) {
  notifyNow(advisory);
}
❌ 重大度「critical」を見落とす
// DON'T: Ignore high exploitability in medium severity advisories
if (advisory.severity === 'critical') alert();
// DO: Prioritize exploitability and severity together
if (advisory.exploitability_score === 'high' || advisory.severity === 'critical') {
  // Alert immediately
}

実装の詳細

フィードソース:https://clawsec.prompt.security/advisories/feed.json

この署名済みフィードは統合されています。NanoClaw は、同じデフォルト URL を通じて NVD CVE、承認済みのコミュニティアドバイザリー、および CVE のない暫定的な GHSA アドバイザリーを受け取ります。

更新頻度:6 時間ごと(自動)

署名の検証:Ed25519 署名済みフィード
パッケージ検証ポリシー:固定キーのみ、パッケージ/署名パスを制限

キャッシュの場所:/workspace/project/data/clawsec-advisory-cache.json

セットアップについては INSTALL.md を、高度な使い方については docs/ をご覧ください。

実環境での効果

  • 既知の RCE 脆弱性があるスキルのインストールを防止します
  • 依存関係に対するサプライチェーン攻撃を通知します
  • 実行可能な修正手順を提示します
  • 誤検知はゼロです(厳選されたフィードのみ)

リリース成果物の検証

スタンドアロンでインストールする場合は、SKILL.md、skill.json、またはアーカイブを信頼する前に、署名済みリリースマニフェストを検証してください。skill.json ファイルはパッケージのメタデータ/SBOM の情報源であり、リリースパイプラインは ClawSec リリースキーで checksums.json に署名します。

set -euo pipefail

SKILL_NAME="clawsec-nanoclaw"
VERSION="0.0.10"
REPO="prompt-security/clawsec"
TAG="${SKILL_NAME}-v${VERSION}"
BASE="https://github.com/${REPO}/releases/download/${TAG}"
ZIP_NAME="${SKILL_NAME}-v${VERSION}.zip"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT

RELEASE_PUBKEY_SHA256="711424e4535f84093fefb024cd1ca4ec87439e53907b305b79a631d5befba9c8"

curl -fsSL "$BASE/checksums.json" -o "$TMP_DIR/checksums.json"
curl -fsSL "$BASE/checksums.sig" -o "$TMP_DIR/checksums.sig"
curl -fsSL "$BASE/signing-public.pem" -o "$TMP_DIR/signing-public.pem"
curl -fsSL "$BASE/$ZIP_NAME" -o "$TMP_DIR/$ZIP_NAME"
curl -fsSL "$BASE/SKILL.md" -o "$TMP_DIR/SKILL.md"
curl -fsSL "$BASE/skill.json" -o "$TMP_DIR/skill.json"

ACTUAL_PUBKEY_SHA256="$(openssl pkey -pubin -in "$TMP_DIR/signing-public.pem" -outform DER | shasum -a 256 | awk '{print $1}')"
if [ "$ACTUAL_PUBKEY_SHA256" != "$RELEASE_PUBKEY_SHA256" ]; then
  echo "ERROR: signing-public.pem fingerprint mismatch" >&2
  exit 1
fi

openssl base64 -d -A -in "$TMP_DIR/checksums.sig" -out "$TMP_DIR/checksums.sig.bin"
openssl pkeyutl -verify -rawin -pubin \
  -inkey "$TMP_DIR/signing-public.pem" \
  -sigfile "$TMP_DIR/checksums.sig.bin" \
  -in "$TMP_DIR/checksums.json" >/dev/null

hash_file() {
  if command -v shasum >/dev/null 2>&1; then
    shasum -a 256 "$1" | awk '{print $1}'
  else
    sha256sum "$1" | awk '{print $1}'
  fi
}

verify_manifest_file() {
  asset="$1"
  path="$2"
  expected="$(jq -r --arg asset "$asset" '.files[$asset].sha256 // empty' "$TMP_DIR/checksums.json")"
  if [ -z "$expected" ]; then
    echo "ERROR: checksums.json missing $asset" >&2
    exit 1
  fi
  actual="$(hash_file "$path")"
  if [ "$actual" != "$expected" ]; then
    echo "ERROR: checksum mismatch for $asset" >&2
    exit 1
  fi
}

expected_archive="$(jq -r '.archive.sha256 // empty' "$TMP_DIR/checksums.json")"
if [ -z "$expected_archive" ]; then
  echo "ERROR: checksums.json missing archive.sha256" >&2
  exit 1
fi
actual_archive="$(hash_file "$TMP_DIR/$ZIP_NAME")"
if [ "$actual_archive" != "$expected_archive" ]; then
  echo "ERROR: archive checksum mismatch" >&2
  exit 1
fi

verify_manifest_file "SKILL.md" "$TMP_DIR/SKILL.md"
verify_manifest_file "skill.json" "$TMP_DIR/skill.json"

echo "Signed release manifest, archive, SKILL.md, and skill.json verified."

この検証が成功してから、アーカイブをインストールまたは展開してください。

コメント