feat | Add layerlens.attestation: cryptographic hash chains for tamper-evide…#71
Closed
garrettallen14 wants to merge 4 commits into
Closed
feat | Add layerlens.attestation: cryptographic hash chains for tamper-evide…#71garrettallen14 wants to merge 4 commits into
garrettallen14 wants to merge 4 commits into
Conversation
a177760 to
84dcb7f
Compare
84dcb7f to
abf4151
Compare
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.
PR is in conjuction with these SDK changes here.
FULL PR description here.
SDK changes
Adds cryptographic attestation and HMAC signing to the instrumentation SDK. Every
@trace()call automatically produces attestation data (hash chain + root hash). If the org has a signing key, traces are HMAC-signed for authenticity. If not, the SDK auto-creates one on the first@trace()call.New Module:
layerlens.attestationAttestationEnvelopehashscopeeventortrialprevious_hashtimestampsignaturesigning_key_idHashChainadd_event(data)finalize()TrialVerificationvalidchain_validtrial_hash_validsignatures_validerrorsSigning
Two pure functions:
hmac_sign(secret, data)andhmac_verify(secret, data, signature).Modified Module:
layerlens.instrumentTraceRecorder_build_attestation()flush()/async_flush()upload_trace()Writes trace + attestation payload to a temp file, calls
client.traces.upload().Client + Resource Changes
Signing key management is abstracted away from the SDK user.
client.signing_keysresource (sync + async)@trace()callweakref-based liveness checksclear_signing_key_cache()exposed for key rotation