ãµã¼ãã¹æ¦è¦
AWS Nitro Enclavesã¨ã¯ãEC2ã¤ã³ã¹ã¿ã³ã¹ãããã¨ã³ã¯ã¬ã¼ãï¼é£ã³å°ãæ確ã«ä»ã¨åºå¥ãããéå£ï¼ã¨å¼ã°ããåé¢ã»ç¬ç«ã»å¼·åãããé«åº¦ã«å¶ç´ãããä»®æ³ãã·ã³å®è¡ç°å¢ãä½æã§ããEC2ã®æ©è½ã§ãã親ã¤ã³ã¹ã¿ã³ã¹ã¨ã®å®å
¨ãªãã¼ã«ã«ã½ã±ããæ¥ç¶ã®ã¿ãæä¾ããå¤é¨ãããã¯ã¼ã¯ã¯ãªããããã¦ã¼ã¶ã¼ã¯ã¨ã³ã¯ã¬ã¼ãã«SSHã§æ¥ç¶ã§ãããã¨ã³ã¯ã¬ã¼ãå
ã®ãã¼ã¿ãã¢ããªã±ã¼ã·ã§ã³ã«ã¯ã親ã¤ã³ã¹ã¿ã³ã¹ã®ããã»ã¹ãã¢ããªã±ã¼ã·ã§ã³ãã¦ã¼ã¶ã¼ãã¢ã¯ã»ã¹ã§ãã¾ãããããã«ãããPIIãªã©ã®æãæ©å¯æ§ã®é«ããã¼ã¿ãããã¼ã¿å¦çã¢ããªã±ã¼ã·ã§ã³ãä¿è·ã§ãã¾ãã
ï¼https://docs.aws.amazon.com/images/enclaves/latest/user/images/enclave-overview.pngããï¼
AWS Certificate Manager(ACM) for Nitro Enclavesã¯ãNitro Enclavesã使ç¨ããEC2ã§å®è¡ããã¦ããWebã¢ããªã±ã¼ã·ã§ã³ã» Webãµã¼ãã¼ã§ããããªãã¯ï¼ãã©ã¤ãã¼ãSSL/TLS 証ææ¸ã使ç¨ã§ãã¾ãã
EC2 ã¤ã³ã¹ã¿ã³ã¹ã§HTTPSãµã¼ãã¼ãå®è¡ããå ´åãSSL証ææ¸ãä½æããã¤ã³ã¹ã¿ã³ã¹ã«ãã¬ã¼ã³ããã¹ãã¨ãã¦ä¿åãã¦ãã¾ãããACM for Nitro Enclavesã使ç¨ããã¨ãACM証ææ¸ãã¨ã³ã¯ã¬ã¼ãã«ãã¤ã³ããã証ææ¸ããã¬ã¼ã³ããã¹ãå½¢å¼ã§è¦ªã¤ã³ã¹ã¿ã³ã¹ã¨ãã®ã¦ã¼ã¶ã¼ã«å
¬éãããã¨ãªãããããã®è¨¼ææ¸ãWebãµã¼ãã¼ã§ç´æ¥ä½¿ç¨ã§ãã¾ãã
ç®çã»ãããããã¨
2024å¹´7æç¾å¨ãACM for Nitro Enclavesã¯Nginxã¾ãã¯Apacheã§åä½ãã¾ãã
ã¨ãããã顧客ããã®è¦æã§ã¯ãNginxãApacheã使ãããç¬èªãã¼ã¢ã³ããã°ã©ã ã使ããã¨ã®ãã¨ãæããã¦ãã®ç¬èªãã¼ã¢ã³ã§ACM for Nitro Enclavesãæ©è½ããããããã¾ãããããã«ãç¬èªãã¼ã¢ã³ã®ä»æ§ããããã¾ããã
ããã§ã以ä¸ã®æé ã§Apacheã¨Nginxã仮称ç¬èªãã¼ã¢ã³ã¨ãã¦åä½ãããæ¤è¨¼ãã¦ããã¾ãã
- Apacheã¨Nginxããã¼ãçªå·å¤ãã¦ã¤ã³ã¹ãã¼ã«ãã¦ãã
- Apacheå´ã«ACM for Nitro Enclavesè¨å®ãã
- èªåã§è¨¼ææ¸ãã¡ã¤ã«ãä½ãããï¼ï¼ï¼åä½ç¢ºèªï¼
- Nginxå´ããä½ããã証ææ¸ãæå®ãã¦SSLåã§ãããã©ãã
対象ã¨ãªãæè¡
åèURL
- Nitro Enclaves application: AWS Certificate Manager for Nitro Enclaves - AWS
- Deep dive on AWS Nitro Enclaves for applications running on Amazon EC2
- EC2ã§ç¨¼åããã¢ããªã±ã¼ã·ã§ã³ã«ãããªãç°å¢åé¢ãæä¾ï¼ï¼Nitro Enclavesã試ãã¦ã¿ã | DevelopersIO
- ãAWSãACM for Nitro Enclavesã§EC2ã¤ã³ã¹ã¿ã³ã¹ç¨ã®è¨¼ææ¸ã管ç #Apache - Qiita
æ¡ä»¶ï¼Nitro Enclavesã®è¦ä»¶ï¼
- 親ã¤ã³ã¹ã¿ã³ã¹ã®è¦ä»¶ï¼
- ä»®æ³åãããNitroãã¼ã¹ã®ã¤ã³ã¹ã¿ã³ã¹
- 4vCPUãæè¼ããIntelã¾ãã¯AMDãã¼ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ï¼C7aãC7iãG4adãM7aãM7iãM7i-FlexãR7aãR7iãR7izãT3ãT3aãTrn1ãTrn1nãU-*ãVT1ã¯é¤ãï¼
- 2vCPUãæè¼ããAWS Gravitonãã¼ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ï¼A1ãC7gdãC7gnãG5gãHpc7gãIm4gnãIs4genãM7gãM7gdãR7gãR7gdãT4gã¯é¤ãï¼
- Linuxã¾ãã¯Windowsï¼2016年以éï¼OS
- ä»®æ³åãããNitroãã¼ã¹ã®ã¤ã³ã¹ã¿ã³ã¹
- ã¨ã³ã¯ã¬ã¼ãã®è¦ä»¶ï¼
- Linux OSã®ã¿
https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-reqs
èæ ®äºé
- 親ã¤ã³ã¹ã¿ã³ã¹ãã¨ã«æ大 4 ã¤ã®åå¥ã®ã¨ã³ã¯ã¬ã¼ããä½æã§ãã
- ã¨ã³ã¯ã¬ã¼ãã¯è¦ªã¤ã³ã¹ã¿ã³ã¹ã¨ã®ã¿éä¿¡ã§ããï¼åãã¾ãã¯ç°ãªã親ã¤ã³ã¹ã¿ã³ã¹ã§å®è¡ããã¦ããã¨ã³ã¯ã¬ã¼ãã¯ç¸äºã«éä¿¡ã§ããªãï¼
- ã¨ã³ã¯ã¬ã¼ãã¯ã親ã¤ã³ã¹ã¿ã³ã¹ãrunningç¶æ ã«ããéã®ã¿ã¢ã¯ãã£ãã«ãªãï¼è¦ªã¤ã³ã¹ã¿ã³ã¹ãåæ¢ã»çµäºããã¨ããã®ã¨ã³ã¯ã¬ã¼ããçµäºããï¼
- åãã¤ã³ã¹ã¿ã³ã¹ã§ä¼æ¢ç¶æ ã¨ã¨ã³ã¯ã¬ã¼ããæå¹ã«ãããã¨ã¯ã§ããªã
- Nitro Enclaves 㯠Outpostsããã¼ã«ã«ã¾ã¼ã³ã¾ã㯠Wavelength ã¾ã¼ã³ã§ã¯ãµãã¼ãããã¦ããªã
- ACM for Nitro Enclaves㯠RSA 証ææ¸ã®ã¿ããµãã¼ã
- ACM for Nitro Enclaves㯠Linux ã¤ã³ã¹ã¿ã³ã¹ã§ã®ã¿å©ç¨å¯è½ï¼2024å¹´7æç¾å¨ãWindows ã¤ã³ã¹ã¿ã³ã¹ã§ã¯ãµãã¼ãããã¦ããªãï¼
- ACM for Nitro Enclavesã¯2024å¹´7æç¾å¨ãã¢ã¸ã¢å¤ªå¹³æ´ (大éª) ããã³ã¢ã¸ã¢å¤ªå¹³æ´ (ã¸ã£ã«ã«ã¿) ã§ã¯ãµãã¼ãããã¦ããªã
注æäºé
https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html
ç¾å¨ãNitro Enclavesã®ACMã¯NGINXãµã¼ãã¼ãããã³Apache HTTPãµã¼ãã¼ã§åä½ãã¾ãã**追å ã® Web ãµã¼ãã¼ã®ãµãã¼ãã¯ãä»å¾è¿½å ãããäºå®ã§ãã**
â»ACM for Nitro Enclaves ã¯ã親ã¤ã³ã¹ã¿ã³ã¹ã¨ã¨ã³ã¯ã¬ã¼ãéã®æ¨æºåããã PKCS11 æå·åã¤ã³ã¿ã¼ãã§ã¼ã¹ã使ç¨ãã¾ããPKCS11 ãããã³ã«ããµãã¼ãããã¢ããªã±ã¼ã·ã§ã³ã§ããã°ã証ææ¸ã¨ãã¼ãä¿è·ããããã« ACM for Nitro Enclaves ã使ç¨ããããã«é©å¿ã§ãã¾ãã
ä½æ¥ã®æµã
äºåä½æ¥
1ï¼EC2ã¤ã³ã¹ã¿ã³ã¹ã®èµ·å
ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãï¼m5.xlargeï¼4vCPUã16GBï¼
OSï¼Amazon Linux 2023ï¼ç¡æå©ç¨æ ï¼
[â¼é«åº¦ãªè©³ç´°]ãå±éããä¸ã®æ¹ã«ããNitro Enclaveãæå¹å
ã¡ãªã¿ã«m5.largeãªã©2vCPUã®ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ããé¸æããã¨ã以ä¸ã®ãããªè¦åãåºã¾ãã
ãYou cannot enable Nitro Enclaves for "m5.large" instance types. Specify a supported instance type and try again.ã
2ï¼aws-nitro-enclaves-cliã®ã¤ã³ã¹ãã¼ã«
# yum install aws-nitro-enclaves-cli -y
# yum install aws-nitro-enclaves-cli-devel -y
# nitro-cli --version
Nitro CLI 1.3.1
3ï¼nitro-enclaves-allocatorã®èµ·å&èªåèµ·åãæå¹å
# systemctl start nitro-enclaves-allocator.service && systemctl enable nitro-enclaves-allocator.service
Created symlink /etc/systemd/system/multi-user.target.wants/nitro-enclaves-allocator.service â /usr/lib/systemd/system/nitro-enclaves-allocator.service.
# more /etc/nitro_enclaves/allocator.yaml
---
# Enclave configuration file.
#
# How much memory to allocate for enclaves (in MiB).
memory_mib: 512
#
# How many CPUs to reserve for enclaves.
cpu_count: 2
4ï¼Dockerãµã¼ãã¹ã®èµ·åï¼èªåèµ·åãæå¹å
# systemctl start docker && systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service â /usr/lib/systemd/system/docker.service.
5ï¼Dockerãµã³ãã«ãã¡ã¤ã«ï¼/usr/share/nitro_enclaves/examples/helloï¼ã®ãã«ã
# docker build /usr/share/nitro_enclaves/examples/hello -t hello
[+] Building 2.3s (7/7) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 307B 0.0s
=> [internal] load metadata for docker.io/library/busybox:latest 1.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 307B 0.0s
=> [1/2] FROM
ã»ã»ã»
=> [2/2] COPY hello.sh /bin/hello.sh 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:**** 0.0s
=> => naming to docker.io/library/hello
# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
hello latest 0d44f8558cf6 2 minutes ago 4.26MB
6ï¼Docerkã¤ã¡ã¼ã¸ãNitro Enclavesã¤ã¡ã¼ã¸ã«å¤æ
# nitro-cli build-enclave --docker-uri hello:latest --output-file sample.eif
Start building the Enclave Image...
Using the locally available Docker image...
Enclave Image successfully created.
{
"Measurements": {
"HashAlgorithm": "Sha384 { ... }",
"PCR0": "4***f",
"PCR1": "4***3",
"PCR2": "6***2"
}
7ï¼Nitro Enclavesã®èµ·å
ä¾ãã°ã次ã®ã³ãã³ãã¯ãåããã£ã¬ã¯ããªã«ããsample.eifã¨ããNitro Enclaveã¤ã¡ã¼ã¸ãã¡ã¤ã«ã使ç¨ãã¦ã2vCPUã512MBã®Nitro Enclaveãä½æãã¾ãã
# nitro-cli run-enclave --cpu-count 2 --memory 512 --eif-path sample.eif
Start allocating memory...
Started enclave with enclave-cid: 16, memory: 512 MiB, cpu-ids: [1, 3]
{
"EnclaveName": "sample",
"EnclaveID": "i-0****7",
"ProcessID": 28484,
"EnclaveCID": 16,
"NumberOfCPUs": 2,
"CPUIDs": [
1,
3
],
"MemoryMiB": 512
}
8ï¼Nitro Enclavesèµ·å確èª
# nitro-cli describe-enclaves
[
{
"EnclaveName": "sample",
"EnclaveID": "i-0****7",
"ProcessID": 28484,
"EnclaveCID": 16,
"NumberOfCPUs": 2,
"CPUIDs": [
1,
3
],
"MemoryMiB": 512,
"State": "RUNNING",
"Flags": "NONE",
"Measurements": {
"HashAlgorithm": "Sha384 { ... }",
"PCR0": "4****f",
"PCR1": "4****3",
"PCR2": "6****2"
}
}
]
"State"ã"RUNNING"ã«ãªã£ã¦ã¾ããã
æé
ãã¦ãããããNitro Enclavesã¤ã³ã¹ã¿ã³ã¹ãèµ·åã§ããã®ã§ã次ã¯ããããACM証ææ¸ãè¨å®ãã¾ãã
1ï¼ACM証ææ¸ã®çºè¡
äºåã«ãåå.comã§nozaki2.comãã¡ã¤ã³ãåå¾ãããã¼ã ãµã¼ãã¼ã«Route 53ã®nozaki2.comã¾ã¼ã³ã®NSã¬ã³ã¼ããç»é²ãã¦ããã¾ãã
ACMã§nozaki2.comã®ãããªãã¯è¨¼ææ¸ãçºè¡ãã証ææ¸ARNï¼arn:aws:acm:ap-northeast-1:************:certificate/c60a1383-e409-42ad-83ad-70044654c8c3
ãã¡ã¢ãã¦ããã¾ãã
2ï¼Apacheã®ã¤ã³ã¹ãã¼ã«
# yum -y install httpd mod_ssl
3ï¼ACM for Nitro Enclavesã®ã¤ã³ã¹ãã¼ã«
# yum install aws-nitro-enclaves-acm -y
4ï¼IAMãã¼ã«ã®ä½æ
ACMã¨é¢é£ä»ãããããACM for Nitro Enclaveså°ç¨ã®ãã¼ã«ãä½æãã¦ããã¨ããã§ãããã¡ããã³ã³ã½ã¼ã«ä½æ¥ã®ããã«SSMã®æ¨©éãå¿ããã«
以ä¸ã®ããªã·ã¼ãè¨å®ãããACMforNitroEnclavesRoleããä½æãã¾ãã
- ä¿¡é ¼ããªã·ã¼
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Principal": {
"Service": [
"ec2.amazonaws.com"
]
}
}
]
}
許å¯ããªã·ã¼ï¼AmazonSSMManagedInstanceCore
Â
ä½æãããããARNï¼arn:aws:iam::************:role/ACMforNitroEnclavesRole
ãã¡ã¢ãã¦ããã¾ãã
5ï¼IAMãã¼ã«ã¨ACM証ææ¸ã®é¢é£ä»ã
aws-cliãã¤ã³ã¹ãã¼ã«ããã¦ããç°å¢ã§ã4.ã®IAMãã¼ã«ã¨1.ã®ACM証ææ¸ãé¢é£ä»ããaws-cliã³ãã³ããå®è¡ãã¾ãã
ããã§ã4.ã§ã¡ã¢ããARNã--role-arnã«ã1.ã§ã¡ã¢ããARNãcertificate_ARNã«æå®
# aws ec2 associate-enclave-certificate-iam-role --certificate-arn arn:aws:acm:ap-northeast-1:************:certificate/c60a1383-e409-42ad-83ad-70044654c8c3 --role-arn arn:aws:iam::************:role/ACMforNitroEnclavesRole --no-verify
urllib3/connectionpool.py:1063: InsecureRequestWarning: Unverified HTTPS request is being made to host 'ec2.ap-northeast-1.amazonaws.com'. Adding certificate verification is strongly advised.
See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
{
"CertificateS3BucketName": "aws-ec2-enclave-certificate-ap-northeast-1-prod",
"CertificateS3ObjectKey": "arn:aws:iam::123456789012:role/ACMforNitroEnclavesRole/arn:aws:acm:ap-northeast-1:123456789012:certificate/c****3",
"EncryptionKmsKeyId": "0****3"
}
èªå·±ç½²å証ææ¸ã使ã£ã¦ããããããã®ã¾ã¾ã ã¨CERTIFICATE_VERIFY_FAILEDã¨ã©ã¼ã«ãªããã--no-verifyãªãã·ã§ã³ãæå®ãã¦åé¿ãã¦ã¾ããè¦åã¯åºã¡ãã£ã¦ã¾ããã³ãã³ãã¯éã£ã¦ã¾ãã
6ï¼IAMãã¼ã«ã«è¨±å¯ããªã·ã¼ã追å
4.ã§ä½æããIAMãã¼ã«ã«ã証ææ¸ãä¿åãããS3ãã±ããã¸ã®ã¢ã¯ã»ã¹ãKMSããã¼ã«ã¸ã®ã¢ã¯ã»ã¹ãã§ãããã許å¯ããªã·ã¼ãACMforNitroEnclaves-policyããä½æãã¦è¿½å ãã¾ãã
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::aws-ec2-enclave-certificate-ap-northeast-1-prod/*"
]
},
{
"Effect": "Allow",
"Action": [
"kms:Decrypt"
],
"Resource": "arn:aws:kms:ap-northeast-1:*:key/0****3"
},
{
"Effect": "Allow",
"Action": "iam:GetRole",
"Resource": "arn:aws:iam::************:role/ACMforNitroEnclavesRole"
}
]
}
7ï¼EC2ã¤ã³ã¹ã¿ã³ã¹ã«IAMãã¼ã«ãã¢ã¿ãã
8ï¼ACM for Nitro Enclavesè¨å®ãã¡ã¤ã«ä½æ
ACM for Nitro Enclavesã«ã¯ããã©ã«ãã®ãµã³ãã«è¨å®ãã¡ã¤ã«acm-httpd.example.yaml ãããã®ã§ãããããªãã¼ã ãã¦ããç·¨éãã¾ãã
# cd /etc/nitro_enclaves/
# ls
acm-httpd.example.yaml acm.example.yaml allocator.yaml vsock-proxy.yaml
# mv acm-httpd.example.yaml acm.yaml
# ls -la
total 32
drwxr-xr-x. 2 root root 92 Jul 4 01:22 .
drwxr-xr-x. 83 root root 16384 Jul 3 07:17 ..
-rw-r--r--. 1 root root 2948 Feb 8 2023 acm.example.yaml
-rw-r--r--. 1 root root 3006 Feb 8 2023 acm.yaml
-rw-rw-r--. 1 root root 473 Jun 6 21:12 allocator.yaml
-rw-r--r--. 1 root root 2955 Jun 6 21:12 vsock-proxy.yaml
ãã®ããä¸ã¤ã®acm.example.yamlã¨ããã®ãæ°ã«ãªã£ãã®ã§ä¸èº«ãè¦ã¦ã¿ãã¨ãNginxç¨ã®è¨å®ã£ã½ããååãè¥å¹²ç´ããããã
acm-httpd.example.yamlâ¨Apacheãµã³ãã«ç¨
acm.example.yamlãããâ¨Nginxãµã³ãã«ç¨
acm.yamlãç·¨éããcertificate_arn:ã«è¨¼ææ¸ã®ARNãæå®
certificate_arn: "arn:aws:acm:ap-northeast-1:************:certificate/c****3"
ã¾ããacm.yamlã§ä»¥ä¸ã®ããã«ãã¹ãæå®ãã¦ããç®æãããã¾ãã
target:
Conf:
# Path to the server configuration file to be written by
# the ACM service whenever the certificate configuration changes
# (e.g. after a certificate renewal). The SSLCertificateKeyFile and
# optionally the SSLCertificateFile directives shall be populated.
path: /etc/httpd/conf.d/httpd-acm.conf
httpd-acm.confã¯ã証ææ¸ã®æ´æ°ãªã©è¨¼ææ¸ãå¤æ´ããããã³ã«ãACMã«ãã£ã¦æ¸ãè¾¼ã¾ãããµã¼ãã¼è¨å®ãã¡ã¤ã«ã¨ãããã¨ãããã
httpd-acm.confã¨ããã®ã¯ããã©ã«ãã§ã¯ç¡ãã®ã§ãssl.confããªãã¼ã ãã¦httpd-acm.confã«ãã¾ãã
ï¼ã³ãã¼ã ã¨ããã©ã«ãã§ssl.confãèªã¿è¾¼ã¾ãã¦ãã¾ããããå¿
ããªãã¼ã ãã¦ãã ããï¼
# cd /etc/httpd/conf.d/
# ls
README autoindex.conf ssl.conf userdir.conf welcome.conf
# mv ssl.conf httpd-acm.conf
httpd-acm.confã®ä¸çªä¸ã«ä»¥ä¸ã追å ãã¾ãã
<VirtualHost *:443>
ServerName nozaki2.com
SSLEngine on
SSLProtocol -all +TLSv1.2
SSLCertificateKeyFile "/etc/pki/tls/private/localhost.key"
SSLCertificateFile "/etc/pki/tls/certs/localhost.crt"
</VirtualHost>
ã¡ãªã¿ã«SSLCertificateKeyFileã¨SSLCertificateFileã®ãã¹ã¯é©å½ã§ããããã§ãããµã¼ãã¹èµ·åå¾ã«ä»¥ä¸ã®ããã«èªåçã«å¤ãã£ã¦ã¾ããã
SSLCertificateKeyFile "pkcs11:model=p11ne-token;manufacturer=Amazon;token=httpd-acm-token;id=%01;object=acm-key;type=private?pin-value=2****6"
SSLCertificateFile "/run/nitro_enclaves/acm/httpd-cert-6****e.pem"
9ï¼ãµã¼ãã¹èµ·å
ACM for Nitro Enclavesãµã¼ãã¹ãèµ·åã»æå¹åãã¾ãã
# systemctl start nitro-enclaves-acm.service
# systemctl enable nitro-enclaves-acm.service
Created symlink /etc/systemd/system/multi-user.target.wants/nitro-enclaves-acm.service â /usr/lib/systemd/system/nitro-enclaves-acm.service.
10ï¼æ¥ç¶ãã¹ã
ãã®åã«Apacheï¼httpdï¼ããªããèµ·åãã失æã証ææ¸çãèªããªãã£ã½ã
[Thu Jul 04 02:59:31.637600 2024] [ssl:error] [pid 25984:tid 25984] AH10491: Init: OSSL_STORE_open failed for PKCS#11 URI `pkcs11:model=p11ne-token;manufacturer=Amazon;token=httpd-acm-token;id=%01;object=acm-key;type=private?pin-value=41f033d01ee982a4936c426daf2fd110'
[Thu Jul 04 02:59:31.637618 2024] [ssl:emerg] [pid 25984:tid 25984] AH10492: Init: OSSL_STORE_INFO_PKEY lookup failed for private key identifier `pkcs11:model=p11ne-token;manufacturer=Amazon;token=httpd-acm-token;id=%01;object=acm-key;type=private?pin-value=41f033d01ee982a4936c426daf2fd110'
[Thu Jul 04 02:59:31.637624 2024] [ssl:emerg] [pid 25984:tid 25984] AH02312: Fatal error initialising mod_ssl, exiting.
èå¯
AL2023 OpenSSLã¨ã®ç¸æ§ããçµå±OpenSSLã証ææ¸çãèªã¿è¾¼ããã
ãã£ãããªã®ã§ããã§nitro-enclaves-acmãµã¼ãã¹ã®ä¸èº«ãèå¯ãã¦ã¿ã¾ãã
# cat /usr/lib/systemd/system/nitro-enclaves-acm.service
[Unit]
Description=Nitro Enclaves ACM Agent
After=network-online.target
DefaultDependencies=no
Requires=nitro-enclaves-allocator.service
After=nitro-enclaves-allocator.service
Before=nginx.service httpd.service
[Service]
Type=simple
ExecStartPre=-/usr/bin/mkdir -p /run/nitro_enclaves/acm
ExecStart=/usr/bin/p11ne-agent
ExecStopPost=/usr/bin/rm -r /run/nitro_enclaves/acm
Restart=always
RestartSec=5
StartLimitInterval=60
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
-
[Unit]ã»ã¯ã·ã§ã³:
ä¾åé¢ä¿ãå®ç¾©- nitro-enclaves-allocator.serviceã®å¾ããã¤nginx.serviceãhttpd.serviceã®åã«èµ·åããããã«è¨å®
- nitro-enclaves-allocatorã§CPUã®å²ãå½ã¦
-
[Service]ã»ã¯ã·ã§ã³:
- èµ·ååã«/run/nitro_enclaves/acmãã£ã¬ã¯ããªãä½æ
- /usr/bin/p11ne-agentãå®è¡ãã¦ãµã¼ãã¹éå§
- ãµã¼ãã¹åæ¢å¾ã«/run/nitro_enclaves/acmãã£ã¬ã¯ããªãåé¤
- ãµã¼ãã¹ãçµäºããå ´åã«5ç§å¾ã«åèµ·åããããã«è¨å®
- 60ç§éã«5åã¾ã§ãµã¼ãã¹ãåèµ·åã§ããããã«å¶é
-
[Install]ã»ã¯ã·ã§ã³:
- multi-userã¿ã¼ã²ããã§ãµã¼ãã¹ãæå¹å
ãã®systemdãµã¼ãã¹ã¯ãNitro Enclavesç°å¢ã§ã®ACMã¨ã¼ã¸ã§ã³ãï¼p11ne-agentï¼ã®ç®¡çãè¡ã£ã¦ãã¾ããæ®å¿µãªããp11ne-agentã¯ãã¤ããªã®ããä¸èº«ã¯è¦ãã
# more /usr/bin/p11ne-agent
******** /usr/bin/p11ne-agent: Not a text file ********
nitro-enclaves-acmãµã¼ãã¹ã®ã¹ãã¼ã¿ã¹ãè¦ãã¨ã
# systemctl status nitro-enclaves-acm
â nitro-enclaves-acm.service - Nitro Enclaves ACM Agent
Loaded: loaded (/usr/lib/systemd/system/nitro-enclaves-acm.service; enabled; preset: disabled)
Active: active (running) since Sat 2024-07-06 09:43:03 JST; 40min ago
Process: 2167 ExecStartPre=/usr/bin/mkdir -p /run/nitro_enclaves/acm (code=exited, status=0/SUCCESS)
Main PID: 2172 (p11ne-agent)
Tasks: 5 (limit: 18909)
Memory: 45.7M
CPU: 9.448s
CGroup: /system.slice/nitro-enclaves-acm.service
ââ2172 /usr/bin/p11ne-agent
ââ2191 nitro-cli run-enclave --eif-path /usr/share/nitro_enclaves/p11ne/p11ne.eif --cpu-count 2 --memory 256
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal p11ne-agent[2172]: |INFO | Refreshing token httpd-acm-token
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal p11ne-agent[2172]: |INFO | Service: httpd | Force_Start: true | Reload: 0 | Sync: 600
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal p11ne-agent[2172]: |INFO | Reloading HTTPD configuration.
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal p11ne-agent[2172]: |INFO | HTTPD is not running. Starting it now.
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal systemctl[2895]: Job for httpd.service failed because the control process exited with error c>
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal systemctl[2895]: See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for>
Jul 06 09:53:13 ip-10-0-16-102.ap-northeast-1.compute.internal p11ne-agent[2172]: |ERROR | Unable to reload HTTPD: SystemdStartHttpdError(Some(1))
Jul 06 10:03:11 ip-10-0-16-102.ap-northeast-1.compute.internal p11ne-agent[2172]: |INFO | Syncing token httpd-acm-token
p11ne-agentãHTTPDæ§æã®ãªãã¼ãããã¦å¼ã³åºãã¦ãã£ã½ãããã®ãã¨ãããACMã¨ã¼ã¸ã§ã³ããApacheãNginxã®è¨å®ãã¡ã¤ã«ã®è¨¼ææ¸ã®ãã¹çãæ¸ãæãã¦ãã®ã§ã¯ã¨ã
ãªã®ã§ãç¬èªWebãã¼ã¢ã³ã使ã£ã¦ããã¨ãã¦ãããã®ãã¹çãè¨å®ãã¡ã¤ã«ã«ã³ãã¼ãã¦å¼ã³åºãããã«ããã°ãApacheãNginxã®ä»£æ¿ãã§ããã®ã§ã¯ãªããã¨æ¨æ¸¬ãã¾ãã
æè¦æé
2æé