← 返回
效率工具 中文

TOTP

TOTP-based OTP verification for sensitive operations (env vars, gateway restarts, backup deletions, critical config changes). Uses otplib with window:2 (1 mi...
基于TOTP的OTP验证,用于敏感操作(环境变量、网关重启、备份删除、关键配置更改)。使用 otplib,窗口设置为 2(1 ...
diegofcornejo
效率工具 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 849
下载
💾 4
安装
1
版本
#latest

概述

TOTP Verification Skill

Secure OTP verification using TOTP (Time-based One-Time Password) for sensitive operations.

Purpose

Protect access to:

  • .env variables
  • openclaw.json configuration
  • Gateway restarts
  • Backup deletions
  • Critical configuration changes
  • External API key operations

Setup

  1. Install dependencies:

```bash

npm install

```

  1. Generate secret and QR:

```bash

npm run generate

```

Optionally pass service and account name:

```bash

node scripts/generate-secret.js MyService myuser

```

  1. Send the QR image (qr.png) to the user, then delete it immediately:

```bash

rm qr.png

```

  1. Set TOTP_SECRET in .env:

```env

TOTP_SECRET=YOUR_BASE32_SECRET_HERE

```

  1. Configure Google Authenticator/Authy with the generated secret or QR.

Usage

When a sensitive operation is requested:

  1. Agent: "Please provide your OTP"
  2. User: Provides 6-digit code from authenticator app
  3. Agent: Runs verification:

```bash

TOTP_SECRET=$TOTP_SECRET node scripts/verify.js 123456

```

  1. If valid (exit 0): Proceed with operation
  2. If invalid (exit 1): Deny access

Files

  • scripts/generate-secret.js - Generate new TOTP secret and QR
  • scripts/verify.js - Verify OTP tokens (window:2 = 1 minute tolerance)
  • SKILL.md - This documentation

Security Notes

  • Window: 2 (1 minute tolerance) for time drift
  • Algorithm: SHA1
  • Digits: 6
  • Period: 30 seconds
  • Secret: Base32 encoded, stored in .env as TOTP_SECRET

Integration

This skill should be integrated into the agent's decision flow when:

  1. User requests .env variables
  2. User requests openclaw.json contents
  3. User requests gateway restart
  4. User requests backup deletion
  5. Any operation marked as "critical"

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 17:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,192
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,395
productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 430 📥 103,732