{"id":13213,"date":"2019-10-04T15:33:48","date_gmt":"2019-10-04T19:33:48","guid":{"rendered":"http:\/\/www.iri.com\/blog\/?p=13213"},"modified":"2019-10-04T17:17:55","modified_gmt":"2019-10-04T21:17:55","slug":"fieldshield-azure-key-vault","status":"publish","type":"post","link":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/","title":{"rendered":"Securing FieldShield Passphrases in Azure Key Vault"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">One of the primary uses of <\/span><a href=\"https:\/\/www.iri.com\/products\/fieldshield\"><span style=\"font-weight: 400;\">IRI FieldShield<\/span><\/a><span style=\"font-weight: 400;\"> is to <\/span><a href=\"https:\/\/www.iri.com\/solutions\/data-masking\/static-data-masking\/encryption\"><span style=\"font-weight: 400;\">encrypt and decrypt<\/span><\/a><span style=\"font-weight: 400;\"> sensitive data in database or flat-file columns. FieldShield relies on a passphrase to derive a symmetrical encryption key used at encryption and decryption time. The passphrase is stored in a job script file in one of three ways:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A text string directly in the the job script.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The path of a file containing the passphrase.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">An environment variable whose value resolves to the passphrase at runtime.\u00a0<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">In this article, we improve upon the security of FieldShield passphrases for data sources either in the cloud or on premise by combining the third method with an <\/span><a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/key-vault\/\"><span style=\"font-weight: 400;\">Azure<\/span><\/a><span style=\"font-weight: 400;\"> Key Vault. Future articles will show how to secure FieldShield passphrases or keys in other key management systems.<\/span><\/p>\n<h4><b>Benefits of the Approach<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Because FieldShield passphrases can be expressed as environment variables, they can be managed through a command-line hook to an Azure Key Vault. The vault is a cloud service in Microsoft&#8217;s Azure platform for securely storing \u201csecrets\u201d, which in this case are the passphrases that FieldShield uses to encrypt and decrypt values.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Azure offers many security features for protecting access to the key vault, including Active Directory for user authentication, and key rotation to periodically change key values. Built-in firewall management functionality restricts certain applications\/IP addresses from accessing the vault, too.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It is also possible to log access to monitor how and when your key vaults are queried, and by whom. This helps discover abnormal events like unauthorized key extraction attempts, or access by privileged users at unusual times.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Without the use of Azure Key Vault and batch files, the environment variable used in the FieldShield job would need to be a permanent environment variable. This permanent environment variable could be viewed by a user who may need to run the job but is not desired to have access to the passphrase.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By using Azure key vault and an executable file that contains a batch script to run FieldShield, however, the environment variable is temporary and secure. It serves up the passphrase for only the FieldShield task defined in a particular<\/span><span style=\"font-weight: 400;\"> batch job.<\/span><\/p>\n<h4><b>Solution Architecture<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">A FieldShield encryption or decryption target field function can be specified this way:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">\/FIELD=(ENC_FP_PAN=enc_fp_aes256_CreditCardNo, \u201c$passvar), POSITION=6 &#8230;<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">where <\/span><i><span style=\"font-weight: 400;\">$passvar<\/span><\/i><span style=\"font-weight: 400;\"> in this case is the environment variable that will resolve to the passphrase stored in Azure during batch execution of command-line FieldShield jobs.<\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/10\/key_shield_logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-13223 alignleft\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/key_shield_logo.png\" alt=\"\" width=\"273\" height=\"180\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Initially, the Azure Key vault will need to be set up, if one is not set up already. This example shows step-by-step how to set up a key vault with a secret \u2014 in this case a FieldShield passphrase \u2014 inside using the Azure Command Line Interface (CLI). The Azure CLI can be downloaded and run locally, which will be required for this example.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A batch file has commands that run a FieldShield job to encrypt (or decrypt) fields using the passphrase stored in the Azure Key Vault. This batch file will be encased in an .exe file to prevent Azure login credentials from being read.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Again, the environment variable tied to the passphrase exists only during the execution of the batch file, so all traces of the passphrase vanish after the batch file runs. And since a local environment variable is used, the passphrase cannot be accessed unless the batch file is edited, which is not possible as an executable set to read and run only.<\/span><\/p>\n<h4><b>Creating the Key Vault\u00a0<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Following along with this example requires the following:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Microsoft account<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Azure subscription<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Azure CLI<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">IRI FieldShield<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The Azure CLI can be downloaded from the Microsoft <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/install-azure-cli?view=azure-cli-latest\"><span style=\"font-weight: 400;\">website<\/span><\/a><span style=\"font-weight: 400;\">. It is used to interact with Azure from a local command prompt. It is required for logging into Azure via batch file.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To integrate with Azure Key Vault, first make sure you have a Microsoft account and Microsoft Azure subscription. Sign into Azure, either online or from the CLI. If using the online console, start an <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cloud-shell\/overview\"><span style=\"font-weight: 400;\">Azure Cloud Shell<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If signing in from a local CLI, use the command <\/span><i><span style=\"font-weight: 400;\">az login<\/span><\/i><span style=\"font-weight: 400;\"> to sign in. This will open a window in the computer\u2019s default browser for authentication to Azure. However, once authenticated, everything else can be performed from the CLI.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are also <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/authenticate-azure-cli?view=azure-cli-latest\"><span style=\"font-weight: 400;\">alternate authentication methods<\/span><\/a><span style=\"font-weight: 400;\"> that allow for direct logins from the CLI, which include logging in with username or password included in the command, or logging in with a service principal. Logging in with a service principal gives the least amount of permission possible if properly configured (more about this later).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Once signed in, run the command:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">az group create &#8211;name &#8220;SampleResourceGroup&#8221; &#8211;location eastus<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">This will create a resource group in the <\/span><i><span style=\"font-weight: 400;\">eastus <\/span><\/i><span style=\"font-weight: 400;\">region named \u201c<\/span><i><span style=\"font-weight: 400;\">SampleResourceGroup<\/span><\/i><span style=\"font-weight: 400;\">\u201d. Of course, you can change the name of the resource group to your liking.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To create the key vault, run:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">az keyvault create &#8211;name &#8220;SampleVault&#8221; &#8211;resource-group &#8220;SampleResourceGroup&#8221; &#8211;location eastus<\/span><\/i><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">to create the \u201c<\/span><i><span style=\"font-weight: 400;\">SampleVault<\/span><\/i><span style=\"font-weight: 400;\">\u201d in the \u201c<\/span><i><span style=\"font-weight: 400;\">SampleResourceGroup<\/span><\/i><span style=\"font-weight: 400;\">\u201d where you can store \u201csecrets\u201d like passwords or FieldShield passphrases.<\/span><\/p>\n<h4><b>Storing the FieldShield Passphrase in the Vault<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">The command:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">az keyvault secret set &#8211;vault-name &#8220;SampleVault&#8221; &#8211;name &#8220;ExamplePassphrase&#8221; &#8211;value &#8220;hVFkk965BuUv&#8221;\u00a0<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">sets a passphrase with the value hVFkk965BuUv and the name \u201cExamplePassphrase\u201d in the \u201cSampleVault\u201d. Replace hVFkk965BuUv with the value you will store in the vault.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To view the passphrase, run:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">az keyvault secret show &#8211;name &#8220;ExamplePassphrase&#8221; &#8211;vault-name &#8220;SampleVault&#8221;.<\/span><\/i><\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_terminal.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-13225 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/azure_terminal-1024x555.png\" alt=\"\" width=\"649\" height=\"352\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_terminal-1024x555.png 1024w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_terminal-300x163.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_terminal-768x416.png 768w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_terminal.png 1110w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">If this command yields the passphrase, then that means the key vault has been successfully configured.<\/span><\/p>\n<figure id=\"attachment_13228\" class=\"thumbnail wp-caption aligncenter style=\"width: 659px\"><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-13228\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/azure_vault-1024x494.png\" alt=\"\" width=\"649\" height=\"313\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault-1024x494.png 1024w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault-300x145.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault-768x371.png 768w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png 1600w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><figcaption class=\"caption wp-caption-text\"><em>A successfully configured Azure Key Vault, viewed in Azure via web browser.<\/em><\/figcaption><\/figure>\n<p><span style=\"font-weight: 400;\">The passphrase could be set as a permanent environment variable based on the value from the key vault, but instead, this example demonstrates the use of a batch file within an .exe file that will use a local environment variable instead. This method will be more secure.\u00a0<\/span><\/p>\n<h4><b>Creating a Batch File to Store and Secure the Passphrase $EV<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Even though the actual FieldShield encryption passphrase is kept secret in the Azure Key Vault, one could argue that even exposure of the environment variable name within the FieldShield job spec creates a security vulnerability. To address this, a batch file like this can be run to maintain the security of the passphrase:<\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/10\/yellow_text_box.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-13235 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/yellow_text_box.png\" alt=\"\" width=\"625\" height=\"124\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/yellow_text_box.png 625w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/yellow_text_box-300x60.png 300w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">In this batch file, a connection to Azure is established, the passphrase stored in the Azure Key Vault is written to a temporary text file, and a temporary environment variable is set to the value of the passphrase within that text file. FieldShield then runs the encryption or decryption job using that passphrase, and, finally, the text file is deleted for security.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This allows a user to run the encrypt and decrypt jobs without being able to find out what the passphrase was; i.e., it eliminates the need to specify the name of the environment variable as the clear text of the passphrase in the FieldShield encrypt\/decrypt \/FIELD statement, persistent file, or exposed environment variable.<\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/10\/Azure_Key_Vault_Diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-13227 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/Azure_Key_Vault_Diagram.png\" alt=\"\" width=\"438\" height=\"373\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/Azure_Key_Vault_Diagram.png 846w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/Azure_Key_Vault_Diagram-300x256.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/Azure_Key_Vault_Diagram-768x655.png 768w\" sizes=\"(max-width: 438px) 100vw, 438px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Remember, the environment variable must resolve to the same passphrase for both the encryption and the decryption script to get the original values back when decrypting. The batch file above logs in with the Azure username and password, but Azure service principals can be used to limit access when logging in, just to get the passphrase from the key vault.<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<h4><b>Using Azure Service Principals to Limit Login Access<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Azure service principals can be used to login to prevent logging in with full access to Azure and to hide the username and password of your Microsoft Azure account.\u00a0<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">\u00a0\u201c<\/span><\/i><i><span style=\"font-weight: 400;\">An Azure service principal is an identity created for use with applications, hosted services, and automated tools to access Azure resources.<\/span><\/i><em><span style=\"font-weight: 400;\"><span id='easy-footnote-1-13213' class='easy-footnote-margin-adjust'><\/span><span class='easy-footnote'><a href='https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#easy-footnote-bottom-1-13213' title='&lt;\/span&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;From &lt;\/span&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&lt;a href=&quot;https:\/\/docs.microsoft.com\/en-us\/powershell\/azure\/create-azure-service-principal-azureps?view=azps-2.7.0&quot;&gt;https:\/\/docs.microsoft.com\/en-us\/powershell\/azure\/create-azure-service-principal-azureps?view=azps-2.7.0&lt;\/a&gt;\u00a0'><sup>1<\/sup><\/a><\/span><i>\u201d<\/i><\/span><\/em><\/p>\n<p><span style=\"font-weight: 400;\">This access is restricted by the roles assigned to the service principal, giving you control over which resources can be accessed and at which level\u201d.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are two types of authentication available for service principals: password-based authentication, and certificate-based authentication. In this example, password-based authentication is used.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The command<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">az ad sp create-for-rbac &#8211;name ServicePrincipalName<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">creates a service principal with a randomly generated password. Take note of the <\/span><i><span style=\"font-weight: 400;\">password<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">app id<\/span><\/i><span style=\"font-weight: 400;\">, and <\/span><i><span style=\"font-weight: 400;\">tenant id<\/span><\/i><span style=\"font-weight: 400;\">. Now, the administrator of the key vault should set up an access policy.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Log in to Azure via web browser and click on the key vault resource that you wish to grant access to. Click on \u201caccess policies\u201d from the key vault menu, and select \u201cAdd access policy\u201d. For key and secret permissions, under management operations, select <\/span><b>get<\/b><span style=\"font-weight: 400;\"> only.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Select the name of the service principal previously created, click \u201cadd\u201d and save the new setting after adding. Now, Azure be be accessed from the command line via a service principal. This service principal will only grant read-access to the secret (passphrase).<\/span><span style=\"font-weight: 400;\">\u00a0<span id='easy-footnote-2-13213' class='easy-footnote-margin-adjust'><\/span><span class='easy-footnote'><a href='https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#easy-footnote-bottom-2-13213' title='Logging in via service principal is useful to restrict access to one function: retrieving the secret FieldShield passphrase. If someone is able to read the batch script (or its more secure .exe version), they will only be able to access that one function, rather than get full control of the Azure account.\u00a0'><sup>2<\/sup><\/a><\/span><\/span><\/p>\n<p><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_service_principal.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-13226 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/azure_service_principal-1024x498.png\" alt=\"\" width=\"653\" height=\"318\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_service_principal-1024x498.png 1024w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_service_principal-300x146.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_service_principal-768x373.png 768w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_service_principal.png 1600w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Use the following command to login to Azure via service principal:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">az login &#8211;service-principal &#8211;username APP_ID &#8211;password PASSWORD &#8211;tenant TENANT_ID<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">If logging in through service principal, the aforementioned command can replace the first line of the batch file example, which used log-in via username and password.<\/span><\/p>\n<h4><b>Converting the Batch File to an .EXE to Secure the Azure Credentials\u00a0<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Finally, the batch file shown above can be transformed into an executable file using the iexpress wizard from the windows\/system32 directory. This will prevent unwanted users from viewing Azure login credentials within the batch file.\u00a0<\/span><\/p>\n<p><a href=\"\/blog\/wp-content\/uploads\/2019\/10\/IExpress_Wizard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-13230 aligncenter\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/IExpress_Wizard.png\" alt=\"\" width=\"437\" height=\"343\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/IExpress_Wizard.png 437w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/IExpress_Wizard-300x235.png 300w\" sizes=\"(max-width: 437px) 100vw, 437px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">To do this,\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Run the iexpress executable as an administrator.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Create a new Self Extraction Directive file.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select \u201cextract files and run an installation command\u201d.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Add the batch file to the list of packaged files.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">For the custom command in the \u201cInstall Program to Launch\u201d menu, input \u201ccmd \/c yourscript.cmd\u201d.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select a directory where the executable file will be created.\u00a0<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Then, the executable file can be set to have permissions of read and execute only. Now, a lower-privileged user can safely run the file without the passphrase or any Azure passwords being exposed.\u00a0<\/span><\/p>\n<h4><b>Conclusion<\/b><\/h4>\n<p><a href=\"https:\/\/www.iri.com\/products\/fieldshield\"><span style=\"font-weight: 400;\">FieldShield <\/span><\/a><span style=\"font-weight: 400;\">is a powerful tool for finding and <\/span><a href=\"https:\/\/www.iri.com\/solutions\/data-masking\"><span style=\"font-weight: 400;\">masking<\/span><\/a><span style=\"font-weight: 400;\"> PII. This example demonstrated how to increase the security of the passphrase used in FieldShield encryption and decryption jobs by:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">installing the Azure CLI from the Microsoft <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/install-azure-cli?view=azure-cli-latest\"><span style=\"font-weight: 400;\">website<\/span><\/a><span style=\"font-weight: 400;\">\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">setting up an Azure key vault and storing the passphrase as a \u201csecret\u201d in the key vault\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">creating a batch file similar to the one depicted that logs into Azure, gets the passphrase from the key vault, and runs the FieldShield encryption\/decryption job using that key\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">creating an Azure service principal, for an even more secure login from the batch file\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">converting the batch file to an .EXE file to prevent login credentials from being read.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Utilizing an environment variable that is temporary, automatically deleted, and protected within an .EXE file as the passphrase for FieldShield encryption and decryption jobs can significantly improve encryption key security and key management options for those with FieldShield and an account in Azure.\u00a0<\/span><\/p>\n<figure id=\"attachment_13229\" class=\"thumbnail wp-caption aligncenter style=\"width: 658px\"><a href=\"http:\/\/www.iri.com\/blog\/wp-content\/uploads\/2019\/10\/unt_full_screen.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-13229\" src=\"\/blog\/wp-content\/uploads\/2019\/10\/unt_full_screen-1024x555.png\" alt=\"\" width=\"648\" height=\"351\" srcset=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/unt_full_screen-1024x555.png 1024w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/unt_full_screen-300x163.png 300w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/unt_full_screen-768x416.png 768w, https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/unt_full_screen.png 1600w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/a><figcaption class=\"caption wp-caption-text\"><em>This IRI Workbench screenshot show the original (plaintext) data in top left corner, and the encrypt script below it. Encrypted (ciphertext) results are shown in the top middle pane, and the restored data is below that &#8230; which are the results of the decryption script and its job outline shown in the right-most panes. At the bottom is the console output from a job, and a connection to the Azure Key Vault in a local shell.\u00a0<\/em><\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase to derive a symmetrical encryption key used at encryption and decryption time. The passphrase is stored in a job script file in one of three ways: A text string directly<\/p>\n<div><a class=\"btn-filled btn\" href=\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\" title=\"Securing FieldShield Passphrases in Azure Key Vault\">Read More<\/a><\/div>\n","protected":false},"author":119,"featured_media":13228,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[8,34],"tags":[1439,1440,1441,13,99,203,9,1442,520],"class_list":["post-13213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-protection","category-business","tag-azure","tag-azure-key-vault","tag-cli","tag-data-protection-2","tag-decryption","tag-encryption","tag-fieldshield","tag-iri-business","tag-iri-fieldshield"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Securing FieldShield Passphrases in Azure Key Vault - IRI<\/title>\n<meta name=\"description\" content=\"One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Securing FieldShield Passphrases in Azure Key Vault - IRI\" \/>\n<meta property=\"og:description\" content=\"One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase\" \/>\n<meta property=\"og:url\" content=\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\" \/>\n<meta property=\"og:site_name\" content=\"IRI\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-04T19:33:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-04T21:17:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"772\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Devon Kozenieski\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Devon Kozenieski\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\"},\"author\":{\"name\":\"Devon Kozenieski\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/de972c035aaeecfc40a3ae2ea5ff7ba1\"},\"headline\":\"Securing FieldShield Passphrases in Azure Key Vault\",\"datePublished\":\"2019-10-04T19:33:48+00:00\",\"dateModified\":\"2019-10-04T21:17:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\"},\"wordCount\":1943,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png\",\"keywords\":[\"Azure\",\"Azure Key Vault\",\"CLI\",\"data protection\",\"decryption\",\"encryption\",\"FieldShield\",\"IRI business\",\"IRI FieldShield\"],\"articleSection\":[\"Data Masking\/Protection\",\"IRI Business\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\",\"url\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\",\"name\":\"Securing FieldShield Passphrases in Azure Key Vault - IRI\",\"isPartOf\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png\",\"datePublished\":\"2019-10-04T19:33:48+00:00\",\"dateModified\":\"2019-10-04T21:17:55+00:00\",\"description\":\"One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase\",\"breadcrumb\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage\",\"url\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png\",\"contentUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png\",\"width\":1600,\"height\":772},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/beta.iri.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Securing FieldShield Passphrases in Azure Key Vault\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#website\",\"url\":\"https:\/\/beta.iri.com\/blog\/\",\"name\":\"IRI\",\"description\":\"Total Data Management Blog\",\"publisher\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/beta.iri.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#organization\",\"name\":\"IRI\",\"url\":\"https:\/\/beta.iri.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"contentUrl\":\"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png\",\"width\":750,\"height\":206,\"caption\":\"IRI\"},\"image\":{\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/de972c035aaeecfc40a3ae2ea5ff7ba1\",\"name\":\"Devon Kozenieski\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19bf36cedac5d586ea168f58f96eb2f1?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19bf36cedac5d586ea168f58f96eb2f1?s=96&d=blank&r=g\",\"caption\":\"Devon Kozenieski\"},\"url\":\"https:\/\/beta.iri.com\/blog\/author\/devonk\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Securing FieldShield Passphrases in Azure Key Vault - IRI","description":"One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/","og_locale":"en_US","og_type":"article","og_title":"Securing FieldShield Passphrases in Azure Key Vault - IRI","og_description":"One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase","og_url":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/","og_site_name":"IRI","article_published_time":"2019-10-04T19:33:48+00:00","article_modified_time":"2019-10-04T21:17:55+00:00","og_image":[{"width":1600,"height":772,"url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png","type":"image\/png"}],"author":"Devon Kozenieski","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Devon Kozenieski","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#article","isPartOf":{"@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/"},"author":{"name":"Devon Kozenieski","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/de972c035aaeecfc40a3ae2ea5ff7ba1"},"headline":"Securing FieldShield Passphrases in Azure Key Vault","datePublished":"2019-10-04T19:33:48+00:00","dateModified":"2019-10-04T21:17:55+00:00","mainEntityOfPage":{"@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/"},"wordCount":1943,"commentCount":1,"publisher":{"@id":"https:\/\/beta.iri.com\/blog\/#organization"},"image":{"@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage"},"thumbnailUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png","keywords":["Azure","Azure Key Vault","CLI","data protection","decryption","encryption","FieldShield","IRI business","IRI FieldShield"],"articleSection":["Data Masking\/Protection","IRI Business"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/","url":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/","name":"Securing FieldShield Passphrases in Azure Key Vault - IRI","isPartOf":{"@id":"https:\/\/beta.iri.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage"},"image":{"@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage"},"thumbnailUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png","datePublished":"2019-10-04T19:33:48+00:00","dateModified":"2019-10-04T21:17:55+00:00","description":"One of the primary uses of IRI FieldShield is to encrypt and decrypt sensitive data in database or flat-file columns. FieldShield relies on a passphrase","breadcrumb":{"@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#primaryimage","url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png","contentUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png","width":1600,"height":772},{"@type":"BreadcrumbList","@id":"https:\/\/beta.iri.com\/blog\/data-protection\/fieldshield-azure-key-vault\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/beta.iri.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Securing FieldShield Passphrases in Azure Key Vault"}]},{"@type":"WebSite","@id":"https:\/\/beta.iri.com\/blog\/#website","url":"https:\/\/beta.iri.com\/blog\/","name":"IRI","description":"Total Data Management Blog","publisher":{"@id":"https:\/\/beta.iri.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/beta.iri.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/beta.iri.com\/blog\/#organization","name":"IRI","url":"https:\/\/beta.iri.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","contentUrl":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/02\/iri-logo-total-data-management-small-1.png","width":750,"height":206,"caption":"IRI"},"image":{"@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/de972c035aaeecfc40a3ae2ea5ff7ba1","name":"Devon Kozenieski","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/beta.iri.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19bf36cedac5d586ea168f58f96eb2f1?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19bf36cedac5d586ea168f58f96eb2f1?s=96&d=blank&r=g","caption":"Devon Kozenieski"},"url":"https:\/\/beta.iri.com\/blog\/author\/devonk\/"}]}},"jetpack_featured_media_url":"https:\/\/beta.iri.com\/blog\/wp-content\/uploads\/2019\/10\/azure_vault.png","_links":{"self":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13213"}],"collection":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/comments?post=13213"}],"version-history":[{"count":15,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13213\/revisions"}],"predecessor-version":[{"id":13237,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/posts\/13213\/revisions\/13237"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/media\/13228"}],"wp:attachment":[{"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/media?parent=13213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/categories?post=13213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beta.iri.com\/blog\/wp-json\/wp\/v2\/tags?post=13213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}