Hardened: encrypt stored records with AES-256-GCM - #25
Merged
Conversation
SolidSyslogMbedTlsAesGcmPolicy replaces the HMAC policy on the store. Records at rest gain confidentiality on top of tamper-evidence: the body is encrypted, the record header is authenticated as associated data, and nonce and tag go in the trailer. Flash 14,652 B (+148) Static RAM 5,060 B (+8) Heap 17,784 B (+8) Log stack 712 B (0) Service stack 3,800 B (0) A hundred and fifty bytes, because AES-GCM is already linked — a device that negotiates a GCM ciphersuite for TLS is carrying the same primitive the store now uses. No stack movement: the policy encrypts in place, into the buffer the store already owns. The store key is unchanged. Its name says what it protects, not which algorithm protects it, so escalating the policy does not need another key provisioned. GCM needs a fresh nonce per record and mbedTLS has no context-free RNG, so the policy takes the device's DRBG as well as the key. That is the only wiring difference from the HMAC policy. The pipeline element now reports what the store actually did, derived like the transport value rather than asserted, and both fall back to the weakest honest answer if the credentials behind them are missing. The heap difference is measurement noise; the per-run test PKI moves it by up to 32 bytes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughSyslog security changes from HMAC-SHA256 to RNG-backed AES-256-GCM, while structured data now reports configurable transport and at-rest protection values. Runtime reports update measurements and collector output accordingly. ChangesSyslog security and pipeline configuration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Syslog as Syslog initialization
participant DeviceCertStore_Rng
participant TLSStream as SolidSyslogMbedTlsStream
participant AESGCM as SolidSyslogMbedTlsAesGcmPolicy
participant PipelineSD as SyslogPipelineSd
Syslog->>DeviceCertStore_Rng: obtain RNG handle
Syslog->>TLSStream: configure TLS stream with RNG
Syslog->>AESGCM: configure key callback and RNG
Syslog->>PipelineSD: initialize transport and atRest values
PipelineSD-->>Syslog: emit configured logPipeline structured data
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this tag adds
SolidSyslogMbedTlsAesGcmPolicyreplaces the HMAC policy on the store. Records at restgain confidentiality on top of tamper-evidence — the body is encrypted, the record
header is authenticated as associated data, and nonce and tag go in the trailer.
Completes hardened, and completes the sequence.
148 bytes, because AES-GCM is already linked: a device that negotiates a GCM
ciphersuite for TLS carries the same primitive the store now uses. No stack movement —
the policy encrypts in place, into the buffer the store already owns.
Two things worth noting
The store key is unchanged. Its name says what it protects, not which algorithm
protects it, so escalating the policy needs no second key provisioned. That is the
payoff of the named-key design from the HMAC step.
GCM needs a fresh nonce per record, and mbedTLS has no context-free RNG, so the
policy takes the device's DRBG alongside the key. That is the only wiring difference
from the HMAC policy.
Also in this commit
atRestin the pipeline element was hard-coded, the same defect caught ontransportin PR #24 but not yet exercised. Both values now derive from what was actually
configured, and both default to the weakest honest answer —
"tls"and"none"— so amissed
Initunderstates protection rather than overstating it.Checklist
measurements/<State>.csvcommitted, and a row added tomeasurements/tags.tsv.Tag boundaries deferred to the release pass.
./run.shgreen; the record round-tripped through an encrypted store andarrived intact, so Seal and Open are both proven end to end.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests