0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CloudFront の証明書を作成する

Posted at

CloudFront の証明書は、これまで、ROOT 発行のもので使っていたのですが、最小特権の観点からは望ましくありません。

以下のようにして、証明書を作成して、CloudFront で、公開鍵とグループを登録し、Behavior で、望ましい方法である、公開鍵グループを選択して使いましょう。

#!/bin/bash

echo ""
echo "#### I will create a key pair for CloudFront. ####"
echo ""
echo -n "CLIENT:"
read CLIENT
TODAY=$(date '+%Y%m%d')
echo ""

set -x
openssl genrsa -out cloudfront_${CLIENT}_private_key_${TODAY}.pem 2048
openssl rsa -pubout -in cloudfront_${CLIENT}_private_key_${TODAY}.pem -out cloudfront_${CLIENT}_public_key_${TODAY}.pem
set +x

echo ""
echo "#### Please check generated files. ####"
echo ""

(参考)
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?