Azure AD Verifiable Credential from where i can get public key private key values? - azure-active-directory

I m working on one of solution with azure VC where i will need to use
private key pubic key of azure VC.
as we follow azure VC steps i have created key vault and i have seen sign in and other key are generated.
but i want to use same public key private key which is used by Azure VC in my other application logic ?

You can use the Azure KeyVault instance that VC is using for other purposes if you grant your app access via access policies. Then to use the same keys, you follow KeyVault´s documentation for keys https://learn.microsoft.com/en-us/azure/key-vault/general/developers-guide#apis-and-sdks-for-keys

Related

Can't delete API key in Cloudant

I am trying to delete/deactivate an API key in Cloudant that I fear has leaked. In the Cloudant interface under permissions, I can see a list of API keys which I can modify (remove from the database or add/remove permissions), except for the one I want to delete/deactivate. For this key, the permissions checkboxes are deactivated and the 'x' to remove it from this DB is not shown. This keys name is the same as the subdomain I use to access cloudant (<some-hash>-bluemix), so I suspect it is special.
I checked if this is a key created through IBM Cloud IAM, but there are not keys listed there.
Does anybody know how to delete/deactivate this key?
You can revoke that key from the service definition in the IBM Cloud interface
Press the Revoke button to revoke the key and confirm in the next dialogue.
This revokes the admin credential that was created when your Cloudant account was first provisioned. Any applications that use it will stop working and you will need to create new API keys to access your databases in the account.
You can create new service credentials from the same IBM Cloud interface (see left-hand menu in screenshot above).

How to use KeyVault secret for Logic App SQL Connection String

I have a Azure Logic App, which is connecting to the SQL Server Database. Currently I am saving the connection string in configurations section of the logic app.
I am planning to use the azure keyvault and get the connection string from there.
I have gone through the online articles which tells about the keyvault connector. but I am not looking for that.
I want to use the Keyvault secret for my sql server connections in the Azure Logic App.
I have also tried with the SQL GetRows as you can see below but I don't see any connection string textbox, where I can use the GetSecret Action Result
As #Skin mentioned You can use Azure Key Vault's Get Secret action in your case. For this search for Azure Key Vault Connector and select Get secret action.
Now you need to establish a connection to your Key Vault by providing your Vault name and Tenant.
Then select the secret that you want to retrieve
After you run the logic app you can see the value that got stored in your key vault.
In Vault:-
The connection strings are saved as application settings of the Logic App.
Change connection string in configuration
There you can edit the app setting related to your connection string (sql_connectionString in my case) with #Microsoft.KeyVault(SecretUri=<keyvault name>.vault.azure.net/secrets/<name of your secret>) or optionally #Microsoft.KeyVault(SecretUri=<keyvault name>.vault.azure.net/secrets/<name of your secret>/<version>).
Once you save your application settings, you will see a green check and Key vault Reference in the source column of your application setting.
Key vault Reference

I keep receiving an error while trying to load data to Azure DataBase using Azure Function

I created an Azure Function to load data from Eudonet CRM to my Azure SQL Database. I have two databases :
named Datawarehouse
named Datawarehouse-Dev
Both databases are identical and are in the same server.
When I load data directly to "Datawarehouse" the copy works fine, but when I change the database name to "Datawarehouse-Dev", I receive the following errors :
Index #0 Message: Login failed for user 'AzureFunction'. LineNumber: 65536 Source: Core .Net SqlClient Data Provider Procedure: Error Code:18456
-- Sql server error. If error code <17: => check sql transac code (user error). Else: => software or hardware errors (check availability of database)
Login failed for user 'AzureFunction'.
If anyone has an idea on where the problem could come from I would be very grateful and I also don't understand why there is an authentification error since they're both in the same server and are accessed with the same user/password.
Thanks in advance
Though #adnane already resolved the issue after using the connection string directly into Function application setting instead of storing it into Vault. This approach might compromise the application security because using connection string directly might expose it to unauthorized person.
Azure Key Vault is a good place to keep our application credentials in a secured and centralized manner. Moving the secrets to Key Vault becomes even more important while our Azure solution is growing.
In case, if anyone still looking for the solution by storing the connection string in Azure Key Vault and then using it in the Function, please follow the below steps.
Firstly, open the Azure Key Vault service and from the Settings menu select Access policies. Then select + Add new access policy.
Then choose Select principal and search for the name of the Function App as shown in below example.
Once your principal is selected choose the Secret permissions menu. In this case, we’ll only need to get the secret from the Key Vault (concretely read our connection string). Therefore, check Get permission only and then select OK.
At the end, select Save to store the new functionapp-demo-mw access policy.
ADDING SECRET TO AZURE KEY VAULT
Adding a secret to Azure Key Vault is straightforward. From the Key Vault, Settings menu select Secrets and then select + Generate/Import secret.
For Key Vault secret two values are required – name and the value. In this case we’ve called our secret OrderManagementDbConnectionString and as a value we put our SQL Database connection string. Select Create to save the secret.
By default, the secret is Enabled so it’s ready to use. Once the secret is created, we’ll need to get its URI (a unique location identifying the secret). Go to the Settings menu and select Secrets. We’ll find here our recently added secret (OrderManagementDbConnectionString). Select the secret and we’ll see it’s the only version in the list.
Select the current version of secret and copy its secret identifier. The identifier is an URI with pattern : https://<url_of_the_key_value>/<secret_name>/<secret_version>.
GETTING SECRET FROM KEY VAULT IN AZURE FUNCTION APP
Go back to the Azure Function App (functionapp-demo-mw) and on the Overview tab, select Configuration in Configured featured section.
Well, Select + New application settings. Put a name that describes the new setting (we’ve put OrderManagementConnectionString). At the end of the last year, Microsoft has added an option of sourcing Key Vault secrets directly from App Settings. This simplifies a lot the way how the secrets were used before. So, set the value of the setting to a secret reference in the following format:
#Microsoft.KeyVault(SecretUri=**secret_uri_with_version**)
We just need to replace secret_uri_with_version with the value we’ve previously copied from the secret in Azure Key Vault.
In Azure Function, you’ll just retrieve the value from the application settings and work with it the same way as it was directly a connection string stored in application settings.
// get value from appliction settings
var connectionString = Environment.GetEnvironmentVariable("OrderManagementConnectionString");
// create connection
SqlConnection connection = new SqlConnection(connectionString);

Connecting to Snowflake without specifying password using connectors

I am using .net and python connectors to connect to Snowflake.
However, I have to either specify user/password to authenticate via Snowflake or via okta.
Is there a way I can do this without specifying password? Basically, if you are running this as a process on server (.net or python) I want dont want to keep password in config files etc.
Prefer to use something like below which uses IWA (Integrated Windows Authentication) but didnt see such option in Snowflake documentation:
https://help.okta.com/en/prod/Content/Topics/Directory/Configuring_Agentless_SSO.htm
You can setup an RSA key pair instead of specifying a username and password. It's pretty straight forward if you follow their documentation.
From their documentation:
Snowflake supports using key pair authentication rather than the
typical username/password authentication. This authentication method
requires a 2048-bit (minimum) RSA key pair. Generate the PEM (Privacy
Enhanced Mail) public-private key pair using OpenSSL. The public key
is assigned to the Snowflake user who will use the Snowflake client.
https://docs.snowflake.com/en/user-guide/python-connector-example.html#using-key-pair-authentication
If you want to use username/password but don't want to store them, I use the Snowflake python library through Databricks and store my credentials in Azure Key Vault so they aren't stored in my code.

Azure App Registration Certificate vs secret

I currently have azure app registrations setup for authentication with Open ID connect using JWT. I have an app secret configured in appsettings.json , however i have read that using a certificate is better. Why is this?
Not one for posting ambiguous or discussion posts but i'm a bit stuck. I have found some Microsoft guides for configuring the certificate by creating a self signed certificate but other than that i can't find any decent documentation about what's involved.
So you wanted to use azure key vault for certificate and secret then probably you have taken a right decision.
As you may know cloud applications and services use cryptographic keys and secrets to help keep information secure.
For highly sensitive data, you should consider additional layers of protection for data. Encrypting data using a separate protection key prior to storage in Key Vault is worthwhile for example.
Azure Key Vault safeguards these keys and secrets. When you use Key Vault, you can encrypt authentication keys, storage account keys, data encryption keys, .pfx files, and passwords by using keys that are protected by hardware security modules.
You can check for more details here
Access Your Key Vaults More securely
You may need to access your key vault more securely because of its data sensitivity learn more about Secure access to a key vault
How secret and Certificate collaborate with azure key vault
Also for key vault secret and certificate you can check here
Azure key vault quick start
Setting up and retrieve a secret from Azure Key Vault using the Azure portal you can quickly start from Microsoft official document for azure key vault

Resources