跳到正文
Skillpedia
安全48k · #5828

sops-encryption

它能做什么

这个工具可以保护配置文件中的敏感信息,比如密码或密钥。它会对这些信息进行加密打乱,使其不易被直接读取,同时保留文件的结构可见。

适用场景

  • ✓当你需要把机密信息存放在会进入版本控制(比如 Git)的文件中时。
  • ✓当你使用自动化方式安装和配置系统(GitOps)时。
  • ✓当你需要在 Kubernetes 等容器编排系统中管理机密信息时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/sops-encryption/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/sops-encryption/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我加密 “config.yaml” 文件中的密码。”

每周 5 个新技能,1 分钟读完。

工作原理

该工具会使用加密系统对文件中的敏感数据进行加密。要读取或修改这些数据,你需要一把专用密钥(例如云服务密钥或 PGP 密钥)。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

SOPS Encryption

Encrypt secrets in configuration files while keeping structure visible.

When to Use This Skill

Use this skill when:

  • Encrypting secrets in Git
  • Implementing GitOps with secrets
  • Managing Kubernetes secrets as code
  • Encrypting configuration files

Prerequisites

  • SOPS installed
  • KMS access (AWS, GCP, Azure) or PGP key

Installation

# macOS
brew install sops

# Linux
wget https://github.com/getsops/sops/releases/download/v3.8.0/sops-v3.8.0.linux.amd64
chmod +x sops-v3.8.0.linux.amd64
mv sops-v3.8.0.linux.amd64 /usr/local/bin/sops

Basic Usage

# Encrypt with AWS KMS
sops --encrypt --kms arn:aws:kms:region:account:key/key-id secrets.yaml > secrets.enc.yaml

# Decrypt
sops --decrypt secrets.enc.yaml

# Edit encrypted file
sops secrets.enc.yaml

# Encrypt in place
sops --encrypt --in-place secrets.yaml

Configuration

# .sops.yaml
creation_rules:
  - path_regex: .*\.prod\.yaml$
    kms: arn:aws:kms:us-east-1:account:key/prod-key
  - path_regex: .*\.dev\.yaml$
    kms: arn:aws:kms:us-east-1:account:key/dev-key
  - path_regex: .*
    pgp: fingerprint

Kubernetes Integration

# encrypted secret
apiVersion: v1
kind: Secret
metadata:
  name: myapp-secrets
type: Opaque
stringData:
  password: ENC[AES256_GCM,data:encrypted...]
sops:
  kms:
    - arn: arn:aws:kms:region:account:key/key-id
# With ArgoCD
# Install ksops plugin for ArgoCD to decrypt secrets

Best Practices

  • Store .sops.yaml in repository
  • Use different keys per environment
  • Rotate encryption keys regularly
  • Never commit unencrypted secrets
  • Use key aliases for readability

Related Skills

  • hashicorp-vault (hashicorp-vault) - Centralized secrets
  • argocd-gitops (argocd-gitops) - GitOps integration

Limitations

  • Apply guidance only within authorized scope; test destructive steps in non-production first.
  • Docs-only import: upstream scripts and templates not bundled.

Example

# Read-only first: inventory before any active step.
which <tool> && <tool> --help | head -n 20

Adapted from BagelHole/DevOps-Security-Agent-Skills (MIT); frontmatter, When to Use/Limitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.

常见问题

使用前需要先安装什么吗?

需要。你的电脑上要安装 SOPS 工具,并且能够访问一把加密密钥(可以来自 AWS、Google Cloud、Azure,或是 PGP 密钥)。

我可以为不同文件使用不同的密钥吗?

可以。你可以根据文件名或文件类型,配置工具使用不同的密钥。

如果我丢失了加密密钥会怎样?

一旦丢失加密密钥,你将无法再读取或修改用它加密过的数据。务必妥善保管你的密钥。

详情

作者的原始描述

Encrypt files and configs with Mozilla SOPS.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5828
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能