Skip to content

How do I generate Client certificates from my PrivateCA with the CommonName as their email address?

0

I am configuring our RADIUS server with certificate-based authentication. If you see this article it states that my client certificates need to contain their email address (unless I create a single generic user for WiFi access in our office) and each Client certificate must have the user email as either the user email in the subject alternative name, subject distinguished name, or the common name. I can create the certs using their PowerShell scripts and OpenSSL, but my goodness is it fiddly and not manageable at scale - thus I've turned to AWS's Private CA and created my CA - but can only see the CommonName can be added to the CA and not the Certs that are created from this. So, my question is, how do I generate 50-odd client certs, each with the email address (as per the requirements) in AWS? Also note that when downloading the certs, you get 3 text files and have to figure out which is the PEM file and which is the CRT file and whether or not you have to combine the client certificate with the key (as a PFX) which can then be distributed to the Windows client - however this is a secondary question for now.

Many thanks

asked 2 years ago850 views

4 Answers
0

No, not 802.1x - but very similar. Also, we don't use Windows Server in any of this infrastructure. Are you suggesting this cannot be managed in AWS at all?

answered 2 years ago

  • Hey Tim usually Cerificates for Wifi with Radius is 802.1x. TBH its not something ive looked at with AWS. What wifi APs/radius server are you using?

0

To generate client certificates from your AWS Private CA with the CommonName as the email address, you can use the AWS Private CA API or CLI, specifically the IssueCertificate action. Here's how you can approach this:

  1. Use a certificate template that allows for customization of the Subject Name. The "EndEntityCertificate/V1" template is typically used for this purpose.

  2. When calling the IssueCertificate action, you'll need to provide a Certificate Signing Request (CSR) that includes the email address as the Common Name.

  3. You can generate these CSRs programmatically for each user, ensuring that each CSR has the user's email address as the Common Name.

  4. Use the AWS CLI or an AWS SDK to automate the process of issuing certificates for multiple users.

Here's a general outline of the process:

  1. Generate a key pair for each user.
  2. Create a CSR for each user, setting the Common Name to their email address.
  3. Use the AWS CLI or SDK to call the IssueCertificate action for each CSR.
  4. Retrieve and distribute the issued certificates.

Regarding your secondary question about the file formats: When you download the certificates, you typically get the certificate itself (often with a .pem or .crt extension), the private key (usually .key), and potentially the certificate chain. To create a PFX (PKCS#12) file that includes both the certificate and private key for distribution to Windows clients, you would need to combine these files using a tool like OpenSSL.

For managing this process at scale, consider creating a script or small application that automates these steps, possibly integrating with your user management system to retrieve email addresses and distribute certificates securely.
Sources
Use AWS Private CA certificate templates - AWS Private Certificate Authority
CertificateAuthorityConfiguration - AWS Private Certificate Authority
Create a client certificate using your CA certificate - AWS IoT Core

answered 2 years ago

0

Sounds like your using 802.1x with your Radius. I had set this up a long time ago and actually used Windows to do this https://learn.microsoft.com/en-us/windows-server/networking/core-network-guide/cncg/server-certs/deploy-server-certificates-for-802.1x-wired-and-wireless-deployments

EXPERT

answered 2 years ago

0

My apologies, I did not realise this falls into 802.1x. See here the RADIUS server is provided by JumpCloud and note that the user's email must be in either the subject alternative name, subject distinguished name, or the username in the common name. This is what I'm struggling to achieve in AWS - it seems the CN is set in the CA, you cannot change that. I can achieve this using their own scripts - which you will note uses OpenSSL. I can also achieve this using EasyRSA - the only problem with this is managing 50 odd users at scale - I am having to generate each cert one at a time and I worry that when these come to expire, I will need to be notified and have to regenerate new ones (as well as deploy, globally) - so I was hoping AWS Certificate Manager was the answer to my prayers.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.