SSL Certificate with AWS Certificate Manager? - amazon-web-services

I am new on terms of every aspect of SSL certificate.
I have a architecture, where Route53 routes traffic to Load balance.
We are moving to production and we have to implement SSL certification to handle https traffic.
Where should i position the certificate in the architecture?
While searching i sow AWS Certificate Manager.
I am wondering how is it different ?
And when i buy a certificate can i use a single certificate with different account?
(Example: can i have same certificate set up for Staging and multiple production environment)

You can use the ACM to generate certifications for you.
It's totally free, if it's a public certificate, and will automatically renew when it expires.
But some security teams will require you to upload a more advanced certificate than ACM generates for you, in this case, you can buy the certificate and upload it in the ACM service. Keep in mind that it won't renew automatically and when it expires you will have to upload a new certificate.
Where should I position the certificate in the architecture?
It depends on your security requirements, but it's totally fine to create an HTTPS commutation between Client and Load Balancer, and an HTTP communication between Load Balancer and Server. In this case, you will only need a public certificate generated by ACM.
If your security requirements need to create a secure communication end-to-end (e.g. HTTPS communication between LoadBalancer and Server), you will need to install the same private certificate in all servers and upload your private certificate in ACM.
While searching I sow AWS Certificate Manager. I am wondering how is it different ?
The only difference is that you don't need no buy a certificate if you only use in Load Balancers / API Gateway, etc but if you want to download the certificate to install in your on-premise Load Balancer or in the servers, you will have to pay $400 for each certificate.
And when I buy a certificate can I use a single certificate with a different account? (Example: can I have the same certificate set up for Staging and multiple production environments)
Yes, you can. But keep in mind that you will need to create a wildcard certificate to support multiple DNS names.

The preferred service to use is AWS ACM.
You can either upload your own certificate (i.e. purchase it then upload) or have AWS generate and manage it for you.
If you let ACM manage and generate it will regenerate ahead of its expiry and handle the rotation on each attached resource.
It is important to note that an ACM certificate can only be bound to the following resources for HTTP traffic:
ELB
CloudFront
API Gateway
Once it is connected to these you can use SSL offloading (the TLS connection is terminated at the resource rather than the instance) to connecting to the backend resources over plain HTTP.
You should be aware that if you want to serve traffic directly from an EC2 you will not be able to use ACM public CA and instead would limited to one of the following:
Buy certificate and deploy to all servers
Use a service like certbot on each server
In addition you can use certificates that are hosted in IAM but this is considered legacy with less features than ACM.

Related

Why does AWS's Application Load Balancer require a custom domain when using HTTPS?

If I create a new AWS Application Load Balancer (ALB) using HTTP, then AWS will create a load balancer with a randomly assigned domain name. Why can't AWS do the same thing when I create a new ALB using HTTPS? Instead, when creating a new ALB using HTTPS, AWS requires me to provide a custom domain name and custom certs.
The reason is that for valid public SSL certificate you require your own domain that you control. You can't register the certificate for the default domain provided by AWS for ALB because this is not your domain.
Having SSL certs is a lot of work, including managing its registration and renewals. I guess AWS does not want to do that, though they provide SSL for CloudFront AWS-provided default domains.
great question...
With many other aws tools like Amplify you will get a working https address on random aws domain, without the need to upload a certificate to a custom domain.
here They force me to use a certificate, which forces me to use aa custom domain and not the random autogenerated aws https address.
As per the docs - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html
To use an HTTPS listener, you must deploy at least one SSL/TLS server
certificate on your load balancer. The load balancer uses a server
certificate to terminate the front-end connection and then decrypt
requests from clients before sending them to the targets.
The load balancer requires X.509 certificates (SSL/TLS server
certificates). Certificates are a digital form of identification
issued by a certificate authority (CA). A certificate contains
identification information, a validity period, a public key, a serial
number, and the digital signature of the issuer.
When you create a certificate for use with your load balancer, you must specify a domain name.
You could use Amazon's ACM to provision your certs. You will only be charged for the application as mentioned in the docs below - https://docs.aws.amazon.com/acm/latest/userguide/acm-billing.html

How do I get client certificate from ACM?

I have a network load balancer which has my mqtt instance as target.I have hosted mqtt server on my instance and I have a python script which sends traffic to my mqtt instance via network load balancer. It currently works on TCP. Now I want to make the connection secure between network load balancer and my client so I have added a listener which listens on port 8883 and I have attached acm certificates on it. Now my issue is how do I get client certificate which I will add to my python script? Any help would be appreciated.
If you generate a certificate via the public ACM CA you are not able to export the certificate, you will only be able to associate it with managed AWS resources such as elastic load balancers, CloudFront, VPNs and API Gateway.
If you want to be able to control the physical certificate your choices are limited to the below:
AWS ACM Private CA, this is an extended part of the ACM service but can be expensive.
A free SSL signing service such as certbot, these will need to be rotated more frequently than your standard CA.
Purchase an SSL through a trusted certificate authority
Now my issue is how do I get client certificate which I will add to my python script?
You can't export your certificate out of ACM. If you require to have control of a private key from your SSL cert, you need to get it from a third party, not from ACM.
ACM certs can only be used on load balancer, API gateway and CloudFront distro. If you want to use SSL cert somewhere else, you must get it from a third party. A popular choice is https://letsencrypt.org/.

How to switch certificates in AWS Certificate Manager?

I am very new to this and struggling to understand AWS.
I had a single domain foo.mydomain.com. This was registered in Route53. And there was a certificate in AWS Certificate Manager that mapped to it.
Now I have two domains foo.mydomain.com & bar.mydomain.com. I have registered the latter in Route53. And I have requrested and received a new certificate from AWS Certificate Manager. This one maps to both domains (via the "additional names" property).
How can I simply disable the old certificate and enable the new certificate?
I want the values for In use? above to be swapped.
You need to go to the services where you are utilizing these certificates (Load Balancers, CloudFront distributions or API Gateways) and change the certificate they are using there.
AWS Certificate Manager manages the SSL/TLS certificates. In general certificates are configured and consumed on the services like ALB (application load balancer), API Gateway, Virtual Machine, Cloudfront etc. If you would like to update the certificate, modify the configuration on one of the above services as applicable in your case. While changing configuration you have to choose the right certificate from ACM. Once update is successful you will see the status in ACM.
Here is an AWS documentation explains how to install/Update SSL Certificates:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-update-certificates.html

Costs for AWS SSL certificate vs GoDaddy

We are running an Apache web server on a single AWS Amazon Linux EC2 instance and we want to configure HTTPS on the web server. Either we configure an application load balancer on AWS and configure HTTPS on the ELB, or we purchase an SSL/TLS certificate from GoDaddy and configure it in the web server.
Which option is best for us in terms of long-term costs?
The cost of the Go Daddy SSL ultimately comes down to the configuration such as duration of certificate and whether its single domain, multi domain or using wildcard. You also have the option for a free SSL using certbot if cost is a factor.
Application Load Balancer is not the only service that can use ACM, you can also use a CloudFront distribution in front of a server (or load balancer) and attach your ACM certificate to it.
By using ACM you will no longer have to worry about rotation of the SSL, the renewal when close to expiry or copying it to new resources that you create.
If this is a small personal project I would suggest to go with a free certbot SSL, if its professional or a project you see expanding with additional resources I would suggest using ACM as it will make SSL management across resources easier to maintain.

SSL Certificate for subdomain that points to different server (Amazon Web Services) - Setup

I am not into SSL at all, so bear with me please. I have no idea how to start to actually solve my problem.
Current situation:
1x Webserver with Webspace for a Website and it includes a Domain Administration, also to order SSL Certificates etc.
1x Different Webserver at Amazon Web Services with a PHP-based Software on it with Login etc.
A Subdomain that I created in the Domain Administration is pointing via DNS to the IP of the AWS.
What I need:
I want an https Connection (SSL) for the Subdomain that is pointing to the AWS so that the connection/login is secure.
My question is what I have to do on the side where I have the Domain Administration and after that what I have to do on the side of the AWS.
Thank you so much!
You have several options in hand,
If you already have a SSL certificate purchased, you can include it inside the webserver (e.g; configure apache for SSL).
If you plan to use free SSL certificates from Amazon, you can use one of the following options after creating a SSL certificate in AWS Certificate Manager.
Create a AWS CloudFront Distribution and attach the SSL certificate there while configuring an origin to forward traffic to the specific web server. However, you need to create the SSL certificate in North Virginia region and there won't be any upfront costs for CloudFront). CloudFront acts as a proxy and you can explicitly instruct to cache the static content reducing the load for web server and improving the performance.
The other option is to create a Application Load Balancer (ALB) and attach the SSL certificate there ( Create the SSL certificate in the same region) while forwarding traffic to the web server. However, this will add a monthly reoccurring costs for the ALB.
All you need to do is, on AWS ACM (AWS Certificate Manager) procure a certificate for your subdomain and use AWS ELB to use the certificate and point to the AWS webserver.
After this use the ELB IP in the DNS settings.
There are other options too like procuring the subdomain certificate and installing it on the webserver on AWS.