Skip to content

Commit 10f068e

Browse files
authored
[fix] remove OpenSSL sed (#181)
1 parent f612ef9 commit 10f068e

8 files changed

Lines changed: 238 additions & 171 deletions

File tree

Cargo.lock

Lines changed: 166 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/dependencies/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aws-lambda-powertools[tracer,parser]==3.11.0
1+
aws-lambda-powertools[tracer,parser]==3.12.0
22
cryptography==43.0.3
33
hpke==0.3.2
44
pksuid==1.1.2

api/requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
black==25.1.0
2-
aws-lambda-powertools[all,aws-sdk]==3.11.0
2+
aws-lambda-powertools[all,aws-sdk]==3.12.0
33
boto3-stubs[dynamodb,kms]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aws-lambda-powertools==3.11.0
1+
aws-lambda-powertools==3.12.0

canary/requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
black==25.1.0
2-
aws-lambda-powertools[all,aws-sdk]==3.11.0
2+
aws-lambda-powertools[all,aws-sdk]==3.12.0
33
boto3-stubs[dynamodb,kms]

enclave/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ path = "src/main.rs"
1414

1515
[dependencies]
1616
anyhow = { version = "=1.0.98", default-features = false }
17-
aws-lc-rs = { version = "=1.13.0", default-features = false }
17+
aws-lc-rs = { version = "=1.13.1", default-features = false }
1818
byteorder = { version = "=1.5.0", default-features = false }
1919
cel-interpreter = { version = "=0.9.1", default-features = false, features = ["json", "chrono"] }
2020
chrono = { version = "=0.4.41", default-features = false, features = ["now"] }
2121
data-encoding = { version = "=2.9.0", default-features = false, features = ["alloc"] }
2222
serde = { version = "=1.0.219", default-features = false, features = ["derive"] }
2323
serde_json = { version = "=1.0.140", default-features = false }
24-
rustls = { version = "=0.23.26", default-features = false, features = ["aws_lc_rs", "prefer-post-quantum"] }
24+
rustls = { version = "=0.23.27", default-features = false, features = ["aws_lc_rs", "prefer-post-quantum"] }
2525
vsock = { version = "=0.5.1", default-features = false }
2626
zeroize = { version = "=1.8.1", default-features = false, features = ["zeroize_derive"] }
2727

parent/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ aws-credential-types = { version = "=1.2.3", default-features = false }
2020
aws-smithy-runtime-api = { version = "=1.8.0", default-features = false, features = ["client"] }
2121
axum = { version = "=0.8.4", default-features = false, features = ["http1", "json", "tokio", "tracing"] }
2222
byteorder = { version = "=1.5.0", default-features = false }
23-
clap = { version = "=4.5.37", default-features = false, features = ["std", "derive", "env"] }
23+
clap = { version = "=4.5.38", default-features = false, features = ["std", "derive", "env"] }
2424
fastrand = { version = "=2.3.0", default-features = false }
2525
serde = { version = "=1.0.219", default-features = false, features = ["derive"] }
2626
serde_json = { version = "=1.0.140", default-features = false }
2727
thiserror = { version = "=2.0.12", default-features = false }
28-
tokio = { version = "=1.44.2", default-features = false, features = ["rt-multi-thread", "process", "tracing"] }
28+
tokio = { version = "=1.45.0", default-features = false, features = ["rt-multi-thread", "process", "tracing"] }
2929
tracing = { version = "=0.1.41", default-features = false, features = ["log"] }
3030
tracing-subscriber = { version = "=0.3.19", default-features = false, features = ["ansi", "env-filter", "fmt", "json"] }
3131
vsock = { version = "=0.5.1", default-features = false }

vault_template.yml

Lines changed: 64 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -324,46 +324,63 @@ Resources:
324324
325325
user nginx;
326326
worker_processes auto;
327-
error_log /var/log/nginx/error.log notice;
327+
328+
# number of file descriptors used for nginx
329+
# the limit for the maximum FDs on the server is usually set by the OS.
330+
# if you don't set FD's then OS settings will be used which is by default 2000
331+
worker_rlimit_nofile 100000;
332+
333+
# only log critical errors
334+
error_log /var/log/nginx/error.log crit;
328335
pid /run/nginx.pid;
329336
ssl_engine pkcs11;
330337
331338
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
332339
include /usr/share/nginx/modules/*.conf;
333340
334341
events {
335-
worker_connections 1024;
342+
# determines how much clients will be served per worker
343+
# max clients = worker_connections * worker_processes
344+
# max clients is also limited by the number of socket connections available on the system (~64k)
345+
worker_connections 4000;
346+
347+
# optimized to serve many clients with each thread, essential for linux
348+
use epoll;
349+
350+
# accept as many connections as possible, may flood worker connections if set too low
351+
multi_accept on;
336352
}
337353
338354
http {
339-
log_format json_combined escape=json
340-
'{'
341-
'"time":"$time_iso8601",'
342-
'"process":"$pid",'
343-
'"filename":"$request_filename",'
344-
'"remoteIP":"$remote_addr",'
345-
'"method":"$request_method",'
346-
'"request":"$request_uri",'
347-
'"status":"$status",'
348-
'"responseTime":"$request_time",'
349-
'"referer":"$http_referer",'
350-
'"userAgent":"$http_user_agent",'
351-
'"bytesSent":"$bytes_sent",'
352-
'"bytesReceived":"$request_length",'
353-
'"host":"$host",'
354-
'"connection_requests":"$connection_requests",'
355-
'"connection_active":"$connections_active",'
356-
'"connection_read":"$connections_reading",'
357-
'"connection_write":"$connections_writing",'
358-
'"connection_wait":"$connections_waiting"'
359-
'}';
360-
361-
access_log /var/log/nginx/access.log json_combined;
355+
# to boost I/O on HDD we can disable access logs
356+
access_log off;
357+
362358
charset utf-8;
363359
364-
sendfile on;
365-
tcp_nopush on;
366-
keepalive_timeout 65;
360+
# copies data between one FD and other from within the kernel
361+
# faster than read() + write()
362+
sendfile on;
363+
364+
# send headers in one piece, it is better than sending them one by one
365+
tcp_nopush on;
366+
367+
# don't buffer data sent, good for small data bursts in real time
368+
# https://brooker.co.za/blog/2024/05/09/nagle.html
369+
# https://news.ycombinator.com/item?id=10608356
370+
tcp_nodelay on;
371+
372+
# allow the server to close connection on non responding client, this will free up memory
373+
reset_timedout_connection on;
374+
375+
# request timed out -- default 60
376+
client_body_timeout 10;
377+
378+
# if client stop responding, free up memory -- default 60
379+
send_timeout 2;
380+
381+
# server will close connection after this time -- default 75
382+
keepalive_timeout 30;
383+
367384
types_hash_max_size 4096;
368385
369386
include /etc/nginx/mime.types;
@@ -374,6 +391,8 @@ Resources:
374391
# for more information.
375392
include /etc/nginx/conf.d/*.conf;
376393
394+
server_tokens off;
395+
377396
server {
378397
listen 443 ssl;
379398
http2 on;
@@ -393,25 +412,32 @@ Resources:
393412
proxy_set_header X-Forwarded-Proto https;
394413
proxy_set_header X-Forwarded-Port 443;
395414
proxy_set_header Proxy "";
415+
proxy_set_header Connection "";
396416
397417
proxy_pass http://127.0.0.1:8080;
398418
proxy_buffering on;
399419
proxy_redirect off;
400420
proxy_http_version 1.1;
401421
}
402-
403-
error_page 404 /404.html;
404-
location = /404.html {
405-
}
406-
407-
error_page 500 502 503 504 /50x.html;
408-
location = /50x.html {
409-
}
410422
}
411423
}
412424
owner: root
413425
group: root
414426
mode: "000644"
427+
"/etc/pki/tls/openssl.d/openssl-acm.cnf":
428+
content: |-
429+
[openssl_init]
430+
engines = engine_section
431+
432+
[engine_section]
433+
pkcs11 = pkcs11_section
434+
435+
[pkcs11_section]
436+
engine_id = pkcs11
437+
init = 1
438+
owner: root
439+
group: root
440+
mode: "000644"
415441
"/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json":
416442
content: |-
417443
{
@@ -563,6 +589,7 @@ Resources:
563589
ensureRunning: true
564590
files:
565591
- "/etc/nitro_enclaves/acm.yaml"
592+
- "/etc/pki/tls/openssl.d/openssl-acm.cnf"
566593
packages:
567594
yum:
568595
- aws-nitro-enclaves-acm
@@ -663,9 +690,6 @@ Resources:
663690

664691
usermod -aG ne ec2-user
665692

666-
# Edit the OpenSSL configuration /etc/pki/tls/openssl.cnf
667-
sed -i '/alg_section = evp_properties/a\engines = engine_section\n\n[engine_section]\npkcs11 = pkcs11_section\n\n[ pkcs11_section ]\nengine_id = pkcs11\ninit = 1' /etc/pki/tls/openssl.cnf
668-
669693
systemctl enable --now amazon-cloudwatch-agent.service
670694
systemctl enable --now nitro-enclaves-allocator.service
671695
systemctl enable --now nitro-enclaves-vsock-proxy.service
@@ -739,7 +763,7 @@ Resources:
739763
InstancesDistribution:
740764
OnDemandAllocationStrategy: lowest-price
741765
OnDemandBaseCapacity: 1
742-
OnDemandPercentageAboveBaseCapacity: 0
766+
OnDemandPercentageAboveBaseCapacity: 0 # all spot
743767
SpotAllocationStrategy: price-capacity-optimized
744768
LaunchTemplate:
745769
LaunchTemplateSpecification:

0 commit comments

Comments
 (0)