Associate custom client certificate to Azure Self-hosted Gateway - azure

I am working with Azure API management.
I have deployed a self-hosted gateway on my local machine, and I want to associate custom client certificates for security.
I have successfully uploaded a custom certificate to Azure API Management in the Portal and associated it with the API.
Now I need to associate this certificate with the self-hosted gateway. I cannot find any clear material on the internet.
How I can do this step?

This is covered in Microsoft's document Add a custom CA certificate - Azure API Management:
Create custom CA for self-hosted gateway
If you use a self-hosted gateway,
validation of server and client certificates using CA root
certificates uploaded to API Management service is not supported. To
establish trust, configure a specific client certificate so that it's
trusted by the gateway as a custom certificate authority.
Use the Gateway Certificate Authority
REST APIs to create and manage custom CAs for a self-hosted gateway.
To create a custom CA:
Add a certificate
.pfx file to your API Management instance.
Use the Gateway Certificate Authority - Create Or Update REST API to associate the certificate with the self-managed gateway.

Related

client certificate validation on APIM

I want to implement client certificate validation in Azure API Management policy to check if the client has a valid certificate as per the below documentation.
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-mutual-certificates-for-clients
I have Application gateway in front of API Management service deployed in internal mode connected to vnet.
I have the same issue as mentioned in the below artile. The certificate is not being passed down to the APIM.
Client Certificate is not being passed on by Azure Application Gateway
I see that there is support for Mutual Authentication with application gateway in preview mode. Is this the only possible option to fix this issue. Any timelines on the release for this feature on v1 application gateways.
https://learn.microsoft.com/en-us/azure/application-gateway/mutual-authentication-overview
Will the certificate be passed to APIM gateway to validate the client certificate with this feature enabled.
My APIM policy works fine when the traffic is coming to the internal endpoint when I try to access the API from within the network. This route doesnt pass through Application gateway in our setup and works fine. But having trouble getting the external access enabled with client certificates
"Will the certificate be passed to APIM gateway to validate the client certificate with this feature enabled" - no, it won't.
An answer from Microsoft:
We do have option for mutual authentication on Application Gateway
which can allow the mutual authentication between client and
Application Gateway:
https://learn.microsoft.com/en-us/azure/application-gateway/mutual-authentication-overview
However this is still in preview version, which is not included in
SLA. As the mutual authentication between AppGW and the APIM we
double confirmed with the backend engineers, unfortunately the answer
is no we do not support such a function.

Use App Service Certificate with Azure Application Gateway

Created an app service certificate in Azure to enable SSL for Application Gateway.
Had already configured SSL on the Application Gateway with a self-signed .pfx certificate to test the functionality but wanted to go with a more robust, auto-renewed and Microsoft managed solution.
However, it seems that an "App Service Certificate" is not the same as a generic certificate and doesn't show up on the listener options config page on the Application Gateway when trying to add the cert from key vault to the app gateway.
Is there any way to re-use this certificate with the Application Gateway?
I came across this today and found out that it is the 'Azure Portal' that is incapable of adding a certificate stored as key vault secret. If you use Terraform/REST API/Az CLI etc, you can add a key vault secret to Application Gateway.
This is already documented by MS.
The Azure portal supports only Key Vault certificates, not secrets. Application Gateway still supports referencing secrets from Key Vault, but only through non-portal resources like PowerShell, the Azure CLI, APIs, and Azure Resource Manager templates (ARM templates).
Again, there is a partially correct warning which is only true for 'Azure Portal'
Azure Application Gateway currently supports only Key Vault accounts in the same subscription as the Application Gateway resource. Choosing a key vault under a different subscription than your Application Gateway will result in a failure.
A simple but manual solution is to download the certificate from key vault secret via Azure Portal and upload it as a key vault certificate. You will need to do this again when the certificate is renewed.

How to create Azure service fabric cluster without security certificate for testing use?

For testing purpose, we need to spin up Azure service fabric cluster without any security certificates.
We have already created new Azure SF cluster with self-signed certificate successfully but octopus cant connect to new Azure SF cluster for package deployment due to some certificate related issues. So without certificate need to spin up new Azure service fabric cluster.
How to create Azure service fabric cluster without security certificates?
here https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-creation-via-arm
options are available to create Azure SF cluster only with security certificates.
You cannot do that in Azure, but you can create an unsecured stand-alone cluster. What you can do, is use self-signed certificates to deploy the cluster, and add Azure AD for client access to the management API's.
FabricClient and FabricGateway perform a mutual authentication. During
Azure AD authentication, Azure AD integration provides a client
identity to the server, and the server certificate is used by the
client to verify the server's identity. For more information about
Service Fabric certificates, see X.509 certificates and Service
Fabric.
This way, you can use a Service Principal to authenticate.

Can I manage Azure App Service certificate via third party?

How do I manage the certificate I purchased via Azure App Service Certificate in GoDaddy ?
You cannot manage certificate in GoDaddy since you have bought the cert in Azure. And if you want to manage certificate via Azure you can follow the below doc :
https://learn.microsoft.com/en-us/azure/app-service/web-sites-purchase-ssl-web-site

Installing certificates to the trusted root certificate store on azure web apps

How can I install a certificate into an Azure Web App so that my azure webapp can communicate with a remote service via SSL (this particular certificate is not signed by a public CA)
I generated an ssl certificate with openssl and when I install it to the trusted root certificate authentication store on my local computer the runs fine. However when I upload the cert via the management portal I get errors that the certificate isn't trusted (which is correct) and the correct error for when a certificate is not installed.
How can I install a private SSL certificate into the trusted root certificate store on an azure web app?
Unfortunately, we cannot add a certificate to the trusted certificate authority on an Azure Web App. The security implications would be quite bad if that were possible. More detail info please refer to another SO thread.
But We can use Azure Cloud Service that allowed us to do that. More info please refer to the document.
If we want to install certificates to Personal certificate store , we could upload a .pfx file to the Azure App, and add an App setting named WEBSITE_LOAD_CERTIFICATES with its value set to the thumbprint of the certificate will make it accessible to your web application. Then the certificates will be installed to the Personal certificate store . More detail please refer to Using Certificates in Azure Websites Applications.
How to obtained an SSL certificate please refer to the official document Secure your app's custom domain with HTTPS.
 
The easiest way to get an SSL certificate that meets all the requirements is to buy one in the Azure portal directly. This article shows you how to do it manually and then bind it to your custom domain in App Service.

Resources