Skip to content

feat(clustertool): support binary file encryption and decryption - #783

Merged
Boemeltrein merged 2 commits into
mainfrom
codex/sops-binary-support
Nov 21, 2026
Merged

Boemeltrein merged 2 commits into
mainfrom
codex/sops-binary-support

Conversation

@Boemeltrein

@Boemeltrein Boemeltrein commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Description

Files selected by .sops.yaml with extensions such as .txt, .pem, and .bin were classified as binary but rejected during encryption. Encrypted files with these extensions were also skipped during decryption.

Add the SOPS binary store and recognize its encrypted JSON metadata. Matching files with unknown extensions or no extension can now be encrypted and decrypted as a whole, preserving their original bytes. Binary encryption ignores field selectors with a warning, following SOPS behavior.

⚙️ Type of change

  • 🆕 New feature (e.g., bootstrap, cluster config, or automation)
  • 🐛 Bugfix (e.g., node setup, config generation)
  • 🔃 Chart Updates/Changes included with clustertool
  • 🔃 Refactor (internal changes, no functional impact)
  • ⚠️ Breaking change (changes Talos cluster behavior)

🧪 How Has This Been Tested?

  • Passed on Windows/amd64 with Go 1.27.3: go test -mod=readonly ./pkg/sops -count=1.

  • Cross-compiled the SOPS test binary for Linux/amd64 with CGO_ENABLED=0. Linux runtime tests were not run.

  • Added tests for exact byte preservation, PEM text, CRLF, non-UTF-8 bytes, empty files, extensionless files, repeated encryption, ignored field selectors, corrupted ciphertext/MAC, and staged-file detection.

  • Verified standalone encryption leaves the Git index unchanged.

  • Applied gofmt while preserving existing line endings; git diff --check passed.

  • Run clustertool commands locally

  • Verified cluster bootstrap on Talos nodes

  • Checked generated configs are valid

  • Validated cluster state after changes

📃 Notes:

Only files matching a path_regex are processed. Existing structured formats retain their current handling. No new dependencies are required.

Tests use temporary fixtures and generated age keys; no real cluster or secrets were used.

🤖 This PR is AI generated.

✔️ Checklist:

  • ⚖️ Followed project style and contribution guidelines
  • 👀 Self-reviewed my changes
  • 🧪 Documented testing steps
  • 🏷️ PR title follows convention:
    • feat(clustertool):
    • fix(clustertool):
    • chore(clustertool):

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4d55926f-a522-4f75-afe7-9dc6153ce73d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@trueforge-bot

trueforge-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🚀 HelmRelease CI Report

Overall Status

Stage Result
🔍 Detect HelmReleases success
🧪 Helm Tests skipped

🧪 HelmReleases Tested


⏭️ HelmReleases Skipped


Result

ℹ️ No HelmReleases required testing

@Boemeltrein
Boemeltrein marked this pull request as ready for review November 21, 2026 19:56
@Boemeltrein
Boemeltrein merged commit 90c20b8 into main Nov 21, 2026
13 checks passed
@Boemeltrein
Boemeltrein deleted the codex/sops-binary-support branch November 21, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant