Use ssl certificate on the GCP load balancer - google-cloud-platform

I have one load balancer on the GCP.
my project uses multi-domain and it is possible that add domains on after.
when I create a certificate with the google-managed certificate, I can't edit the certificate and add a domain.
I know I can remove the certificate and create a new certificate.
but not good because domains will not be certified for a while.
Do I have to get a certificate from somewhere else?
Is it possible to get a certificate that I can add to that domain later without changing the public key and private key?
What is your suggestion?

Google Cloud HTTP(S) Load Balancers support multiple certificates. If you need to add another domain, create/add a new certificate.
Using Google-managed SSL certificates

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 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

SSL Certificate with AWS Certificate Manager?

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.

How is domain name used for Amazon issued SSL certificates in ACM

I created an SSL certificate last night for use with an API (Tomcat, Spring Boot) on AWS Elastic Beanstalk using instructions provided by Amazon Certificate Manager.
When creating the cert, I entered the URL of my static site that calls the API, which is hosted by GoDaddy. ACM sent an email to my URL which I opened and approve and I now see the cert as issued, by Amazon, in my certs. I am also able to select it when I configure HTTPS for my EB load balancer. I am not able to export this cert though as it isn't private.
My question is, how is domain name used? I think I'm a little confused about how to use SSL on both my API and my static site AS WELL as the small bit of static content I'll host out of Tomcat.
Thanks.
ACM certs can only be used with AWS services - Cloudfront (if the cert is issued in us-east-1) and regionally on the classic load balancer and application load balancer.
You cannot export the cert for use in other products, so if you wanted to have Tomcat handle SSL you would need to get either a commercial cert or use something like Let's Encrypt.
If you have multiple host names you want to protect, you have different options.
You can get one cert per hostname if they are running on completely separate infrastructure; you can also have multiple host names in a single cert - even if there are multiple domains; and finally you can get a wildcard cert.

how to add a domain to an existing SSL certificate on aws

I have an SSL certificate associated with a load balancer on Amazon Web Services. I would like to have an additional domain on that certificate. My questions are:
Is it possible to add an additional domain to an EXISTING ssl certificate on aws? I see that you can add additional names when you create one, but I don't see how to do it with an existing certificate.
If no to 1, is it possible to associate 2 certs with the load balancer? Or do I need to create a new one that includes both domains and replace the cert with the new one?
Thank you for your advice.
It is not possible to do either of these things.
Certificates can never be modified -- that would invalidate them.
Balancers cannot attach more than one certificate to a given listener, and can't have more than one listener on a port.
Your solution is to create a new certificate with all of the needed domain names, and swap them out.
Actually (as of Feb 12, 2019) you can request another certificate and then Add to your load balancer. I just did this myself. I had one certificate with 5 domains and I didn't want to have to create another just for one more. So I created the new certificate for the one domain and then added ( look for a plus sign ). Easy and it takes effect right away. Good luck.
AWS ELB/ALB support up to 25 certificates now. You can request new ACM certificates or upload your own certificates and use them with your load balancers
As a work-around, you can create a new certificate in AWS Cert Manager with all the same domains from an existing cert plus one any new one needed. With DNS validation for both existing and new certs, all the existing domains successfully validate automatically on the new cert (unique DNS IDs kept for easy renewal). You just need to add the DNS validation records for any new domains, let it validate and then swap the cert (just tested with cert + Cloudfront, haven't with an ELB).