-
Notifications
You must be signed in to change notification settings - Fork 12
Use attested-tls-proxy rather than cvm-reverse-proxy on Buildernet #65
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: trunk/buildernet
Are you sure you want to change the base?
Changes from all commits
8755ec3
af87af1
0236678
b86c6c4
8ec1533
0cb2c2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [Service] | ||
| ExecStart= | ||
| ExecStart=/usr/bin/attested-tls-proxy server \ | ||
| --listen-addr 0.0.0.0:7936 \ | ||
| --server-attestation-type azure-tdx \ | ||
| --allowed-remote-attestation-type none \ | ||
| --tls-private-key-path %S/persistent/attested-tls-proxy/key.pem \ | ||
| --tls-certificate-path %S/persistent/attested-tls-proxy/cert.pem \ | ||
| 127.0.0.1:14727 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [Service] | ||
| ExecStart= | ||
| ExecStart=/usr/bin/attested-tls-proxy client \ | ||
| --listen-addr 127.0.0.1:7937 \ | ||
| --client-attestation-type dcap-tdx | ||
| --allowed-remote-attestation-type none \ | ||
| --tls-private-key-path %S/persistent/attested-tls-proxy/key.pem \ | ||
| --tls-certificate-path %S/persistent/attested-tls-proxy/cert.pem \ | ||
| ${BUILDERNET_BUILDERHUB_URL} \ | ||
| SupplementaryGroups= | ||
| ProtectSystem=strict | ||
| ProtectHome=yes | ||
| AmbientCapabilities=CAP_DAC_OVERRIDE | ||
| ReadWritePaths=/sys/kernel/config/tsm/report |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [Service] | ||
| ExecStart= | ||
| ExecStart=/usr/bin/attested-tls-proxy-server \ | ||
| --listen-addr 0.0.0.0:7936 \ | ||
| --server-attestation-type dcap-tdx \ | ||
| --allowed-remote-attestation-type none \ | ||
| --tls-private-key-path %S/persistent/attested-tls-proxy/key.pem \ | ||
| --tls-certificate-path %S/persistent/attested-tls-proxy/cert.pem \ | ||
| 127.0.0.1:14727 | ||
| SupplementaryGroups= | ||
| ProtectSystem=strict | ||
| ProtectHome=yes | ||
| AmbientCapabilities=CAP_DAC_OVERRIDE | ||
| ReadWritePaths=/sys/kernel/config/tsm/report |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the first iteration, they could be running side be side (the previous reverse proxy and the new attested proxy server), right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking the other way around - for the first iteration we just want to know whether this works, and having a fallback might make us think it works when it doesn't. Once we know it works, add cvm-reverse-proxy as a fallback in case it stops working. |
This file was deleted.
This file was deleted.
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could consider creating a reproducible debian packaging pipeline for attested-tls-proxy to avoid building it manually while building the image. This would accelerate the image building process and rollout times
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. Here i was roughly following how the other rust projects on the main branch of this repo are build - with the build_rust_package.sh script, which isn't available on this branch. It looks like we have a reproducible debian packaging pipeline for rbuilder - and since that is a rust project it would be probably quite easy to adapt it for this. In my experience i have had annoying issues with trying to get 100% reproducibility with docker - but if its working for rbuilder it will probably work for this project too. Either way, i think it will be easiest to built the first few iterations like this, as it inevitable wont work the first few times. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| REF=06aafe43335a5d228a3ea2d3b871d15d2d06e855 | ||
| CARGO_HOME="$BUILDDIR/.cargo" | ||
| PATH="$BUILDDIR/rust-toolchain/bin:$PATH" | ||
| BUILDDIR="$BUILDDIR/attested-tls-proxy" | ||
| export CARGO_HOME="$SRCDIR/mkosi.images/buildernet/mkosi.cache/cargo" | ||
|
|
||
| echo "Installing attested-tls-proxy..." | ||
|
|
||
| mkdir -p $BUILDDIR | ||
|
|
||
| curl -sSfL https://api.github.com/repos/flashbots/attested-tls-proxy/tarball/${REF} | \ | ||
| tar xzf - -C $BUILDDIR --strip-components=1 | ||
|
|
||
| cd $BUILDDIR | ||
|
|
||
| RUSTFLAGS="-C target-cpu=x86-64-v4 \ | ||
| -C link-arg=-Wl,--build-id=none \ | ||
| -C symbol-mangling-version=v0 \ | ||
| -L /usr/lib/x86_64-linux-gnu" | ||
| CARGO_PROFILE_RELEASE_LTO='thin' | ||
| CARGO_PROFILE_RELEASE_CODEGEN_UNITS='1' | ||
| CARGO_PROFILE_RELEASE_PANIC='abort' | ||
| CARGO_PROFILE_RELEASE_INCREMENTAL='false' | ||
| CARGO_PROFILE_RELEASE_OPT_LEVEL='3' | ||
| CARGO_TARGET_DIR="$BUILDDIR/target" | ||
|
|
||
| cargo build --release --locked | ||
|
|
||
| mkdir -p $DESTDIR/usr/bin | ||
| cp $CARGO_TARGET_DIR/release/attested-tls-proxy $DESTDIR/usr/bin/attested-tls-proxy |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [Unit] | ||
| DefaultDependencies=no | ||
| Description=Attested TLS Proxy client | ||
| Wants=network-online.target | ||
| After=network.target network-online.target | ||
|
|
||
| [Service] | ||
| Type=exec | ||
| DynamicUser=yes | ||
| SupplementaryGroups=tss | ||
| Environment=BUILDERNET_BUILDERHUB_URL=__BUILDERNET_BUILDERHUB_URL | ||
| ExecStart=/usr/bin/attested-tls-proxy client \ | ||
| --listen-addr 127.0.0.1:7937 \ | ||
| --allowed-remote-attestation-type none \ | ||
| --tls-private-key-path %S/persistent/attested-tls-proxy/key.pem \ | ||
| --tls-certificate-path %S/persistent/attested-tls-proxy/cert.pem \ | ||
| --client-attestation-type auto \ | ||
| ${BUILDERNET_BUILDERHUB_URL} | ||
| Restart=on-failure | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [Unit] | ||
| Description=Attested TLS Proxy server | ||
| Wants=network-online.target | ||
| After=network.target network-online.target | ||
|
|
||
| [Service] | ||
| Type=exec | ||
| DynamicUser=yes | ||
| SupplementaryGroups=tss | ||
| ExecStart=/usr/bin/attested-tls-proxy server \ | ||
| --listen-addr 0.0.0.0:7936 \ | ||
| --allowed-remote-attestation-type none \ | ||
| --server-attestation-type auto \ | ||
| --tls-private-key-path %S/persistent/attested-tls-proxy/key.pem \ | ||
| --tls-certificate-path %S/persistent/attested-tls-proxy/cert.pem \ | ||
| 127.0.0.1:14727 | ||
| Restart=on-failure | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
This file was deleted.
This file was deleted.
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 file should probably be renamed to
attested-tls-proxy-client.... Also the the main service file inbuildernetimageThere 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.
You mean the name of this file should match the service file it is overriding - in this case
attested-tls-proxy-client.service?