360 Secure SkillHub
360 安全技能中心

Artifact Signing

通过 Python 脚本调用 cryptography 库,读取 PEM 编码私钥,对指定文件或二进制产物生成分离式签名,默认保存为同路径下的 .sig 文件;运行需在命令行提供产物路径与私钥路径。文件列表中另有 verify_skill.py,但文档未对其作任何说明。

rajaryan18
rajaryan18
热度 52.32
最近更新 2026-05-11 17:30:11
分类:安全依赖:代码执行 / 读写文件应用场景:DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add artifact-signing
Metadata
name
artifact-signing
description
A skill to sign artifacts using a digital certificate and private key.

Artifact Signing Skill

This skill allows an AI agent to sign files, binaries, or any artifact using a PEM-encoded private key. It generates a detached signature file.

Dependencies

  • Python 3.x
  • cryptography library (pip install cryptography)

Tools

sign_artifact

Signs a given artifact with a private key.

Arguments:

  • artifact_path: (Required) Absolute path to the file to be signed.
  • key_path: (Required) Absolute path to the PEM-encoded private key.
  • output_path: (Optional) Absolute path where the signature should be saved. Defaults to <artifact_path>.sig.

Example Usage:

python c:\Docs\skills\artifact-signing\scripts\sign_artifact.py "C:\path\to\artifact.zip" "C:\path\to\private_key.pem"

Security Considerations

  • Private Key Protection: Never share your private key. Ensure the key file has restricted permissions.
  • Verification: Always verify the signature using the corresponding public key before trusting an artifact.