-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add docker support #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # README.md
|
Great, thank you @igladun I started adding a Dockerfile in #72 but what you've done here looks much more full featured, and great to have a readme explanation and docker-compose setup. Re: TPM2 dependency not working on arm, this is good to know. It would be good to find a solution to avoid this dependency but still be able to verify azure tpm attestations. We need some types from az-tdx-vtpm which introduces the requirement from tpm2, but it should be possible to use these without requiring that dependency. |
|
@ameba23 , thanks for reviewing. Sorry, I noticed your draft just after creating my PR. TBH, I just started to actively contribute to open source projects and I am not used to the workflow. To reproduce the ARM problem simply build this image
|
| mkdir -p certs && cd certs | ||
| ../scripts/generate-cert.sh proxy-server 127.0.0.1 | ||
| # Convert key to PKCS#8 format (required by the proxy) | ||
| openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in server.key -out server.pkcs8.key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, this step was not needed - the files produced by generate-cert.sh work as they are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got proxy-server-1 | Error: No PKS8 Key if I don't convert to PKS8
By default the generated key is in PKCS#1 format
head server.key
-----BEGIN RSA PRIVATE KEY-----
I debugged a little bit, and as I see here https://github.com/igladun/attested-tls-proxy/blob/310798e582092179e13686cd7fe2a06d68edd83d/src/main.rs#L394
// Tries to read the key as PKCS#8, PKCS#1, or SEC1
let pks8_key = rustls_pemfile::pkcs8_private_keys(&mut reader)
.next()
.ok_or(anyhow!("No PKS8 Key"))??;
The comment is misleading, the code only uses pkcs8_private_keys()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is a very good catch you are right. Rustls only accepts PKCS8 but openssl wont generate them by default - except with newer versions of openssl.
This explains why we are each seeing different behavior (i am using openssl 3.6.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
The docker-compose file is great btw. I think this is very useful for catching bugs which don't show up in the automated tests because they relate to processing command line args, etc. |
Co-authored-by: peg <[email protected]>
hi @ameba23 ,
I added the docker-compose for testing purposes, can remove it
One important note, building on ARM without Azure/TPM features (cross-compilation not supported)