sops-mcp 0.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sops_mcp-0.10.0/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- sops_mcp-0.10.0/.github/ISSUE_TEMPLATE/feature_request.md +24 -0
- sops_mcp-0.10.0/.github/pull_request_template.md +10 -0
- sops_mcp-0.10.0/.github/workflows/ci.yml +49 -0
- sops_mcp-0.10.0/.github/workflows/publish-pypi.yml +58 -0
- sops_mcp-0.10.0/.github/workflows/publish.yml +71 -0
- sops_mcp-0.10.0/.github/workflows/supply-chain.yml +29 -0
- sops_mcp-0.10.0/.gitignore +11 -0
- sops_mcp-0.10.0/CHANGELOG.md +137 -0
- sops_mcp-0.10.0/Dockerfile +47 -0
- sops_mcp-0.10.0/LICENSE +200 -0
- sops_mcp-0.10.0/PKG-INFO +321 -0
- sops_mcp-0.10.0/README.md +288 -0
- sops_mcp-0.10.0/SECURITY.md +48 -0
- sops_mcp-0.10.0/base-images.lock.json +18 -0
- sops_mcp-0.10.0/lib/compile_requirements.sh +31 -0
- sops_mcp-0.10.0/lib/pin_base_images.py +325 -0
- sops_mcp-0.10.0/lib/verify_base_images.py +134 -0
- sops_mcp-0.10.0/lib/verify_requirements.py +117 -0
- sops_mcp-0.10.0/pyproject.toml +67 -0
- sops_mcp-0.10.0/requirements.in +3 -0
- sops_mcp-0.10.0/requirements.lock.txt +587 -0
- sops_mcp-0.10.0/server.json +56 -0
- sops_mcp-0.10.0/src/sops_mcp/__init__.py +3 -0
- sops_mcp-0.10.0/src/sops_mcp/__main__.py +6 -0
- sops_mcp-0.10.0/src/sops_mcp/authelia_hash.py +24 -0
- sops_mcp-0.10.0/src/sops_mcp/secrets_derive.py +110 -0
- sops_mcp-0.10.0/src/sops_mcp/secrets_generator.py +49 -0
- sops_mcp-0.10.0/src/sops_mcp/server.py +1454 -0
- sops_mcp-0.10.0/src/sops_mcp/sops.py +125 -0
- sops_mcp-0.10.0/tests/__init__.py +0 -0
- sops_mcp-0.10.0/tests/test_authelia_hash.py +59 -0
- sops_mcp-0.10.0/tests/test_integration.py +282 -0
- sops_mcp-0.10.0/tests/test_secrets_derive.py +124 -0
- sops_mcp-0.10.0/tests/test_secrets_generator.py +38 -0
- sops_mcp-0.10.0/tests/test_transport_security.py +72 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report unexpected behavior
|
|
4
|
+
title: ""
|
|
5
|
+
labels: bug
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## What happened
|
|
9
|
+
|
|
10
|
+
<!-- What tool did you call, with what arguments, and what did it do? -->
|
|
11
|
+
|
|
12
|
+
## What you expected
|
|
13
|
+
|
|
14
|
+
<!-- What should it have done instead? -->
|
|
15
|
+
|
|
16
|
+
## Environment
|
|
17
|
+
|
|
18
|
+
- sops-mcp version:
|
|
19
|
+
- sops CLI version (`sops --version`):
|
|
20
|
+
- age version (`age --version`):
|
|
21
|
+
- Python version:
|
|
22
|
+
- Transport (stdio or sse):
|
|
23
|
+
|
|
24
|
+
## Reproducer
|
|
25
|
+
|
|
26
|
+
<!-- Minimal steps or a redacted secrets.enc.yaml snippet. Do NOT paste
|
|
27
|
+
real encrypted content if the underlying age key could be compromised. -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest a new tool, source type, or transform
|
|
4
|
+
title: ""
|
|
5
|
+
labels: enhancement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## What you want to do
|
|
9
|
+
|
|
10
|
+
<!-- Describe the workflow. What tool or capability would make it possible? -->
|
|
11
|
+
|
|
12
|
+
## Why the existing tools aren't enough
|
|
13
|
+
|
|
14
|
+
<!-- Walk through how you'd currently have to do this with the existing
|
|
15
|
+
tool set, and what falls short. -->
|
|
16
|
+
|
|
17
|
+
## Out-of-scope check
|
|
18
|
+
|
|
19
|
+
<!-- sops-mcp intentionally does NOT support:
|
|
20
|
+
- Returning plaintext secret values over the MCP boundary
|
|
21
|
+
- In-place value update for generated/derived secrets (use rotate)
|
|
22
|
+
- Imported/templated sources (orchestration concerns — use your
|
|
23
|
+
deployment templating layer)
|
|
24
|
+
Is your request compatible with these boundaries? -->
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this PR change, and why? -->
|
|
4
|
+
|
|
5
|
+
## Test plan
|
|
6
|
+
|
|
7
|
+
- [ ] `pytest tests/ -v` passes locally
|
|
8
|
+
- [ ] Integration tests updated if tool behavior changed
|
|
9
|
+
- [ ] CHANGELOG.md updated under `[Unreleased]`
|
|
10
|
+
- [ ] If a new source type or transform: updated README "Sources" / "Transforms" section
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install sops and age
|
|
25
|
+
run: |
|
|
26
|
+
set -euo pipefail
|
|
27
|
+
curl -fsSL \
|
|
28
|
+
https://github.com/getsops/sops/releases/download/v3.9.4/sops-v3.9.4.linux.amd64 \
|
|
29
|
+
-o /tmp/sops
|
|
30
|
+
echo "5488e32bc471de7982ad895dd054bbab3ab91c417a118426134551e9626e4e85 /tmp/sops" \
|
|
31
|
+
| sha256sum -c -
|
|
32
|
+
sudo install -m 755 /tmp/sops /usr/local/bin/sops
|
|
33
|
+
curl -fsSL \
|
|
34
|
+
https://github.com/FiloSottile/age/releases/download/v1.2.0/age-v1.2.0-linux-amd64.tar.gz \
|
|
35
|
+
-o /tmp/age.tar.gz
|
|
36
|
+
echo "2ae71cb3ea761118937a944083f057cfd42f0ef11d197ce72fc2b8780d50c4ef /tmp/age.tar.gz" \
|
|
37
|
+
| sha256sum -c -
|
|
38
|
+
tar -xzf /tmp/age.tar.gz -C /tmp
|
|
39
|
+
sudo install -m 755 /tmp/age/age /usr/local/bin/age
|
|
40
|
+
sudo install -m 755 /tmp/age/age-keygen /usr/local/bin/age-keygen
|
|
41
|
+
|
|
42
|
+
- name: Install Python dependencies
|
|
43
|
+
run: pip install -e ".[dev]"
|
|
44
|
+
|
|
45
|
+
- name: Lint
|
|
46
|
+
run: ruff check src/ tests/
|
|
47
|
+
|
|
48
|
+
- name: Test
|
|
49
|
+
run: pytest tests/ -v
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Trusted Publishing — no PyPI API token. The workflow exchanges its GitHub
|
|
4
|
+
# OIDC token for a short-lived PyPI upload credential. Configure the trusted
|
|
5
|
+
# publisher on PyPI before the first run:
|
|
6
|
+
# https://pypi.org/manage/account/publishing/
|
|
7
|
+
#
|
|
8
|
+
# PyPI Project Name: sops-mcp
|
|
9
|
+
# Owner: privacyplaybook
|
|
10
|
+
# Repository name: sops-mcp
|
|
11
|
+
# Workflow name: publish-pypi.yml
|
|
12
|
+
# Environment name: pypi
|
|
13
|
+
#
|
|
14
|
+
# Also create a GitHub Environment named `pypi` in repo Settings → Environments
|
|
15
|
+
# (deploy-time gate; can also pin allowed branches/tags).
|
|
16
|
+
|
|
17
|
+
on:
|
|
18
|
+
push:
|
|
19
|
+
tags: ["v*.*.*"]
|
|
20
|
+
workflow_dispatch:
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
build:
|
|
24
|
+
needs: []
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.13"
|
|
31
|
+
- name: Build sdist + wheel
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install --upgrade build
|
|
34
|
+
python -m build
|
|
35
|
+
- name: Verify build artifacts
|
|
36
|
+
run: |
|
|
37
|
+
ls -la dist/
|
|
38
|
+
python -m pip install --upgrade twine
|
|
39
|
+
python -m twine check dist/*
|
|
40
|
+
- uses: actions/upload-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
|
|
45
|
+
publish:
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/p/sops-mcp
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write # required for OIDC
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/download-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: dist
|
|
57
|
+
path: dist/
|
|
58
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Publish image to GHCR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["v*.*.*"]
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
verify-supply-chain:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.13"
|
|
18
|
+
- name: Verify requirements lockfile
|
|
19
|
+
run: python3 lib/verify_requirements.py
|
|
20
|
+
- name: Verify base images are digest-pinned
|
|
21
|
+
run: python3 lib/verify_base_images.py
|
|
22
|
+
|
|
23
|
+
publish:
|
|
24
|
+
needs: verify-supply-chain
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
packages: write
|
|
29
|
+
id-token: write
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
- name: Set up Docker Buildx
|
|
34
|
+
uses: docker/setup-buildx-action@v3
|
|
35
|
+
|
|
36
|
+
- name: Log in to GitHub Container Registry
|
|
37
|
+
uses: docker/login-action@v3
|
|
38
|
+
with:
|
|
39
|
+
registry: ghcr.io
|
|
40
|
+
username: ${{ github.actor }}
|
|
41
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
42
|
+
|
|
43
|
+
- name: Compute image tags
|
|
44
|
+
id: meta
|
|
45
|
+
uses: docker/metadata-action@v5
|
|
46
|
+
with:
|
|
47
|
+
images: ghcr.io/${{ github.repository }}
|
|
48
|
+
tags: |
|
|
49
|
+
type=sha,prefix=sha-,format=short
|
|
50
|
+
type=ref,event=tag
|
|
51
|
+
type=raw,value=latest,enable={{is_default_branch}}
|
|
52
|
+
|
|
53
|
+
- name: Build and push image
|
|
54
|
+
id: build
|
|
55
|
+
uses: docker/build-push-action@v6
|
|
56
|
+
with:
|
|
57
|
+
context: .
|
|
58
|
+
push: true
|
|
59
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
60
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
61
|
+
provenance: mode=max
|
|
62
|
+
sbom: true
|
|
63
|
+
|
|
64
|
+
- name: Install cosign
|
|
65
|
+
uses: sigstore/cosign-installer@v3
|
|
66
|
+
|
|
67
|
+
- name: Sign image with cosign (keyless)
|
|
68
|
+
env:
|
|
69
|
+
IMAGE: ghcr.io/${{ github.repository }}
|
|
70
|
+
DIGEST: ${{ steps.build.outputs.digest }}
|
|
71
|
+
run: cosign sign --yes "${IMAGE}@${DIGEST}"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Supply chain
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- Dockerfile
|
|
8
|
+
- requirements.in
|
|
9
|
+
- requirements.lock.txt
|
|
10
|
+
- base-images.lock.json
|
|
11
|
+
- lib/**
|
|
12
|
+
- .github/workflows/supply-chain.yml
|
|
13
|
+
pull_request:
|
|
14
|
+
branches: [main]
|
|
15
|
+
workflow_dispatch:
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
verify:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.13"
|
|
26
|
+
- name: Verify requirements lockfile
|
|
27
|
+
run: python3 lib/verify_requirements.py
|
|
28
|
+
- name: Verify base images are digest-pinned
|
|
29
|
+
run: python3 lib/verify_base_images.py
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.10.0]
|
|
9
|
+
|
|
10
|
+
Supply-chain hardening release. Migrates the published Docker image to a
|
|
11
|
+
Chainguard / Wolfi Python base for a signed origin and a distroless
|
|
12
|
+
runtime. Python 3.13 minimum runtime in the published image; the library
|
|
13
|
+
itself still supports 3.11+. No changes to the tool surface or to the
|
|
14
|
+
"no plaintext crosses the MCP boundary" property.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Base image switched to `cgr.dev/chainguard/python`** (Wolfi). The
|
|
19
|
+
build stage uses `:latest-dev` (with apk + shell + build toolchain);
|
|
20
|
+
the runtime stage uses `:latest` (distroless: no shell, no apk, no
|
|
21
|
+
package manager). Both are digest-pinned in `base-images.lock.json`
|
|
22
|
+
and cosign-verified by the supply-chain workflow. Wins: signed origin
|
|
23
|
+
via Chainguard's release identity, smaller surface, glibc-based (so
|
|
24
|
+
no Alpine/musl gotchas).
|
|
25
|
+
- **Container runs as Chainguard's built-in `nonroot` user (uid 65532)**
|
|
26
|
+
instead of a custom uid 10001. No bind mounts in the supported
|
|
27
|
+
deployment, so this is documentation-only for most users; deployments
|
|
28
|
+
that mount host directories into the container will need to chown.
|
|
29
|
+
- **`sops` and `age` binaries now come from Wolfi's apk repo** (signed
|
|
30
|
+
by Chainguard) rather than separately curl-downloaded with pinned
|
|
31
|
+
checksums. They are pinned transitively by the digest of the build
|
|
32
|
+
base image — re-pinning the base also re-pins these binaries.
|
|
33
|
+
- **Published image runtime is Python 3.13.** The library's
|
|
34
|
+
`requires-python` is unchanged (`>=3.11`); only the Docker runtime
|
|
35
|
+
bumped. CI matrix expanded to test 3.11, 3.12, and 3.13.
|
|
36
|
+
- **CMD → ENTRYPOINT.** The container now uses an ENTRYPOINT pointing
|
|
37
|
+
at the venv-installed console script for clearer container semantics.
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **`cgr.dev` registry support in `lib/pin_base_images.py`** so the
|
|
42
|
+
digest-pin/cosign-verify pipeline works for Chainguard images.
|
|
43
|
+
|
|
44
|
+
## [0.9.1]
|
|
45
|
+
|
|
46
|
+
Security hardening release. Fixes two transitive CVEs and tightens defaults
|
|
47
|
+
for the SSE-over-HTTP transport. No changes to the core tool surface or to
|
|
48
|
+
the "no plaintext crosses the MCP boundary" property.
|
|
49
|
+
|
|
50
|
+
### Security
|
|
51
|
+
|
|
52
|
+
- **Upgrade `mcp` to >=1.23.0** (GHSA — DNS rebinding protection not enabled
|
|
53
|
+
by default in earlier versions of the MCP Python SDK). The low-level
|
|
54
|
+
`SseServerTransport` in this server is now constructed with explicit
|
|
55
|
+
`TransportSecuritySettings` that validate the `Host` header on every
|
|
56
|
+
request.
|
|
57
|
+
- **Upgrade `python-multipart` to >=0.0.26** (GHSA — DoS via inefficient
|
|
58
|
+
parsing of crafted multipart preamble/epilogue data).
|
|
59
|
+
- **Refuse to bind SSE transport to `0.0.0.0` without `SOPS_MCP_API_TOKEN`.**
|
|
60
|
+
The server now raises `RuntimeError` at startup rather than silently
|
|
61
|
+
exposing an unauthenticated interface on all network interfaces.
|
|
62
|
+
- **Flip `SOPS_MCP_HOST` default from `0.0.0.0` to `127.0.0.1`** for the
|
|
63
|
+
direct `python -m sops_mcp` entrypoint. The published container still
|
|
64
|
+
binds `0.0.0.0` (because that's what makes a container reachable), which
|
|
65
|
+
combined with the above refusal means containerized deployments must now
|
|
66
|
+
set `SOPS_MCP_API_TOKEN`.
|
|
67
|
+
- **Non-root Dockerfile.** The container runs as a dedicated UID (10001)
|
|
68
|
+
instead of root. Shrinks the blast radius of any remote-code-execution
|
|
69
|
+
class bug inside the server.
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- `SOPS_MCP_ALLOWED_HOSTS` env var (comma-separated) to configure the
|
|
74
|
+
`Host`-header allowlist for the SSE transport. Defaults to loopback only;
|
|
75
|
+
deployments behind a reverse proxy or with non-loopback binds must set
|
|
76
|
+
this explicitly.
|
|
77
|
+
|
|
78
|
+
## [0.9.0]
|
|
79
|
+
|
|
80
|
+
Release candidate for the first open-source release. Adds a third secret source
|
|
81
|
+
type and per-key CRUD tools that preserve the existing "no plaintext crosses the
|
|
82
|
+
MCP boundary" security property. Promotes to 1.0.0 after a verification period.
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
|
|
86
|
+
- **`derived` source type** — A secret computed from another key in the same
|
|
87
|
+
file via a named transform. Initial transforms: `pbkdf2_sha512_authelia` and
|
|
88
|
+
`sha256_hex`. Rotating a generated source automatically recomputes derived
|
|
89
|
+
values in topological order; renaming a source updates `from:` references;
|
|
90
|
+
deleting a source is rejected while dependents still exist.
|
|
91
|
+
- **`sops_delete_secrets`** — Remove one or more keys from a file. Enforces
|
|
92
|
+
derivation dependencies (a source cannot be deleted while a derived secret
|
|
93
|
+
references it, unless both are deleted together).
|
|
94
|
+
- **`sops_rename_secret`** — Rename a key while preserving its value, source
|
|
95
|
+
type, and metadata. Updates `from:` references in any dependent derived
|
|
96
|
+
secrets.
|
|
97
|
+
- **`sops_update_external`** — Replace the value of an `external` secret (for
|
|
98
|
+
when the user has rotated an upstream credential). Rejects attempts to update
|
|
99
|
+
`generated` or `derived` secrets. Triggers a cascade recompute of any derived
|
|
100
|
+
secrets that reference the updated key.
|
|
101
|
+
- **End-to-end integration tests** exercising the real `sops` binary with a
|
|
102
|
+
throwaway age keypair. Test count: 29 (was 12).
|
|
103
|
+
- `Apache-2.0` LICENSE.
|
|
104
|
+
|
|
105
|
+
### Changed
|
|
106
|
+
|
|
107
|
+
- **`sops_create_oidc_secret`** is now a thin convenience wrapper around
|
|
108
|
+
`sops_create_secrets` with a `generated` + `derived` pair. The encrypted file
|
|
109
|
+
now contains both `KEY_NAME` and `KEY_NAME_HASH`; the hash is still returned
|
|
110
|
+
in the response for pasting into Authelia's `configuration.yml`. Rotation of
|
|
111
|
+
the base secret automatically refreshes the hash.
|
|
112
|
+
- `sops_add_metadata` now accepts `derived` entries (with `transform` and
|
|
113
|
+
`from` fields) for retrofitting metadata onto legacy files.
|
|
114
|
+
- `sops_add_secrets` now supports adding `derived` secrets that reference
|
|
115
|
+
either newly-added or existing keys.
|
|
116
|
+
|
|
117
|
+
## [0.1.0]
|
|
118
|
+
|
|
119
|
+
Initial release (internal).
|
|
120
|
+
|
|
121
|
+
### Added
|
|
122
|
+
|
|
123
|
+
- `sops_create_secrets` — Create a new encrypted file with `generated` and/or
|
|
124
|
+
`external` secrets. Stores a `_meta_unencrypted` block alongside the
|
|
125
|
+
encrypted values for decryption-free metadata access.
|
|
126
|
+
- `sops_list_secrets` — List keys and metadata without decrypting.
|
|
127
|
+
- `sops_rotate_generated` — Regenerate all `generated` secrets in a file while
|
|
128
|
+
preserving `external` values.
|
|
129
|
+
- `sops_add_secrets` — Append new secrets to an existing file (rejects
|
|
130
|
+
collisions).
|
|
131
|
+
- `sops_add_metadata` — Retrofit `_meta_unencrypted` onto legacy files.
|
|
132
|
+
- `sops_create_oidc_secret` — Authelia-specific OIDC client secret with
|
|
133
|
+
PBKDF2-SHA512 hash generation.
|
|
134
|
+
- Supply-chain protections: Docker base image digest pinning, binary checksum
|
|
135
|
+
verification, Python dependency hash locking, CI verification gate.
|
|
136
|
+
- SSE-over-HTTP transport with optional bearer-token auth.
|
|
137
|
+
- stdio transport for direct Claude Code integration.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.7
|
|
2
|
+
|
|
3
|
+
# ---- build stage ----
|
|
4
|
+
# Wolfi-based image with apk + shell + build toolchain. Used to install
|
|
5
|
+
# Python deps into a venv and to source the sops + age binaries.
|
|
6
|
+
FROM cgr.dev/chainguard/python:latest-dev@sha256:2c0fbbac86b72ebb4bfee15b64d8cd5fd6b49dfe7bb279b5c9f193198a84c1c9 AS build
|
|
7
|
+
|
|
8
|
+
USER root
|
|
9
|
+
|
|
10
|
+
# sops and age come from Wolfi's apk repo, signed by Chainguard. Pinned
|
|
11
|
+
# transitively by the digest of the build base image.
|
|
12
|
+
RUN apk add --no-cache sops age
|
|
13
|
+
|
|
14
|
+
WORKDIR /app
|
|
15
|
+
|
|
16
|
+
# Build a self-contained venv at /opt/venv. Copying the venv (instead of
|
|
17
|
+
# pip-installing again in the runtime stage) keeps the runtime distroless.
|
|
18
|
+
RUN python -m venv /opt/venv
|
|
19
|
+
ENV PATH=/opt/venv/bin:$PATH
|
|
20
|
+
|
|
21
|
+
COPY requirements.lock.txt .
|
|
22
|
+
RUN pip install --no-cache-dir --require-hashes -r requirements.lock.txt
|
|
23
|
+
|
|
24
|
+
COPY pyproject.toml .
|
|
25
|
+
COPY src/ src/
|
|
26
|
+
RUN pip install --no-cache-dir --no-deps .
|
|
27
|
+
|
|
28
|
+
# ---- runtime stage ----
|
|
29
|
+
# Distroless Wolfi Python. No shell, no apk, no package manager. Runs as
|
|
30
|
+
# the built-in `nonroot` user (uid 65532) by default.
|
|
31
|
+
FROM cgr.dev/chainguard/python:latest@sha256:18a4fbda8c280978b6aa5329f7acd4dbb106876e76fdc87913855ebf4876f2ff
|
|
32
|
+
|
|
33
|
+
COPY --from=build /usr/bin/sops /usr/bin/sops
|
|
34
|
+
COPY --from=build /usr/bin/age /usr/bin/age
|
|
35
|
+
COPY --from=build /usr/bin/age-keygen /usr/bin/age-keygen
|
|
36
|
+
COPY --from=build /opt/venv /opt/venv
|
|
37
|
+
|
|
38
|
+
ENV PATH=/opt/venv/bin:$PATH
|
|
39
|
+
ENV SOPS_MCP_TRANSPORT=sse
|
|
40
|
+
ENV SOPS_MCP_HOST=0.0.0.0
|
|
41
|
+
ENV SOPS_MCP_PORT=55090
|
|
42
|
+
ENV SOPS_MCP_ALLOWED_HOSTS=localhost,localhost:*,127.0.0.1,127.0.0.1:*
|
|
43
|
+
EXPOSE 55090
|
|
44
|
+
|
|
45
|
+
# Container binds 0.0.0.0 by default, which means SOPS_MCP_API_TOKEN must be
|
|
46
|
+
# set at runtime — the server refuses to start otherwise. See README.
|
|
47
|
+
ENTRYPOINT ["/opt/venv/bin/sops-mcp"]
|
sops_mcp-0.10.0/LICENSE
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may accept additional
|
|
167
|
+
obligations consistent with this License. However, in accepting
|
|
168
|
+
such obligations, You may act only on Your own behalf and on Your
|
|
169
|
+
sole responsibility, not on behalf of any other Contributor, and
|
|
170
|
+
only if You agree to indemnify, defend, and hold each Contributor
|
|
171
|
+
harmless for any liability incurred by, or claims asserted against,
|
|
172
|
+
such Contributor by reason of your accepting any such warranty or
|
|
173
|
+
additional liability.
|
|
174
|
+
|
|
175
|
+
END OF TERMS AND CONDITIONS
|
|
176
|
+
|
|
177
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
178
|
+
|
|
179
|
+
To apply the Apache License to your work, attach the following
|
|
180
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
181
|
+
replaced with your own identifying information. (Don't include
|
|
182
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
183
|
+
comment syntax for the file format. We also recommend that a
|
|
184
|
+
file or class name and description of purpose be included on the
|
|
185
|
+
same "printed page" as the copyright notice for easier
|
|
186
|
+
identification within third-party archives.
|
|
187
|
+
|
|
188
|
+
Copyright 2026 Owen Russell
|
|
189
|
+
|
|
190
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
191
|
+
you may not use this file except in compliance with the License.
|
|
192
|
+
You may obtain a copy of the License at
|
|
193
|
+
|
|
194
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
195
|
+
|
|
196
|
+
Unless required by applicable law or agreed to in writing, software
|
|
197
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
198
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
199
|
+
See the License for the specific language governing permissions and
|
|
200
|
+
limitations under the License.
|