Skip to content

App layer crypto codec#780

Merged
hulto merged 151 commits intomainfrom
app-layer-crypto-codec
Sep 1, 2025
Merged

App layer crypto codec#780
hulto merged 151 commits intomainfrom
app-layer-crypto-codec

Conversation

@hulto
Copy link
Copy Markdown
Collaborator

@hulto hulto commented Jun 13, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Adds a custom codec to encrypt the grpc protocol with xchacha20-poly1305
  • Derives a shared key between the server and client by using a diffie hellman key exchange
  • Adds a secrets manager (gcp for prod, yaml file on disk for dev)
  • Stores the server private key in the secrets manager
  • Creates a more locked down service account for cloud run (roles/logging.logWriter, roles/monitoring.metricWriter, roles/cloudsql.client, and roles/secretmanager.secretAccessor@REALM_tavern_encryption_private_key

TODO

  • Add secrets management interface
  • Add secrets impl as a file on disk for debug builds
  • Add GCP Secrets manager to Terraform
  • Add secrets impl in GCP HSM
  • Store crypto private key with secrets management interface
  • Prevent VScode from throwing lint warnings about env!
  • Update docs
  • Cleanup

Which issue(s) this PR fixes:

@hulto
Copy link
Copy Markdown
Collaborator Author

hulto commented Jul 12, 2024

An error (new to me) seems to occur intermittently image

Hasn't been an issue the last four commits.
Could have been an issue in the github actions env the other day.

@hulto hulto added this to the v0.2.0 milestone Jan 26, 2025
Copy link
Copy Markdown
Collaborator

@Cictrone Cictrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed rust code. Golang will come later.

if !buf.has_remaining_mut() {
// Can't add to the buffer.
#[cfg(debug_assertions)]
log::debug!("DANGER can't add to the buffer.");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continue anyway? maybe add to the comment how this alters behavior

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to exit here and manually draining the buffer doesn't seem safe.

@KCarretto KCarretto removed this from the v0.2.0 milestone Feb 1, 2025
@hulto
Copy link
Copy Markdown
Collaborator Author

hulto commented May 5, 2025

Server is crashing on calls to unmarshall.

Copy link
Copy Markdown
Collaborator

@Cictrone Cictrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gud nuf

@hulto hulto merged commit 8e55c07 into main Sep 1, 2025
4 checks passed
@hulto hulto deleted the app-layer-crypto-codec branch September 1, 2025 01:45
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.

3 participants