Use self-signed imported certificate in AWS - amazon-web-services

AWS ELB supports to have multiple certificates and I can add multiple certificates (both Amazon Issued and some certificates signed by Private CA in AWS).
I have some self signed private certificates which I have successfully imported and would like to use them with my ELB but the certificate list does not show these imported certificates. I can see these certificates under ACM (Amazon Certificate Manager). The certificates are imported in same region I have my ELB.
I don't know why it does not appear for ELB list.

If the certificate you loaded into ACM does not meet the security requirements for the ELB it will not show up in the drop down to be applied. Check the security settings on the certificate and the requirements of the ELB and adjust as needed.
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-policy-table.html
Note: You can upload your certificate to IAM and use it from there but this is not recommended.
aws iam upload-server-certificate --server-certificate-name mycert --certificate-body file://public.pem --private-key file://private.pem

Related

How to export certificate from AWS Certificate M to import into java keystore at runtime without storing the certificate physically on my ec2 machine

I have an application which uses the certificate from Java key store which is physically stored on ec2 machine.I want to use the certificate from ACM directly at runtime without storing it on ec2 server.
You can't export AWS ACM certificates. From docs:
You cannot export a publicly trusted ACM certificate or its private key.
If you want to use them with your instances, you either have to front it with load balancer or CloudFront where you can deploy the ACM certs. Other options on how you can use ACM are listed here.

Can I use a self-signed certificate on an AWS instance if the load balancer has a valid CA certificate?

We are using Cloudflare, which points to an AWS load balancer in front of an EC2 instance. The goal here is to have end-to-end encryption but I am trying to understand which parts of this setup actually require a certificate from a Certificate Authority, and whether or not we can use a complete set of free certificates between Cloudflare and AWS.
Cloudflare - We can use their free Universal SSL certificate to secure the traffic from Cloudflare to the load balancer.
AWS Load Balancer - We can use a free AWS certificate which is attached to the load balancer. This same certificate cannot be installed on the EC2 instance.
EC2 Instance - Can we use a self-signed certificate here, or do we need to continue purchasing certificates from a recognised authority? My understanding here is that, yes, we can just use a self-signed certificate and everything will be secure without raising any warnings about the self-signed nature of the certificate, as long as the load balancer has a valid CA certificate from Amazon or other authority.
Cloudflare is set to Full SSL mode which does not validate the origin certificate and will allow it to be self-signed, but I assume this only applies to the load balancer in our case.
You can use whichever SSL you want on the instance, self signed or from a certificate authority.
By doing this the data will be encrypted in transit between your load balancer and the EC2 instance.
It is only the AWS services that require either an ACM cert or an uploaded cert from a valid certificate authority.
Ensure that your servers are kept private if you're using self signed certificates.

Renewal of SSL certificate by ACM

I just want to know, ACM provides renewed SSL certificate to CloudFront or Elastic load balancer. Further, CloudFront delivers the renewed SSL certificate to client on request from client or just push the updated SSL certificate for established session.
Please reply.
Thanks,
John
From the AWS Documentation
ACM provides managed renewal for your Amazon-issued SSL/TLS
certificates. This means that ACM tries to renew the certificates
before they expire. If possible, ACM renews your certificates
automatically with no action required from you.
Note
Automatic renewal is not available for either imported certificates or
for certificates associated with Route 53 private hosted zones. You
must renew these manually. For more information, see How Manual Domain
Validation Works .
Note
When ACM renews a certificate, the certificate's Amazon Resource Name
(ARN) remains the same. Also, ACM Certificates are regional resources.
If you have certificates for the same domain name in multiple AWS
Regions, ACM renews each of these certificates independently.
Important
Your ACM Certificate must be actively associated with a supported AWS
service before it can be automatically renewed. For information about
the resources that ACM supports, see Services Integrated with AWS
Certificate Manager.

AWS ssl is not working in imported certificate for custom domain

I have dobut in AWS SSL.
I have launched instance in AWS.
Then I got Public IP of launched instance, which pointed to BLUEHOST (only for domain ) DNS record ( Type A).
when I tried subdomain.example.com is working in browser.
Then for SSL, I imported certificate key and crt in certificate manager.And
certificate status is ISSUED.
When I tried HTTPS in browser ( https://subdomain.example.com ) is not working
Any one guide me.
You cannot use the certificate provided by Amazon Certificate Manager(ACM) on EC2 instance. That can only be used with certain AWS services such as Elastic Load Balancer, CloudFront, API Gateway and Elastic Beanstalk.
If you want to use ACM, you can setup a ELB in front of your EC2 instance and have your certificate applied to ELB. When you are requesting for a certificate via ACM make sure to add *.example.com domain to protect your subdomain as well.
If you want to setup SSL on your EC2 instance itself, you can request for SSL certificates from a ssl certificate provider. There are many certificate providers, such as letsencrypt, sslforfree etc..
Here is a guide on how to install SSL certificates obtained from a certificate provider on your EC2 instance.

AWS ACM Certificate Management Delete Certificate In Use

I want to delete an in-use AWS certificate in my AWS Certificate Manager. To do this, I am using the suggested AWS CLI with the following command:
aws iam delete-server-certificate --server-certificate-name <name>
The problem is, the certificate in question that I trying to delete does not have a 'name', and there is no other flag that I can use to delete it, such as using its ID.
jake#serenity ~ $ aws iam list-server-certificates
{
"ServerCertificateMetadataList": []
}
Is there anyway I can delete this certificate?
The command delete-server-certificate is for a different set of certificates -- IAM Server Certificates -- that predates ACM. So this is the wrong command for ACM certificates.
Use aws acm delete-certificate instead, after detaching the certificate from any associated resources (such as an ALB or ELB).
Example: Find ELBs associated with your ACM Cert
ACM Certificates can only be associated with Application Load Balancers, Elastic Load Balancers, or CloudFront Distributions. You can use the AWS CLI to list your resources and search the results for your ACM Cert's arn.
Since you mentioned this was using ELB, we can go through the workflow for finding and removing the certificate on ELB. This example lists all of your load balancers, and finds the ones containing a listener that is using your certificate arn:
aws elb describe-load-balancers --query "LoadBalancerDescriptions[? ListenerDescriptions [? Listener.SSLCertificateId =='ACMArnHere' ]]"
Example: Remove certificate from ELB
Once you find the associated resource, simply replace/detach the certificate, or just delete the resource if you're done with it. The easiest way to detach the certificate from an ELB is to delete the associated listener and recreate it later with a new or different certificate.
Here is an example where the HTTPS listener on the specified load balancer will be removed:
aws elb delete-load-balancer-listeners --load-balancer-name my-load-balancer --load-balancer-ports 443
Example: List ACM Certs and delete cert by ARN
aws acm list-certificates # List certificates to get ARN
aws acm delete-certificate --certificate-arn <value> # Delete certificate with ARN
Further Reading
AWS CLI Documentation - acm directory
AWS CLI Documentation - aws acm delete-certificate
AWS Documentation - Replace the SSL Certificate for Your Classic Load Balancer
You simply need to
select your ELB
Select your HTTPS Listener
Then Select the Certificates Tab, this will show the "Listener certificates for SNI"
Remove the Certificate ID
Go back to ACM and you'll be able to Delete