ClawSentry
Script Functionality
The bundled script (bundle.cjs) performs the following operations:
- 1. Plugin Installation: Installs the
ai-assistant-security-openclaw plugin for OpenClaw. - Device Fingerprinting: Collects machine identifiers using the
node-machine-id library to generate a device fingerprint. - Login Token Creation: Communicates with the authorization API to create a login token.
- Login URL Generation: Generates a unique login URL based on the login token.
- Local Storage: Stores the login URL, token, and device fingerprint in
{baseDir}/.state/login_state.json. - Background Monitoring: Spawns a detached child process to monitor login status for up to 10 minutes.
- Configuration Update: Updates OpenClaw plugin configuration with encrypted API keys upon successful login.
Network Endpoints
The script communicates with the following API endpoints:
- - Login Token Creation: INLINECODE4
- Login Status Check: INLINECODE5
All communications are conducted over HTTPS.
Local File Operations
The script reads from and writes to the following files:
- - Reads: Machine identifiers via the
node-machine-id library - Writes:
-
{baseDir}/.state/login_state.json (stores login URL, token, and device fingerprint)
-
{baseDir}/.state/poll_login.log (logs monitoring activity)
- OpenClaw plugin configuration (updates with encrypted API keys)
Data Collection
The script collects the following data:
- - Device Fingerprint: Generated from machine identifiers for device-binding purposes
- Login Status: Monitored to determine when the user completes the login process
Install Mechanism
Installation Method
The skill uses a bundled CommonJS script (bundle.cjs) for installation. This script is executed directly to install and configure the ai-assistant-security-openclaw plugin.
Script Source
The bundled script is generated from the source code in the ClawSentry repository. It includes the following third-party libraries:
- - node-machine-id: Used to generate device fingerprints
- child_process: Used by node-machine-id to query system information
Risk Considerations
- - Bundled Code: The script includes bundled third-party libraries, which may execute system-level operations.
- System Queries: The script uses
node-machine-id library, which may use child_process to query system information. - Network Access: The script communicates with remote API endpoints for authentication.
- Arbitrary Code Execution: Running bundled scripts from unknown sources can execute arbitrary code on your system.
Security Measures
- - HTTPS Communication: All network requests are conducted over HTTPS to ensure data encryption.
- Encrypted Storage: Sensitive information (such as API keys) is encrypted before storage.
- Limited Scope: The script only modifies OpenClaw plugin configurations and creates temporary files in the
.state directory. - Transparent Operations: All script operations are documented in this file for transparency.
Verification Steps
Before executing the script, you should:
- 1. Review Full Script: Examine the complete script code to understand its functionality
- Verify Integrity: Check the script's file integrity using a hash if provided
- Monitor Execution: Run the script in a controlled environment and monitor its output
- Ensure Trust: Only run the script if you trust the source of this skill
- Check Permissions: Ensure the script has appropriate file permissions
Alternative Installation
If you prefer a more controlled installation, you can:
- - Manually install the
ai-assistant-security-openclaw plugin - Configure the plugin settings through the OpenClaw configuration system
- Follow the manual setup instructions provided in the plugin documentation
Use Cases
- - Use this skill when you need to install and prepare the
ai-assistant-security-openclaw plugins for the OpenClaw environment on the current machine. - Trigger this skill when the user mentions requirements such as "install clawSentry / ai-assistant-security-openclaw plugin / 帮我安装clawSentry技能 / 安装clawSentry技能".
Steps
1. Verify Node.js is installed:
Ensure Node.js (version 14 or higher) is installed on the system. You can check with:
CODEBLOCK0
2. Execute the combined script to install plugin and generate login link:
CODEBLOCK1
After the script completes:
- - The script will display the login URL directly. You can also extract it from the output by looking for the line that starts with INLINECODE16
- You can also read the login URL from
{baseDir}/.state/login_state.json file (look for the loginUrl field). If the file doesn't exist, try reading it again after a few seconds. If you can't find the files, try looking in .openclaw/skills/ClawSentry/scripts/ directory. - Send the login URL to the user along with this message: "After completing login, if you want to check if the installation was successful, please wait one minute and then ask me such as 'view all plugin list / 查看我的本地插件 '"
ClawSentry
脚本功能
捆绑脚本(bundle.cjs)执行以下操作:
- 1. 插件安装: 为 OpenClaw 安装 ai-assistant-security-openclaw 插件。
- 设备指纹: 使用 node-machine-id 库收集机器标识符以生成设备指纹。
- 登录令牌创建: 与授权 API 通信以创建登录令牌。
- 登录 URL 生成: 基于登录令牌生成唯一的登录 URL。
- 本地存储: 将登录 URL、令牌和设备指纹存储在 {baseDir}/.state/login_state.json 中。
- 后台监控: 生成一个分离的子进程,监控登录状态最多 10 分钟。
- 配置更新: 成功登录后,使用加密的 API 密钥更新 OpenClaw 插件配置。
网络端点
脚本与以下 API 端点通信:
- - 登录令牌创建: /OpenTOP/V1/Console/CreateLoginToken
- 登录状态检查: /OpenTOP/V1/Console/GetLoginTokenIdentity
所有通信均通过 HTTPS 进行。
本地文件操作
脚本读取和写入以下文件:
- - 读取: 通过 node-machine-id 库获取机器标识符
- 写入:
- {baseDir}/.state/login_state.json(存储登录 URL、令牌和设备指纹)
- {baseDir}/.state/poll_login.log(记录监控活动)
- OpenClaw 插件配置(使用加密的 API 密钥更新)
数据收集
脚本收集以下数据:
- - 设备指纹: 从机器标识符生成,用于设备绑定目的
- 登录状态: 监控以确定用户何时完成登录过程
安装机制
安装方法
该技能使用捆绑的 CommonJS 脚本(bundle.cjs)进行安装。此脚本直接执行以安装和配置 ai-assistant-security-openclaw 插件。
脚本来源
捆绑脚本从 ClawSentry 仓库的源代码生成。它包含以下第三方库:
- - node-machine-id: 用于生成设备指纹
- child_process: 由 node-machine-id 使用以查询系统信息
风险考虑
- - 捆绑代码: 脚本包含捆绑的第三方库,可能执行系统级操作。
- 系统查询: 脚本使用 node-machine-id 库,该库可能使用 child_process 查询系统信息。
- 网络访问: 脚本与远程 API 端点通信以进行身份验证。
- 任意代码执行: 从未知来源运行捆绑脚本可能在您的系统上执行任意代码。
安全措施
- - HTTPS 通信: 所有网络请求均通过 HTTPS 进行,以确保数据加密。
- 加密存储: 敏感信息(如 API 密钥)在存储前进行加密。
- 有限范围: 脚本仅修改 OpenClaw 插件配置并在 .state 目录中创建临时文件。
- 透明操作: 所有脚本操作均记录在此文件中,以确保透明度。
验证步骤
在执行脚本之前,您应该:
- 1. 审查完整脚本: 检查完整的脚本代码以了解其功能
- 验证完整性: 如果提供哈希值,请检查脚本的文件完整性
- 监控执行: 在受控环境中运行脚本并监控其输出
- 确保信任: 仅当您信任此技能来源时才运行脚本
- 检查权限: 确保脚本具有适当的文件权限
替代安装
如果您更喜欢更可控的安装,您可以:
- - 手动安装 ai-assistant-security-openclaw 插件
- 通过 OpenClaw 配置系统配置插件设置
- 按照插件文档中提供的手动设置说明进行操作
使用场景
- - 当您需要在当前机器上为 OpenClaw 环境安装和准备 ai-assistant-security-openclaw 插件时,使用此技能。
- 当用户提及诸如install clawSentry / ai-assistant-security-openclaw plugin / 帮我安装clawSentry技能 / 安装clawSentry技能等要求时,触发此技能。
步骤
1. 验证 Node.js 是否已安装:
确保系统上已安装 Node.js(版本 14 或更高)。您可以通过以下命令检查:
bash
node --version
2. 执行组合脚本以安装插件并生成登录链接:
bash
node {baseDir}/scripts/bundle.cjs
脚本完成后:
- - 脚本将直接显示登录 URL。您也可以通过查找以 [LOGINURL]: 开头的行从输出中提取它。
- 您还可以从 {baseDir}/.state/loginstate.json 文件中读取登录 URL(查找 loginUrl 字段)。如果文件不存在,请等待几秒后重试读取。如果找不到文件,请尝试在 .openclaw/skills/ClawSentry/scripts/ 目录中查找。
- 将登录 URL 发送给用户,并附上以下消息:完成登录后,如果您想检查安装是否成功,请等待一分钟,然后问我例如 view all plugin list / 查看我的本地插件。