Cloud API
Protector with a REST API on Azure.
This section describes the high-level architecture of Protegrity Cloud API, installation procedures, and performance guidance.
This section focuses on Protegrity specific aspects and should be consumed in conjunction with the corresponding Azure documentation.
This guide may also be used with the Protegrity Enterprise Security Administrator Guide, which explains the mechanism for managing the data security policy.
1 - Overview
Solution overview and features.
Solution Overview
Cloud API Protector on Azure is a cloud-native, serverless product for fine-grained data protection.
This enables the invocation of Protegrity data protection cryptographic methods in cloud-native serverless technology.
The benefits of serverless include rapid auto-scaling, performance, low administrative overhead, and reduced infrastructure
costs compared to a server-based solution.
This product provides a data protection API end-point for clients. The product is designed to scale elastically and
yield reliable query performance under extremely high concurrent loads. During idle use, the serverless product will
scale completely down, providing significant savings in Cloud compute fees.
Protegrity utilizes a data security policy maintained by an Enterprise Security Administrator (ESA), similar to other
Protegrity products. Using a simple REST API interface, authorized users can perform both de-identification (protect)
and re-identification (unprotect) operations on data. A user’s individual capabilities are subject to privileges and
policies defined by the Enterprise Security Administrator.
Analytics on Protected Data
Protegrity’s format and length preserving tokenization scheme make it possible to perform analytics directly on
protected data. Tokens are join-preserving so protected data can be joined across datasets. Often statistical analytics
and machine learning training can be performed without the need to re-identify protected data. However, a user or service
account with authorized security policy privileges may re-identify subsets of data using the Cloud API Protector on Azure
service.
Features
Cloud API Protector on Azure incorporates Protegrity’s patent-pending vaultless tokenization capabilities into
cloud-native serverless technology. Combined with an ESA security policy, the protector provides the following features:
- Role-based access control (RBAC) to protect and unprotect (re-identify) data depending on the user privileges.
- Policy enforcement features of other Protegrity application protectors.
For more information about the available protection options, such as, data types, Tokenization or Encryption types,
or length preserving and non-preserving tokens, refer to Protection Methods Reference.
2 - Architecture
Deployment architecture and connectivity
Deployment Architecture
Protegrity’s Cloud API on Azure should be deployed in the Customer’s Cloud account. The product incorporates Protegrity’s vaultless tokenization engine within an Azure Function App. The encrypted data security policy from an ESA is deployed periodically as a static resource through an Azure Blob Storage container. The policy is decrypted in memory at runtime within the Function App. This architecture allows Protegrity Serverless to be highly available and scale very quickly without direct dependency on any other Protegrity services.
The product exposes a remote data protection service. Each REST request includes a micro-batch of data to process and parameters such as operation and data element. The function applies the data security policy including user authorization and returns a corresponding response. Security operations on sensitive data performed by protector can be audited. The product can be configured to send audit logs to ESA via optional component called Log Forwarder.
The security policy is synchronized via another serverless component called the Protegrity Policy Agent. The agent operates on a configurable schedule, fetches policy from ESA, performs envelope encryption using Azure Key Vault, and deploys the policy into the Azure Blob Storage container which is accessed by Protector Function App. This solution can be configured to automatically provision the static policy or the final step can be performed on-demand by an administrator.
The following diagram shows the high-level architecture described above.

The following diagram shows a reference architecture for synchronizing the security policy from ESA.

The ESA is a soft appliance that must be pre-installed on a separate server. It is used to create and manage security policies.
For more information about installing the ESA, and creating and managing policies, refer to the Policy Management Section
Audit Log Forwarding Architecture
Audit logs are by default sent to Azure Blob Storage and Application Insights. The Cloud Protect product can also be configured to send audit logs to ESA. Such configuration requires deploying audit Log Forwarder component which is available as part of Cloud Protect deployment bundle. The diagram below shows additional resources deployed with Log Forwarder component.

The audit log forwarding solution includes Azure Event Hubs data-streaming service and an Azure Function App deployment called Log Forwarder. Protect function delivers audit logs to Azure Event Hub instance, Event Hub instance batches audit logs and delivers them to Log Forwarder function. Log Forwarder function then delivers audit logs to ESA. Audit log aggregation occurs on both Protect and Log Forwarder functions. Aggregation rules are described in the Understanding the log aggregation section. If Log Forwarder cannot deliver audit logs to ESA due to temporary ESA connection loss, it will send undelivered audit logs to a dead-letter queue Event Hub. Audit logs in dead-letter queue Event Hub can be re-delivered to ESA using another instance of Log Forwarder, which can be configured to run either manually or on schedule.
The security of audit logs is ensured by using HTTPS connection on each link of the communication between protector function and ESA. Integrity and authenticity of audit logs is additionally checked on Log Forwarder function which verifies individual logs signature. The signature verification is done upon arrival from Azure Event Hub before applying aggregation.
If signature cannot be verified, the log is forwarded as is to ESA where additional signature verification can be configured.
Log Forwarder function uses client certificate to authenticate calls to ESA.
To learn more about individual audit log entry structure and purpose of audit logs, refer to Audit Logging section. Installation instruction can be found in the Audit Log Forwarder Installation.
Forwarding of audit logs requires network access from the cloud to the ESA.
Access Control
The Cloud API utilizes access controls provided by the Azure Function service. The following mechanisms are available for controlling and restricting access to the Cloud API data protection endpoint:
- Azure role-based access control (Azure RBAC).
- Function access keys. Requests must include an API access key in the request.
- OpenID Connect. OpenID is a simple identity layer on top of the OAuth 2.0 protocol. Authorization is performed in the Protegrity Function App code.
For more information on Azure Function security concepts, refer to Azure documentation:
REST API Authentication and Authorization
The Rest API supports built-in authentication and authorization provided by Azure Function app. More information is available in the following Azure documentation:
App Service Authentication/Authorization Overview
REST API Policy Authorization
Once the request is authenticated and authorized by the Azure Function App, the Protegrity Cloud API performs the requested security operation based on the policy data element from the payload and the authenticated user.
3 - Installation
Product Installation Guide.
3.1 - Prerequisites
Requirements before installing the protector.
Azure Services
The following table describes the Azure services that may be part of your Protegrity installation.
All permissions in the table must be granted with the Resource group scope.
Service | Description |
|---|
Microsoft Entra ID Application | Allows authentication with Azure Function app |
Azure Managed Identity | Allows functions assume user-defined managed identity |
Function App | Provides serverless compute for Protegrity protection operations and ESA integration to fetch policy updates or deliver audit logs. |
API Management Service | Provides the end-point and access control |
Azure Key Vault | Provides cryptographic keys for envelope encryption/decryption of the policy. Stores secrets required during deployment, e.g., ESA credentials |
Blob storage | Intermediate storage location for the encrypted ESA policy package |
Application Insights | Application and audit logs, performance monitoring, and alerts |
Azure Event Hubs | Required if audit logs are to be sent to ESA. Set up and configuration of a new Event Hub is covered in section Audit Log Forwarder Installation. |
ESA Version Requirements
The Protector and Log Forwarder functions require a security policy from a compatible ESA version.
The table below shows compatibility between different Protector and ESA versions.
| Protector Version | ESA Version |
|---|
| 8.x | 9.0 | 9.1 & 9.2 | 10.0 |
|---|
| 2.x | No | Yes | * | No |
| 3.0.x & 3.1.x | No | No | Yes | No |
| 3.2.x | No | No | Yes | * |
| 4.0.x | No | No | No | Yes |
Legend |
|---|
Yes | Protector was designed to work with this ESA version |
No | Protector will not work with this ESA version |
* | Backward compatible policy download supported: - Data elements and features which are common between this and previous ESA versions will be downloaded
- Data elements and features which are new to this ESA version and do not exist in previous ESA version will not be downloaded
|
Prerequisites
Requirement | Detail |
|---|
Protegrity distribution and installation scripts | These artifacts are provided by Protegrity |
Protegrity ESA 10.0+ | The Cloud VNet must be able to obtain network access to the ESA |
Azure Account (Azure Global or US Government Subscription) | Recommend creating a new resource group for Protegrity. |
Required Skills and Abilities
Role / Skillset | Description |
|---|
Azure Account Administrator | Ability to run Azure Resource Manager (or perform steps manually), create/configure Entra ID Application Registrations |
Protegrity Administrator | The ESA credentials required to extract the policy for the Policy Agent |
Snowflake Administrator | Account Admin access required to setup Snowflake integration |
Network Administrator | Needed to open firewall to access ESA and evaluate Azure network setup |
Tip
During the installation you will need to record output of certain steps that will be used in downstream installation procedures. We recommend copying the following cheat sheet into a notepad and fill in the information as you progress with the installation.
Azure Subscription ID (AzureSubscriptionID): ____________________
Azure Resource Group ID (ApiResourceGroup): ___________________
Azure Region (ApiRegion): ___________________
Key Vault Name (PolicyKeyValue): ___________________
Storage Account Name (StorageAccountName): ___________________
Storage Account Blob Service Url (StorageAccountBlobServiceUrl): ___________________
Protect Function Blob URL (ProtectFuncURL): ___________________
Forward Function Blob URL (ForwardFuncURL): ___________________
Agent Function Blob URL (AgentFuncURL): ___________________
Protect Function Policy Blob URL (ProtectFuncPolicyBlobUrl): ____________________
Agent Policy Blob Container Name (AgentPolicyBlobContainer): ___________________
Entra ID Application Name (EntraIDApplicationName): ___________________
Entra ID Application ID (EntraIDApplicationID): ___________________
Protect Function User-Assigned Identity (ProtectFuncUserAssignedIdentity): ___________________
Protect Function Name (ProtectFuncName): __________________
Protect Function System-Assigned Identity (ProtectFuncSystemAssignedIdentity): __________________
Protect Function App Key (FuncAppKey): ___________________
Sample Policy Blob Url (SamplePolicyBlobUrl): ___________________
ESA Credentials function URL (EsaCredentialsFnUrl): ___________________
ESA Credentials function key (EsaCredentialsFnKey): ___________________
ESA Credentials function key secret name (EsaCredentialsFnKeySecretName): ___________________
ESA Credentials function Application ID URI (EsaCredentialsFnAppIdUri): ___________________
Forward Function User-Assigned Identity (ForwardFuncUserAssignedIdentity): ___________________
Forward Function Name (ForwardFuncName): __________________
Azure Tenant ID (AzureTenantID): ____________________
ESA IP Address (EsaIpAddress): ___________________
ESA CA Server Certificate (EsaCaCert): ___________________
ESA Username Secret Name (UserSecretName): ___________________
ESA Password Secret Name (PasswordSecretName): ___________________
ESA Client Certificate (EsaClientCert): ___________________
ESA Client Certificate Key Secret Name (EsaClientCertKeySecretName): ___________________
Policy Encryption Key ID (PolicyEncryptionKey): _________________
Agent Function User-Assigned Identity (AgentFuncUserAssignedIdentity): __________________
Agent Function Name (AgentFuncName): __________________
Event Hub Name (EventHubName): __________________
Event Hub Namespace (EventHubNamespace): __________________
3.2 - Pre-Configuration
Configuration steps prior product installation.
Resource Group
Identify or create a new Azure Resource Group where the Protegrity solution will be installed. It is recommended that a new Resource group is created. This can provide greater security controls and help avoid conflicts with other applications that might impact regional account limits. An individual with the Cloud Administrator role will be required for some of the subsequent installation steps.
Azure Subscription ID (AzureSubscriptionID): ____________________
Azure Resource Group ID (ApiResourceGroupID): ___________________
Azure Region (ApiRegion): ___________________
Key Vault
Key Vault is required to store secrets and encrypt policy deployment package. Identify existing Key Vault or create new.
To create Key Vault:
From the Azure Console select Create a resource.
Navigate to Key Vault > Create.
Select a Resource group.
Enter a Key vault name.
Select a Region. For the best performance, use the same region for all resources.
Set the Pricing tier to Standard.
Under Access configuration, select Vault access policy as the Permission model.
Under Networking, ensure that Enable public access is selected.
Under Review + create, click Create.
Record Key Vault Name:
Key Vault Name (PolicyKeyValue): ___________________
Function App Storage
Create Storage Account
Create a storage account to host Protegrity deployment packages provided in installation artifact bundle. Note that turning on the firewall or restricting access to selected virtual networks or IP address ranges will require additional configuration and is beyond the scope of this document.
To create Function App storage:
From the Azure Console select Create a resource.
Navigate to Storage account > Create.
Select the Resource group where the Protegrity solution will be deployed.
Enter a Storage account name.
Select the Region where the Protegrity solution will be deployed.
Set the Preferred storage type to Azure Blob Storage or Azure Data Lake Storage
Set the Primary workload to Cloud native
Setting for Performance should be set to Standard.
Setting for Redundancy should be set to Geo-redundant storage (GRS).
Continue to Advanced setup and verify Enable hierarchical namespace is unchecked
Warning
If Enable hierarchical namespace is checked, Policy Agent component will not be able to properly set the policy blob url, resulting in Protector error Policy is not availableAdjust the Networking and Data protection configurations according to your security requirements or use the default values.
Under Review + create, click Create.
Record the storage account name
Storage Account Name (StorageAccountName): ____________________
Record the storage blob service URL. Navigate to created Storage Account, select Settings, Endpoints, record the value of Blob Service
Storage Account Blob Service Url (StorageAccountBlobServiceUrl): ____________________
Upload Files
Create a deployment container using the Azure Blob Service.
Go Storage Account created in the previous step.
Under Data storage section, select Containers and click + Container .
Type in container name and click Create .
Upload the following installation artifacts to the container:
- protegrity-protect-azure-<version>.zip
- protegrity-agent-azure-<version>.zip
Important
The installation bundle you receive from Protegrity should be unzipped to reveal the files above. Only the files above need to be uploaded to the storage container. Do not unzip the three individual zip packages.Record Protect function blob URL:
Protect Function Blob URL (ProtectFuncURL): ____________________
Record Forward function blob URL. Both Protect and Forward functions use the same protegrity-protect-azure-<version>.zip distribution:
Forward Function Blob URL (ForwardFuncURL): ____________________
Record Agent function blob URL:
Agent Function Blob URL (AgentFuncURL): ____________________
Create Protect Function Policy Blob
Create a blob container for encrypted Protegrity security policy using Azure Blob Service. Agent will store encrypted policy in this container. Both Protect and Log Forwarder functions will load policy from this container.
Go Storage Account created in the previous step.
Under Data storage section, select Containers and click + Container .
Type in container name and click Create .
Right-click the container name, and select Container properties to obtain URL.
Append the name of the policy file to the container URL, e.g,
https://<your-storage-account>.blob.core.windows.net/<your-policy-container>/<your-policy-file-name>.zip.
Record the blob url.
Protect Function Policy Blob URL (ProtectFuncPolicyBlobUrl): ____________________
Create Agent Policy Blob Container
The Agent function uploads an encrypted policy zip package to a blob container which is used as a staging storage. Create the policy staging container
To prepare the policy blob container:
Under Storage account created in previous step, select Data storage > Containers and click + Container .
Type in a container name and click Create .
Agent Policy Blob Container Name (AgentPolicyBlobContainer): ___________________
3.3 - Protect Service Installation
Product Installation Guide.
Preparation
Ensure that all the steps in Pre-Configuration are performed.
Login to the Azure account console where Protegrity will be installed.
Ensure the Azure Resource Manager templates provided by Protegrity are available on your local computer.
Register an Entra ID App
A Microsoft Entra ID App provides the mechanism for Client to authenticate with the Function App instance. Creating an Entra ID app requires appropriate permissions to the Azure Subscription and is typically performed by the Azure Account Administrator.
To register an Entra ID App:
In the Azure portal navigate to Microsoft Entra ID.
Click + Add and select App registration.
Enter a Name and select Accounts in any organizational directory.
Leave the Redirect URI empty and select Register.
After registration is complete record the application name and application id displayed in the overview window.
Entra ID Application Name (EntraIDApplicationName): ___________________
Entra ID Application ID (EntraIDApplicationID): ___________________
Protect Function User-Assigned Managed Identity
User-assigned Azure managed identities are optional. If a user-assigned identity is not provided, a system-assigned managed identity will be enabled the function. User-assigned managed identities offer less frequent updates to Azure resources and allow for configuration of permissions ahead of function creation.
In the search box, enter Managed Identities. Under Services, select Managed Identities
Select Create
For Subscription provide recorded value of AzureSubscriptionID
For Resource Group provide recorded value of ApiResourceGroup
For Region provide recorded value of ApiRegion
For Name provide a name of the new identity
Assign following roles to this identity:
- Storage Blob Data Owner
- Monitoring Metrics Publisher
- Azure Event Hubs Data Sender: required only if function is sending logs to ESA
Record Protect function user-assigned identity
Protect Function User-Assigned Identity (ProtectFuncUserAssignedIdentity): ____________________
Install Protect Function via Azure Resource Manager
Resources created with the ARM template include API Management service, Function App, App Service Plan and Application Insights service.
To install protect function via Azure Resource Manager:
From Azure Console, select Create a resource, search for template then select Template deployment (deploy using custom templates) > Create.
Select Build your own template in the editor.
Click Load File and upload pty_protect_arm_v2.json, then click Save.
Select a Resource group.
Enter a Name for the resources. All resources will be prefixed with Protegrity-Protect except for log container which will be prefixed with ptylogs. For more information on naming rules see: Azure resource name rules.
For Location input specify Azure region name or leave default to deploy in the same region as resource group.
For Storage Account Blob Service Url Optionally use the value recorded in Create Storage Account. If value is not given, it will be automatically derived from Protect Function Blob Url.
For Protect Function Blob Url use the value from Upload Files.
For Function App Managed Identity Optionally use the value from Protect Function User-Assigned Managed Identity. If value is not given, a system-assigned managed identity will be enabled.
For Function Sku either EP1 or EP3 are recommended. Note that this will affect the running cost.
For Create Api Management Service select Do not create. API Management Service is required only for integration with Snowflake. This service is not required otherwise.
For Api Management Service Sku Applicable only when API Management Service is created. Skip this if API Management Service is not created. Either Consumption (if available) or Premium are recommended. Note that this will affect the running cost.
For Username Regex you can optionally specify regex to extract policy username from the request. See Configuring Regular Expression to Extract Policy Username for more details.
For Entra ID Application ID enter the value recorded in Register an Entra ID App.
For Forward Logs To ESA select whether audit logs are to be sent to ESA or not. If you are not planning on sending audit logs to ESA you can skip Event Hub Nameand Event Hub Namespace properties below. For details on creating and configuring Event Hubs see Audit Log Forwarder Installation
For Event Hub Name provide the name of Event Hub which will be used to send audit logs to ESA.
For Event Hub Namespace provide the name of Event Hub Namespace which is hosting Event Hub selected in previous step.
Under Review + create, click Create. Wait for all resources to deploy. If the deployment fails for any resources of type Microsoft.Web/sites/host/functionKeys then click Redeploy and try deploying again.
After deployment is complete, go to Outputs and record protectFunctionName, azureTenantId and apiGatewayUrl.
Protect Function Name (ProtectFuncName): __________________
Azure Tenant ID (AzureTenantID): __________________
API Gateway URL (ApiGatewayURL): __________________
Function System-Assigned Managed Identity
System-assigned Azure managed identity is enabled if user-assigned managed identity is not used. User-assigned managed identities offer less frequent updates to Azure resources and allow for configuration of permissions ahead of function creation.
If you have not created a user-assigned managed identity at Protect Function User-Assigned Managed Identity, setup following role assignments for system-assigned managed identity:
Navigate to the function
Select Settings, Identity.
Confirm Status of system-assigned identity is already On on System Assigned tab
Click on Azure role assignments button.
Assign following roles to this identity:
- Storage Blob Data Owner
- Monitoring Metrics Publisher
- Azure Event Hubs Data Sender: required only if function is sending logs to ESA
From Azure console, navigate to Function App and select protect function deployed in previous section.
Select Overview and click Restart button. Wait until function restart completes.
Update Key Vault Access Policies
The Key vault must be updated to allow the Function App to decrypt the policy files. Azure assigns a unique identifier to each Function App instance that can be used to grant permissions to that instance. Update the Key vault access policies with the Protect function. To update the key vault access policies:
Obtain Function App identifier
Navigate to the Function App service in the Azure portal.
Select the newly created Protect Function App instance.
Select the Identity option under Settings.
Ensure that setting System assigned is set to Status On.
Record the Object ID:
Protect Function Object ID: ___________________
Update the Key vault access policies with the Protect function’s Object ID
- From Azure console navigate to Key Vaults, select the Key Vault created in Key Vault.
- Select Access policies.
- Click Create.
- Select the following permissions in Permissions tab:
a. Get under Key Management Operations.
b. Unwrap Key under Cryptographic Operations.
c. Get under Secret Permissions.
- Proceed Next to Principal.
- Enter the Protect Function Object ID recorded in this section into the search field.
- Select the Function App instance.
- Proceed Next to Application and Next again to Review + Create.
- Review permissions and Create.
Upload the Sample Policy
The Protegrity installation bundle contains a sample policy which can be used to test the protect service installation without an ESA.
Upload the sample policy artifact to the policy Blob storage container:
Go to Azure console and select Storage Account Name (StorageAccountName) recorded in step Create Storage Account.
Under Data storage select Blob Containers and select container created in Protect Function Policy Blob Container
Click Upload and select protegrity-sample-policy-<version>.zip file from your local computer.
Click Upload and wait for the file to complete uploading.
Record the sample policy blob url:
Sample Policy Blob Url (SamplePolicyBlobUrl): ___________________
Test the Protect Function Installation
Before continuing with next steps, you may verify the protect service is installed correctly. This step is optional and can be skipped.
From Azure console, navigate to Function App and select protect function app.
Select Overview and record URL value as <Protect Function URL>.
Navigate to Settings > Environment variables and click OPENID_ENABLED.
Change value to false and click Apply.
Select or create variable AZURE_POLICY_BLOB_URL.
Set value of AZURE_POLICY_BLOB_URL to value recorded for SamplePolicyBlobUrl and click Apply.
Select Apply and Confirm to finalize setting changes.
Go to Functions > App keys and record the value of default key under Host Keys (All functions) as <Protect Function app key>.
Run the following CURL command to test Function deployment.
curl -X POST "<Protect Function URL>/api/v1/unprotect" -k \
-H 'x-functions-key: <Protect Function app key>' \
-H 'Content-Type: application/json' \
-d '{
"data": ["UtfVk UHgcD!"],
"user": "MARIA",
"data_element": "alpha"
}'
Note
When you copy-paste the curl command, make sure each header is in a separate line.Replace <Protect Function URL> and <Protect Function app key> with the values recorded in step 2 And 5.
Run curl command. Verify the following output.
{"data":["hello world!"], "success": true, "encoding": "utf8"}
Go back to Function app. Select Settings > Environment variables and click OPENID_ENABLED,
Change value to true and click Apply. Select Apply and Confirm to finalize.
Troubleshooting
To review live requests, navigate to Application Insights service and select item with the same name as the protect function. Under Investigate, select Live Metrics. Wait for the dashboard to load, then go to Sample Telemetry pane on the right and look for the requests in question.
To review the full history of requests from Application Insights under Monitoring select Logs:
- Select the Tables tab.
- Hover over one of the table names under Application Insights header, for example exceptions.
- Click on See preview data.
- Click Use in editor.
You can also run the query directly in the query editor. For instance to select the 10 latest exceptions run the following query.
exceptions
| where timestamp > ago(24h)
| order by timestamp
| limit 10
Protect Function App Configuration
Protect Function app can be customized using environment variables. From Azure console, navigate to Function App service and select protect function app. Navigate to Settings > Environment variables. Add or Edit environment variables based on the following information.
| Parameter | Description | Notes |
|---|
| OPENID_ENABLED | When set to true, every request is required to have an Authorization header with the bearer token set to a valid OAuth access token. | The following configuration attributes will also be required: OPENID_AUDIENCES, OPENID_ISSUERS, OPENID_METADATA_URL. |
| OPENID_AUDIENCES | The JWT token must have the “aud” claim and it must match one of the values in this attribute. Can be either one value or comma separated list. | applicable when OPENID_ENABLED= “true”. |
| OPENID_ISSUERS | The JWT token must have the “iss” claim and it must match one of the values in this attribute. Can be either one value or comma separated list. | applicable when OPENID_ENABLED= “true”. |
| OPENID_METADATA_URL | A URL that points to an OpenID Connect identity provider configuration document, which is also known as OpenID well-known configuration endpoint. | applicable when OPENID_ENABLED= “true”. |
| authorization | When equals “jwt”, Authorization Header JWT will be required in the Rest API Protect payload. | |
| Supported Values: [“jwt”, “”] | When equals to “jwt”, any request without Valid JWT in the Authorization header, will result in an error from API Gateway: 502 Bad Gateway. | |
| allow_assume_user | If set to 0, The user from the payload will not be used, and the policy user is the JWT user. | |
| Supported Values: [0, 1] | applicable when authorization = “jwt”. | |
| Default Value: 0 | | |
| jwt_user_claim | The JWT payload claim with username. Common claims: name, preferred_username, cognito:username | Applicable when authorization = “jwt” |
| Default Value: cognito:username | | |
| service_user | If service_user is set the protect request will use it for the policy user. | service_user should be used when the Cloud API should always run as one service_user no matter what user is in the request. service_user will always take priority over any other user in the payload or in the JWT header. |
| AZURE_POLICY_BLOB_URL | This points to Protegrity security policy blob. It is updated by the Agent to point to latest security policy. | |
| USERNAME_REGEX | If USERNAME_REGEX is set, the effective policy user will be extracted from the user in the request. | |
| EVENTHUB_NAME | Event Hub name where audit logs are to be sent to. Logs are not forwarded to ESA when this parameter is empty. | |
| EventHub__fullyQualifiedNamespace | Event Hub fully qualified namespace. Logs are not forwarded to ESA when this parameter is empty. | |
| PTY_CORE_FLUSHINTERVAL | Time interval in seconds used to accumulate audit logs before sending to Event Hub. Default value: 10. | Audit logs are always aggregated into one minute buckets. A value greater than 60 will influence only audit log batching while sending logs to Event Hub. A value less than 60 will influence both aggregation and audit log batching. |
| PTY_LOG_LEVEL | Function min log level. Default: Severe | One of case-insensitive strings: off, severe, warning, info, config, all. |
| PTY_WRITE_LOG_ON_SINGLE_LINE | Whether to write log level and message on one line or separate lines. Default: true | Starting from version 3.1.0, log level and message are printed on single line. Use this environment variable to switch to multi-line logging for backward compatibility with pre-3.1.0 release. |
| EVENT_LEVEL | Level of logs produced by Azure services. Default: Error | One of case-insensitive strings: LogAlways, Critical, Error, Warning, Informational, Verbose. Set to at least ‘Informational’ during initial configuration, set to at most ‘Error’ in production environments. |
Note
The following environment variables are listed for completeness, however they are maintained by Protegrity ARM templates and users are not expected to manually update them.| Parameter | Notes |
|---|
| AZURE_CLIENT_ID | Sets the Managed Identity Client ID for Function App runtime. System-Assigned Identity is used when variable is not set. |
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | Define identity for Application Insights access. Managed Identity Client ID is provided to this setting with Function App Managed Identity ARM template parameter. See the corresponding Azure AD Authentication documentation: Azure AD authentication |
| APPLICATIONINSIGHTS_CONNECTION_STRING | Connection String for Application Insights instance. See the corresponding Azure Connection String documentation: Connection strings |
| FUNCTIONS_EXTENSION_VERSION | Azure Functions extension version |
| FUNCTIONS_WORKER_RUNTIME | Runtime of the function |
| WEBSITE_RUN_FROM_PACKAGE | URL to the zip file in blob storage with function runtime source |
| WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID | Managed Identity used to load function runtime source |
| AzureWebJobsStorage__blobServiceUri | URL of the storage account which hosts the blob identified in WEBSITE_RUN_FROM_PACKAGE |
| AZURE_TENANT_ID | Tenant identifier in Azure Active Directory |
| AzureWebJobs.AuditLogForwarder.Disabled | Defines whether audit log forwarder function is disabled or not |
| AzureWebJobs.Protect.Disabled | Defines whether Protect function is disabled or not |
| AzureWebJobs.v1-openapi.Disabled | Defines whether v1-openapi function is disabled or not |
| AzureWebJobs.v1-protect.Disabled | Defines whether v1-protect function is disabled or not |
| AzureWebJobs.v1-unprotect.Disabled | Defines whether v1-unprotect function is disabled or not |
3.4 - Policy Agent Installation
Install the policy agent.
Policy Agent Function installation is done via Azure Resource Manager template provided by Protegrity. Before running the template, some resources must be created manually.
ESA Server
Policy Agent function requires ESA server running and accessible from Agent Function App on TCP port 8443. Make sure inbound connections on TCP:8443 are allowed for the network where ESA is hosted. You can find the list of Agent Function Outbound IP addresses after you deploy the function in Agent Function Outbound IP address
Note down ESA IP to be accessed form Agent Function:
ESA IP Address (EsaIpAddress): ___________________
Certificates on ESA
By default, ESA is configured with self-signed certificates, which can only be validated using self-signed CA certificate supplied in policy agent Cloud Function Environment variables configuration.
In case ESA is configured with publicly signed certificates, this section can be skipped since the agent function will use public CA to validate ESA certificates.
To obtain self-signed CA certificate from ESA:
Log in to ESA Web UI.
Select Settings > Network > Manage Certificates.
Hover over Server Certificate and click on download icon to download the CA certificate.
After certificate is downloaded, open the PEM file in text editor and replace all new lines with escaped new line: \n.
To escape new lines from command line, use one of the following commands depending on your operating system:
Linux Bash:
awk 'NF {printf "%s\\n",$0;}' ProtegrityCA.pem > output.txt
Windows PowerShell:
(Get-Content '.\ProtegrityCA.pem') -join '\n' | Set-Content 'output.txt'
Record the certificate content with new lines escaped.
ESA CA Server Certificate (EsaCaCert): ___________________
This value will be used to set PTY_ESA_CA_SERVER_CERT variable in the Policy Agent Function Configuration section Configure Function
For more information about ESA certificate management refer to Certificate Management Guide in ESA documentation.
Create Policy Encryption Key
Create a policy encryption key.
To create policy encryption key:
From Azure console, navigate to Key Vaults and select Key Vault created in Key Vault.
Under Objects, select Keys.
Click Generate/Import.
Specify the following:
a. Key name for the Name field.
b. RSA for Key type.
c. 2048 for RSA key size.
d. Set Enabled toggle to Yes.
Select Create.
Click on the key name after creation is complete, then click on the key identifier row under CURRENT VERSION.
Copy the full URL value of Key Identifier. Record it for later use:
Policy Encryption Key ID (PolicyEncryptionKey): _________________
Agent Function User-Assigned Managed Identity
User-assigned Azure managed identities are optional. If a user-assigned identity is not provided, a system-assigned managed identity will be enabled the function. User-assigned managed identities offer less frequent updates to Azure resources and allow for configuration of permissions ahead of function creation.
In the search box, enter Managed Identities. Under Services, select Managed Identities
Select Create
For Subscription provide recorded value of AzureSubscriptionID
For Resource Group provide recorded value of ApiResourceGroup
For Region provide recorded value of ApiRegion
For Name provide a name of the new identity
Assign following roles to this identity:
- Storage Blob Data Owner with scope Storage account
- Monitoring Metrics Publisher with scope Resource Group
- Website Contributor with scope Resource Group
Record Agent function user-assigned identity
Agent Function User-Assigned Identity (AgentFuncUserAssignedIdentity): ____________________
Install Agent via ARM template
Resources created with ARM template include Function App, Premium V3 App Service Plan (optional) and Application Insights service. Run Azure Resource Manager deployment.
To install Agent via ARM template:
From Azure Console, select Create a resource, search for template and then select Template deployment > Create.
Select Build your own template in editor.
Select Load File and upload pty_agent_arm_v2.json. Click Save.
Select Resource Group.
Specify Name for the resources (All resources will be prefixed with Protegrity-Agent).
For Location input specify Azure region name or leave default to deploy in the same region as resource group
For Agent Function Blob Url use the value from Upload Files
For Function App Managed Identity Optionally use the value from Agent Function User-Assigned Managed Identity. If value is not given, a system-assigned managed identity will be enabled.
If you set Use Existing App Service Plan to True, you must specify existing Linux App Service Plan name in the next parameter.
For Storage Account Blob Service Url Optionally use the value recorded in Create Storage Account. If value is not given, it will be automatically derived from Agent Function Blob Url.
Select Review + create then Create. Wait for all resources to deploy
After deployment is complete, go to Outputs and record agentFunctionName:
Agent Function Name: __________________
Function System-Assigned Managed Identity
System-assigned Azure managed identity is enabled if user-assigned managed identity is not used. User-assigned managed identities offer less frequent updates to Azure resources and allow for configuration of permissions ahead of function creation.
If you have not created a user-assigned managed identity at Agent Function User-Assigned Managed Identity, setup following role assignments for system-assigned managed identity:
Navigate to the function
Select Settings, Identity.
Confirm Status of system-assigned identity is already On on System Assigned tab
Click on Azure role assignments button.
Assign following roles to this identity:
- Storage Blob Data Owner with scope Storage account
- Monitoring Metrics Publisher with scope Resource Group
- Website Contributor with scope Resource Group
Creating ESA Credentials
Policy Agent Function requires ESA credentials to be provided as one of the two options:
Note
The username and password of the ESA user requires role with DPS Admin and Export Certificates permissions. Security Administrator is one of the predefined roles which contains the above permissions, however for separation of duties it is recommended to create custom role.ESA Credentials In Azure Key Vault
Policy Agent Function uses Key Vault as secure store for sensitive information like ESA username and password.
Create ESA credentials secrets:
Navigate to Key Vault.
Under Objects, select Secrets > Generate/import.
Select Manual, then type in valid json as shown in the example for Secret value.
{"username": "<policy_export_user>", "password": "<password>"}
Select Create.
Navigate to the secret details in Key Vault by selecting the newly created secret.
Inspect the current secret version properties by selecting the current version.
Copy the Secret Identifier value. For example https://<myvault>.vault.azure.net/secrets/<mysecret>/abcdefgxyz8edef595adaehij0d99123.
Record the Secret Identifier for later use.
ESA Credentials From Custom Azure Function App
Policy Agent Function requests ESA username and password from a custom Azure Function App, further referred to as ESA Credentials function. This method may be used to get the username and password from external vaults.
There are four options for configuring Policy Agent authorization with ESA Credentials function: Option 1, Option 2, Option 3 and Option 4. Only one option is expected to be configured at a time.
Create ESA credentials function:
Create Azure HTTP triggered ESA Credentials function using any supported runtime.
a. There is no input needed.
b. The function must accept an HTTP POST request.
c. The function must return the following response schema
```
response:
type: json object
properties:
username: string
password: string
```
For example,
```
{"username": "admin", "password": "Password1234"}
```
Configure Policy Agent to use ESA Credentials function app.
a. Navigate to HTTP triggered function to open ‘Code + Test’ page.
b. Under ‘Code + Test’ tab on ‘Code + Test’ page select ‘Resource JSON’.
c. In ‘Resource JSON’ blade record the value of ‘invoke_url_template’ property.
**'invoke_url_template'** property is located towards the bottom of resource json.
URL must be in the form of 'https://[function-app-name].azurewebsites.[net|us]/api/[http-trigger-name]'.
**ESA Credentials function URL (EsaCredentialsFnUrl):__________**
d. Navigate to Policy Agent function app.
e. Expand Settings menu item.
f. Select Environment Variables menu item.
g. Click Add button.
h. For Name use PTY_ESA_CREDENTIALS_FUNCTION.
i. For Value use ESA Credentials function URL (EsaCredentialsFnUrl) recorded in previous steps.
j. Hit Apply in Add/Edit application setting blade.
k. Hit Apply in App Settings tab.
Configure Authorization
Option 1: Function Key
Option 2: Key Vault
Option 3: System-assigned Identity
Option 4: User-assigned Identity
Warning
Function keys provide a good way for unwanted access mitigation during development and prototyping, however a better approach is to make authorization decisions based on identity. Review
Option 3 and
Option 4 below.
Configure HTTP trigger of ESA Credentials function with authentication level FUNCTION.
Review Azure documentation on how to accomplish this.
Navigate to ESA Credentials function app.
Expand Functions menu item.
Select App Keys.
Record default key value.
ESA Credentials function key (EsaCredentialsFnKey):_______________
Navigate to Policy Agent function app.
Expand Settings menu item.
Select Environment Variables menu item.
Click Add button.
For Name use PTY_ESA_CREDENTIALS_FUNCTION_KEY.
For Value use ESA Credentials function key (EsaCredentialsFnKey) recorded in previous steps.
Hit Apply in Add/Edit application setting blade.
Hit Apply in App Settings tab.
Warning
Function keys provide a good way for unwanted access mitigation during development and prototyping, however a better approach is to make authorization decisions based on identity. Review
Option 3 and
Option 4 below.
Configure HTTP trigger of ESA Credentials function with authentication level FUNCTION.
Review Azure documentation on how to accomplish this.
Navigate to ESA Credentials function app.
Expand Functions menu item.
Select App Keys.
Record default key value.
ESA Credentials function key (EsaCredentialsFnKey):_______________
Navigate to Key Vault.
Under Objects, select Secrets > Generate/import.
Select Manual, type in secret name and use ESA Credentials function key value recorded in previous steps (EsaCredentialsFnKey) for Secret value.
Select Create.
Record Key Vault secret name.
ESA Credentials function key secret name (EsaCredentialsFnKeySecretName):_______________
Navigate to Policy Agent function app.
Expand Settings menu item.
Select Environment Variables menu item.
Click Add button.
For Name use PTY_ESA_CREDENTIALS_FUNCTION_KEY_SECRET.
For Value use ESA Credentials function key secret name (EsaCredentialsFnKeySecretName) recorded in previous steps.
Hit Apply in Add/Edit application setting blade.
Hit Apply in App Settings tab.
Navigate to Policy Agent function app
Expand Settings menu item
Select Identity
Select System assigned tab
Status should already be On
Other Status indicates Policy Agent was installed without system-assigned identity. Before proceeding any further you need to either install Policy Agent with system-assigned identity or follow Option 4 which describes configuration steps for Policy Agent installed with user-assigned managed identity.
Copy Object (principal) ID
Navigate to ESA Credentials function app
Expand Settings menu item
Select Authentication
Select Add identity provider
Review related Microsoft documentation
Select Microsoft in identity provider dropdown
For App registration type provide details of your choice
For Issuer URL accept the default value
For Client application requirement select Allow requests from any application
Access will be limited to only the Policy Agent identity in the next step
For Identity requirement select Allow requests from specific identities
For Allowed identities add Object (principal) ID copied in previous step
For Restrict access select Require authentication
For Unauthenticated requests select HTTP 401 Unauthorized: recommended for APIs
Check Token store
Select Add
Click OK to apply constraint
Click Save
Navigate to Application of Microsoft identity provider
A link to identity providers application is available under Authentication menu item of ESA Credentials function
Expand Manage menu item
Select Expose an API
Copy Application ID URI or select Add if it does not exist and Save to accept the default value
Record Application ID URI of identity provider
ESA Credentials function Application ID URI (EsaCredentialsFnAppIdUri):_______________
Navigate to Policy Agent function app.
Expand Settings menu item.
Select Environment Variables menu item.
Click Add button.
For Name use PTY_ESA_CREDENTIALS_FUNCTION_SCOPE.
For Value use ESA Credentials function Application ID URI (EsaCredentialsFnAppIdUri) recorded in previous steps appended with /.default
Review Microsoft identity platform default scope
Hit Apply in Add/Edit application setting blade.
Hit Apply in App Settings tab.
Navigate to Policy Agent function app
Expand Settings menu item
Select Identity
Select User assigned tab
User-assigned identity should already be provided. Missing user-assigned identity indicates Policy Agent was installed without user-assigned identity. Before proceeding any further you need to either install Policy Agent with user-assigned identity or follow Option 3 which describes configuration steps for Policy Agent installed with system-assigned managed identity.
Copy Client ID
Copy Object (principal) ID
Navigate to ESA Credentials function app
Expand Settings menu item
Select Authentication
Select Add identity provider
Review related Microsoft documentation
Select Microsoft in identity provider dropdown
For App registration type provide details of your choice
For Issuer URL accept the default value
For Client application requirement select Allow requests from specific client applications
For Allowed client applications add Client ID copied in previous step
Click OK to apply constraint
For Identity requirement select Allow requests from specific identities
For Allowed identities add Object (principal) ID copied in previous step
Click OK to apply constraint
Click Save
Navigate to Application of Microsoft identity provider
A link to identity providers application is available under Authentication menu item of ESA Credentials function
Expand Manage menu item
Select Expose an API
Copy Application ID URI or select Add if it does not exist and Save to accept the default value
Record Application ID URI of identity provider
ESA Credentials function Application ID URI (EsaCredentialsFnAppIdUri):_______________
Navigate to Policy Agent function app.
Expand Settings menu item.
Select Environment Variables menu item.
Click Add button.
For Name use PTY_ESA_CREDENTIALS_FUNCTION_SCOPE.
For Value use ESA Credentials function Application ID URI (EsaCredentialsFnAppIdUri) recorded in previous steps appended with /.default
Review Microsoft identity platform default scope
Hit Apply in Add/Edit application setting blade.
Hit Apply in App Settings tab.
Agent Function Key Vault Access Policies
Agent Function requires access to Key Vault created in Key Vault to encrypt policy and to access configuration secrets.
- From Azure console navigate to Key Vaults, select the Key Vault created in Key Vault.
- Select Access policies.
- Click Create.
- Select the following permissions in Permissions tab:
a. Get under Key Management Operations.
b. Wrap Key under Cryptographic Operations.
c. Get under Secret Permissions.
- For Principal provide function identity
a. For functions with user-assigned identity enter identity recorded in step Agent Function User-Assigned Managed Identity
b. For functions with system-assigned identity enter function name recorded in step Install Agent via ARM template
- Proceed Next to Application and Next again to Review + Create.
- Review permissions and Create.
Agent Function Outbound IP address
Agent Function App IP addresses may be useful for configuring ESA policy store and allowing traffic between Agent and ESA.
Note
- Add IP addresses in the ESA network inbound port rules.
- Add the list of IPs to Policy data store in ESA
To obtain the list of Outbound IP addresses:
- From Azure console navigate to Function App, select the Agent Function App.
- Select Settings > Networking.
- Under Outbound traffic configuration, select Show More next to Outbound addresses
Agent Function must be configured with parameters recorded in steps above.
To configure Function:
Open Function App service from the Azure console. Select the Function App created for policy agent in previous steps.
Navigate to Settings > Environment variables .
On the App Settings pane, click on Show values to reveal all configuration values
To modify multiple parameters, click the pencil icon Advanced edit at the top. Alternatively you may click on the environment variable name to edit single values.
Modify parameters according to the table below. If configuration has a default value you don’t have to change it
Parameter | Notes |
|---|
AZURE_KEY_VAULT_NAME | Key Vault |
AZURE_POLICY_BLOB_URL | URL of the Azure Blob file which is used to store Protegrity security policies for protector consumption. See ProtectFuncPolicyBlobUrl in Protect Function Policy Blob |
AZURE_RETAIN_POLICY_BLOB | The amount of policy backups to retain. Default: 10. Allowed values: -1, >1. Value of -1 will disable cleanup of backup policies. |
PROTEGRITY_PROTECT_FUNCTION | Protegrity function to be updated when new policy is deployed. Provide a comma separated list of protect function app names for updating multiple protectors: Protegrity-Protect-func1,Protegrity-Protect-func2
|
PTY_ESA_IP | ESA Server |
AZURE_ESA_CREDENTIALS_SECRET_ID | ESA Credentials In Azure Key Vault |
AZURE_ENCRYPTION_KEY_ID | Create Policy Encryption Key |
PEP_CONFIG_CASE_SENSITIVE | Default: No Allowed values: yes/no Specifies whether policy usernames should be case sensitive |
PTY_ADDIPADDRESSHEADER | When enabled, agent will send its source IP address in the request header. This configuration works in conjunction with ESA hubcontroller configuration ASSIGN_DATASTORE_USING_NODE_IP (default=false). See Associating ESA Data Store With Cloud Protect Agent for more information. Default: yes Allowed values: yes no |
PEP_CONFIG_EMPTY_STRING | Default: empty Allowed values: null empty Determines outcome of empty value operation. For example, (un)protect(’’) -> null (un)protect(’’) -> |
DISABLE_DEPLOY | Default: 0 |
POLICY_PULL_TIMEOUT | Default: 20s |
ESA_CONNECTION_TIMEOUT | Default: 5s |
LOG_LEVEL | Default: INFO. Allowed values: DEBUG, INFO, WARNING, ERROR |
AZURE_SUBSCRIPTION_ID | Default: Same as ARM Resource group |
AZURE_RESOURCE_GROUP_NAME | Default: Same as ARM Resource group |
POLICY_DOWNLOAD_CRON_EXPRESSION | Describes how often Agent Function will run Default: 0 0 * * * * (Every hour) |
PTY_ESA_CA_SERVER_CERT | ESA self-signed CA certificate used by policy Agent function to ensure ESA is the trusted server. Recorded in step Certificates on ESA In case ESA is configured with publicly signed certificates, the PTY_ESA_CA_SERVER_CERT configuration will be ignored. |
PTY_ESA_CREDENTIALS_FUNCTION | Instead of supplying AZURE_ESA_CREDENTIALS_SECRET_ID environment variable, ESA credentials can be provided by a custom Azure Function App. Provide a value recorded for EsaCredentialsFnUrl |
PTY_ESA_CREDENTIALS_FUNCTION_KEY | When ESA credentials are provided by a custom Azure Function App, Policy Agent can request credentials using function app key. Provide a value recorded for EsaCredentialsFnKey |
PTY_ESA_CREDENTIALS_FUNCTION_KEY_SECRET | When ESA credentials are provided by a custom Azure Function App, Policy Agent can request credentials using function app key stored in Azure Key Vault. Provide a value recorded for EsaCredentialsFnKeySecretName |
PTY_ESA_CREDENTIALS_FUNCTION_SCOPE | When ESA credentials are provided by a custom Azure Function App, Policy Agent can request credentials using its own identity. Provide a value here recorded for EsaCredentialsFnAppIdUri appended with /.default to create authentication scope. Review Microsoft identity platform default scope |
PTY_SYNC_DATASTORE | NoteThis configuration is not applicable for ESA versions lower than 10.2.Name of the target datastore |
PTY_DATASTORE_KEY | NoteThis configuration is not applicable for ESA versions lower than 10.2.The export key is the public part of an asymmetric key pair created in a Create Policy Encryption Key.
A user with Security Officer permissions adds the public key to the data store in ESA via Policy Management > Data Stores > Export Keys.
The fingerprint can then be copied using the Copy Fingerprint icon next to the key.
Refer to Exporting Keys to Datastore for details. |
- Click Apply at the bottom of the screen and then Confirm to save the changes.
Note
The following environment variables are listed for completeness, however they are maintained by Protegrity ARM templates and users are not expected to manually update them.Parameter | Notes |
|---|
AZURE_CLIENT_ID | Sets the Managed Identity Client ID for Function App runtime. System-Assigned Identity is used when variable is not set. |
APPLICATIONINSIGHTS_AUTHENTICATION_STRING | Define identity for Application Insights access. Managed Identity Client ID is provided to this setting with Function App Managed Identity ARM template parameter. See the corresponding Azure AD Authentication documentation: Azure AD authentication |
APPLICATIONINSIGHTS_CONNECTION_STRING | Connection String for Application Insights instance. See the corresponding Azure Connection String documentation: Connection strings |
FUNCTIONS_EXTENSION_VERSION | Azure Functions extension version |
FUNCTIONS_WORKER_RUNTIME | Runtime of the function |
WEBSITE_RUN_FROM_PACKAGE | URL to the zip file in blob storage with function runtime source |
WEBSITE_RUN_FROM_PACKAGE_BLOB_MI_RESOURCE_ID | Managed Identity used to load function runtime source |
AzureWebJobsStorage__blobServiceUri | URL of the storage account which hosts the blob identified in WEBSITE_RUN_FROM_PACKAGE |
Test Agent Function Installation
After configuration is complete you can test the function.
To test Agent function installation:
Navigate to Overview.
Select the function agent from the Functions tab.
Click Code + Test > Test/Run and then Run to execute the function.
You should see a 202 Accepted response.
Expand Logs output at the bottom of the page. Click Maximize to enlarge log output.
Note
It may take 1-2 minutes for the logs to begin populating in the console. Logging in the console is best effort and it is possible for the logs to be cut off. Navigate to Application Insights for full logs.Below is an example log output from successful agent run.
INFO:AZURE_SUBSCRIPTION_ID: [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]
INFO:AZURE_KEY_VAULT_NAME: [vault-name]
INFO:AZURE_ENCRYPTION_KEY_ID: [https://vault-name.vault.azure.net/keys/key-name/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
INFO:AZURE_RESOURCE_GROUP_NAME: [resource-group-name]
INFO:AZURE_POLICY_BLOB_URL: [https://resource-group-name.blob.core.windows.net/policy/protegrity-policy-name.zip]
INFO:AZURE_RETAIN_POLICY_BLOB: [3]
INFO:PROTEGRITY_PROTECT_FUNCTION: [Protegrity-Protect-xxxx]
INFO:DISABLE_DEPLOY: [0]
INFO:PTY_ESA_IP: [xxx.xxx.xxx.xxx]
INFO:PTY_SYNC_DATASTORE: []
INFO:POLICY_PULL_TIMEOUT: [40]
INFO:LOG_LEVEL: [info]
INFO:PTY_CORE_EMPTYSTRING: [empty]
INFO:PTY_CORE_CASESENSITIVE: [no]
INFO:PTY_ADDIPADDRESSHEADER: [yes]
INFO:Starting policy agent [4.0.3] ...
INFO:ESA_CONNECTION_TIMEOUT: [60]
INFO:Using ESA CA certificate from PTY_ESA_CA_SERVER_CERT environment variable.
INFO:ResilientPackageClient initialized.
INFO:Retrieving ESA rps version
INFO:Resilient package correlation_id=[xxxxxxxxxxxxxxxxxxxxxxxxx] datastore=[]
INFO:RPS Version: 1.9.2, Build: 1.9.2+1.g4bfba.1.9
INFO:Checking ESA rps export availability
INFO:Resilient package correlation_id=[xxxxxxxxxxxxxxxxxxxxxxxxx] datastore=[QA_DATA_STORE]
INFO:Export available, Last-Modified: [Thu, 01 Jan 2026 00:00:00 GMT]
INFO:Getting current policy metadata [https://resource-group-name.blob.core.windows.net/policy/protegrity-policy-name.zip] ...
INFO:Last modified: [Thu, 01 Jan 2026 00:00:00 GMT], Last deployed: [Thu, 01 Jan 2026 00:00:00 GMT]
WARNING:Current policy deployment has no checksum_mapping metadata:
INFO:No changes in the policy since last download. Skipping policy deployment.
INFO:Checking container for the last deployed policy [https://resource-group-name.blob.core.windows.net/policy]...
INFO:[Protegrity-Protect-xxxx] current policy blob url: [https://resource-group-name.blob.core.windows.net/policy/2026-02-01_18-00-00/protegrity-policy-name.zip]
INFO:Policy blob in sync for function [Protegrity-Protect-xxxx]
INFO:[0] blobs are outside of the retention period [3]
If the log output in this window pauses or is difficult to read, you may navigate back to the Agent Function App overview and select Monitoring > Logs from the menu on the left. Run the query traces in the query editor to view logs.
Troubleshooting
To review the most recent invocation traces, navigate to the function app instance. Select Monitoring > Logs from the menu on the left. Run the query traces in the query editor to retrieve the full history of executions with detailed traces.
3.5 - Audit Log Forwarder Installation
Install the audit log forwarder.
The following sections provide installation steps for the Log Forwarder component in Azure.
The Log Forwarder deployment allows for the audit logs generated by Protect Service to be delivered to ESA for auditing and governance purposes.
Log Forwarder component is optional and is not required for the Protect Service to work properly.
See Audit Log Forwarder Architecture for more information. Some of the installation steps are not required for
the operation of the software but recommended for establishing a secure environment. Contact Protegrity for
further guidance on configuration alternatives in the cloud.
ESA Audit Store Configuration
ESA server is required as the recipient of audit logs. Verify the information below to ensure ESA is accessible and configured properly.
ESA server running and accessible on TCP port 9200 (Audit Store) or 24284 (td-agent).
Audit Store service is configured and running on ESA. Applies when audit logs are output to Audit Store directly or through td-agent. For information related to ESA Audit Store configuration, refer to Audit Store Guide.
(Optional) td-agent is configured for external input. For more information related to td-agent configuration, refer to ESA guide Sending logs to an external security information and event management (SIEM).
Certificates on ESA
By default, ESA is configured with self-signed certificates, which can only be validated using self-signed CA certificate supplied in Log Forwarder configuration.
In case ESA is configured with publicly signed certificates, this section can be skipped since the Log Forwarder will use public CA to validate ESA certificates.
To obtain self-signed CA certificate from ESA:
Download ESA CA certificate from the /etc/ksa/certificates/plug directory of the ESA
After certificate is downloaded, open the PEM file in text editor and replace all new lines with escaped new line: \n.
To escape new lines from command line, use one of the following commands depending on your operating system:
Linux Bash:
awk 'NF {printf "%s\\n",$0;}' CA.pem > output.txt
Windows PowerShell:
(Get-Content '.\CA.pem') -join '\n' | Set-Content 'output.txt'
Record the certificate content with new lines escaped.
ESA CA Server Certificate (EsaCaCert): ___________________
This value will be used to set PTY_ESA_CA_SERVER_CERT Log Forwarder variable in section Install Log Forwarder via ARM template
For more information about ESA certificate management refer to Certificate Management Guide in ESA documentation.
ESA Authentication
Audit Log Forwarder must authenticate with ESA using certificate-based authentication with client certificate and certificate key.
Download the following certificates from the /etc/ksa/certificates/plug directory of the ESA:
Both certificate and certificate key must be converted to single-line values using code similar to the following examples.
Client certificate (client.pem):
$folder = 'C:\Temp'
cd $folder
(Get-Content "$folder\client.pem") -join '\n' | Set-Content "$folder\one-liner-client.pem"
cat "$folder\one-liner-client.pem"
folder="/tmp"
cd "$folder"
awk 'NF {printf "%s\\n",$0}' "client.pem" > "one-liner-client.pem"
cat "one-liner-client.pem"
Client certificate key (client.key):
$folder = 'C:\Temp'
cd $folder
(Get-Content "$folder\client.key") -join '\n' | Set-Content "$folder\one-liner-client.key"
cat "$folder\one-liner-client.key"
folder="/tmp"
cd "$folder"
awk 'NF {printf "%s\\n",$0}' "client.key" > "one-liner-client.key"
cat "one-liner-client.key"
Note
Use single-line certificate and single-line certificate key values below when configuring Log Forwarder.There are two options to configure Log Forwarder for certificate authentication:
- While installing using ARM template
- Provide single-line client certificate for Esa Client Cert
- Provide Azure Key Vault secret name for Esa Client Cert Key Secret Name which stores single-line certificate key file.
- When re-configuring after installation using environment variables
- Provide single-line client certificate for ESA_CLIENT_CERT
- Provide Azure Key Vault secret name for ESA_CLIENT_CERT_KEY_SECRET_NAME which stores single-line certificate key file.
Create Key Vault Secrets
Log Forwarder uses Key Vault as a secure store for certificate key file.
Create secret in Key Vault for certificate key file:
Navigate to Key Vault.
Under Objects, select Secrets > Generate/import.
Select Manual, type in secret name and specify single-line certificate key file value for Secret value.
Select Create.
Record secret name:
ESA Client Cert Key Secret Name (EsaClientCertKeySecretName): ___________________
Function User-Assigned Managed Identity
User-assigned Azure managed identities are optional. If a user-assigned identity is not provided, a system-assigned managed identity will be enabled the function. User-assigned managed identities offer less frequent updates to Azure resources and allow for configuration of permissions ahead of function creation.
In the search box, enter Managed Identities. Under Services, select Managed Identities
Select Create
For Subscription provide recorded value of AzureSubscriptionID
For Resource Group provide recorded value of ApiResourceGroup
For Region provide recorded value of ApiRegion
For Name provide a name of the new identity
Assign following roles to this identity:
- Storage Blob Data Owner
- Monitoring Metrics Publisher
- Azure Event Hubs Data Receiver
Record Forward function user-assigned identity
Forward Function User-Assigned Identity (ForwardFuncUserAssignedIdentity): ____________________
Install Log Forwarder via ARM template
Resources created with ARM template include Function App, App Service Plan and Application Insights service. Optionally, a new Event Hub namespace and Event Hub instance can be created.
To install Log Forwarder via ARM template:
From Azure Console, select Create a resource, search for template and then select Template deployment > Create.
Select Build your own template in editor.
Select Load File and upload pty_forward_arm_v2.json. Click Save.
Select Resource Group.
Specify Name for the resources (All resources will be prefixed with Protegrity-Forward).
For Location input specify Azure region name or leave default to deploy in the same region as resource group
For Storage Account Blob Service Url Optionally use the value recorded in Create Storage Account. If value is not given, it will be automatically derived from Forward Function Blob Url.
For Forward Function Blob Url use the value from Upload Files.
For Function Sku either EP1 or EP3 are recommended. Note that this will affect the running cost.
For Function Sku Count Minimum number of workers to keep active.
For WorkSpace Sku Azure Monitor log analytics pricing plan. See Azure Monitor Pricing tiers documentation for details: Azure Monitor Pricing
For Log Retention In Days The workSpace data retention in days. Allowed values are per pricing plan. See Azure Monitor Pricing tiers documentation for details: Azure Monitor Pricing
For Forward Logs to ESA select whether to collect audit logs from a new or an existing Event Hub. A new Event Hub namespace and new Event Hub instance will be created for ‘From new Event Hub’ option.
For Audit Log Output select whether to send logs directly to Audit Store or td-agent on ESA
For Event Hub Namespace enter Event Hub namespace name. Depending on previous option, a new namespace with this name will be created or an existing namespace with this name will be used.
For New Event Hub Namespace Sku Name select Event Hub namespace SKU name. Applicable only when ‘From new Event Hub’ is selected.
For New Event Hub Namespace Sku Tier select Event Hub namespace SKU Tier used for new Event Hub namespace. Applicable only when ‘From new Event Hub’ is selected.
For New Event Hub Namespace Sku Capacity enter a value of Event Hub throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. Applicable only when ‘From new Event Hub’ is selected.
For Event Hub Name enter Event Hub instance name. A new Event Hub instance with this name will be created or an existing Event Hub instance with this name will be used.
For Event Hub Name DLQ enter Event Hub name for the dead-letter queue, where messages will be delivered to in case connection to ESA is lost. A new Event Hub instance with this name will be created or an existing Event Hub with this name will be used.
For New Event Hub Partition Count enter number of partitions to create in a new Event Hub. Allowed values are from 1 to 32 partitions. Applicable only when ‘From new Event Hub’ is selected.
For New Event Hub Audit Log Retention In Days enter number of days audit logs will be available in Event Hub. Applies to both primary Event Hub and dead-letter queue Event Hub. Applicable only when ‘From new Event Hub’ is selected.
For Log Destination Esa Ip enter ESA IP address.
For Esa Client Cert enter single-line ESA client certificate. See section Certificate Authentication for details.
For Esa Client Cert Key Secret Name enter secret name which stores ESA client certificate single-line private key. See section Certificate Authentication for details.
For Key Vault Uri enter URI of the Key Vault that stores ESA username/password secrets.
For Esa Tls Disable Cert Verify Set to ‘0’ to enable ESA certificate validation. Set to ‘1’ to disable ESA certificate verification. Disable only for initial setup and development purposes, do not disable in production environments.
If ESA is configured with self-signed certificate, set Pty Esa Ca Server Cert. Use the ESA CA Server Certificate escaped content recorded in Certificates on ESA.
Note that for development and troubleshooting purposes, ESA certificate validation can be disabled by either redeploying this function with this ARM template where Esa Tls Disable Cert Verify option is set to ‘1’ or by directly setting PTY_ESA_DISABLE_TLS_CERT_VERIFY environment variable to ‘1’.
For Esa Connect Timeout set time in seconds to wait for the ESA connection response. Minimum value: 1. Default: 5.
For Esa Virtual Host provide ESA virtual hostname. This configuration is optional. It can be used when proxy server is present and supports TLS SNI extension.
For Min Log Level select minimum log level. Accepted values: off, severe, warning, info, config, all
Select Review + create then Create. Wait for all resources to deploy
After deployment is complete:
Go to Outputs and record:
Forward Function Name (ForwardFuncName):__________________
Record:
Event Hub Name (EventHubName):__________________
Event Hub Namespace (EventHubNamespace):__________________
Function System-Assigned Managed Identity
System-assigned Azure managed identity is enabled if user-assigned managed identity is not used. User-assigned managed identities offer less frequent updates to Azure resources and allow for configuration of permissions ahead of function creation.
If you have not created a user-assigned managed identity at Function User-Assigned Managed Identity, setup following role assignments for system-assigned managed identity:
Navigate to the function
Select Settings, Identity.
Confirm Status of system-assigned identity is already On on System Assigned tab
Click on Azure role assignments button.
Assign following roles to this identity:
- Storage Blob Data Owner
- Monitoring Metrics Publisher
- Azure Event Hubs Data Receiver
From Azure console, navigate to Function App and select audit log forwarder function deployed in previous section.
Select Overview and click Restart button. Wait until function restart completes.
Update Function Key Vault Access Policies
The Key vault must be updated to allow the Function App to decrypt the policy files. The Forwarder is using policy to confirm the authenticity of audit logs it receives from Event Hub and to digitally sign the aggregated logs that it sends to ESA. Update the Key vault access policies with function identity. To update the key vault access policies:
- From Azure console navigate to Key Vaults, select the Key Vault created in Key Vault.
- Select Access policies.
- Click Create.
- Select the following permissions in Permissions tab:
a. Get under Key Management Operations.
b. Unwrap Key under Cryptographic Operations.
c. Get under Secret Permissions.
- Proceed Next to Principal.
- For Principal provide function identity
a. For functions with user-assigned identity enter identity recorded in step Function User-Assigned Managed Identity
b. For functions with system-assigned identity enter function name recorded in step Install Log Forwarder via ARM template
- Proceed Next to Application and Next again to Review + Create.
- Review permissions and Create.
Test Log Forwarder Installation
Follow the steps to validate Log Forwarder installation. Successful Log Forwarder installation will aggregate logs, connect to ESA and send audit log events.
Testing in this section validates the connectivity between Log Forwarder and ESA. The sample policy included with the initial installation and test event below are not based on your ESA policy. Any logs forwarded to ESA which are not signed with a policy generated by your ESA will not be added to the audit store.
Install Log Forwarder and configure according to previous sections. Log Forwarder configuration MinLogLevel must be at least info level.
In the following command, replace ‘forwarder-function-name’ with your function name
In the following command, replace ‘forwarder-function-key’ with your function key
Run the command in PowerShell:
$forwarderFunctionName='forwarder-function-name'
$forwarderFunctionKey='forwarder-function-key'
Invoke-WebRequest -UseBasicParsing -Uri "https://$forwarderFunctionName.azurewebsites.net/admin/functions/auditlogforwarder" `
-Method POST `
-Headers @{
"x-functions-key" = $forwarderFunctionKey
} `
-ContentType "application/json" `
-Body "{`"input`":`"{\`"additional_info\`":{\`"description\`":\`"Data unprotect operation was successful.\`",\`"request_id\`":\`"f0ffbbf8-ab5b-42b7-90f4-51db7443af77\`"},\`"cnt\`": 1,\`"correlationid\`": \`"clfwrqgme0021nj329mijk52w\`",\`"logtype\`": \`"Protection\`",\`"level\`": \`"SUCCESS\`",\`"origin\`": { \`"hostname\`": \`"169.254.197.189\`", \`"ip\`": \`"169.254.197.189\`", \`"time_utc\`": 1722941687},\`"protection\`": {\`"dataelement\`": \`"alpha\`", \`"operation\`": \`"Unprotect\`",\`"audit_code\`": 8,\`"policy_user\`": \`"test_user\`",\`"datastore\`": \`"SAMPLE_POLICY\`"},\`"process\`": { \`"name\`": \`"N/A\`", \`"id\`": \`"15\`",\`"thread_id\`": \`"2243954624\`",\`"user\`": \`"sbx_user1051\`", \`"platform\`": \`"Linux_x32\`"},\`"client\`": {\`"username\`":\`"sbx_user1051\`",\`"ip\`":\`"169.254.197.189\`"},\`"protector\`": {\`"family\`": \`"IAP Lambda\`",\`"version\`": \`"3.1.0\`",\`"vendor\`": \`"Cloud Protect\`",\`"pcc_version\`": \`"3.5.0.1\`", \`"core_version\`": \`"2.0.1\`"},\`"signature\`": { \`"key_id\`":\`"5f143892-bbe4-4794-b1f4-ed28ca2a077e\`", \`"checksum\`": \`"90BC9BF39354869BD4BC5381820D201797DF4AF53B5A7F5F3AE01EC607C41A6E\`"}}`"}"
Note
For Cloud API on Azure Government Cloud use the following URL: https://$forwarderFunctionName.azurewebsites.us/admin/functions/auditlogforwarderNote
The
Body content is a sample audit log. See
Audit Logging for detail on audit log contents.
Run following query to see your function logs, allow for a few minutes for Azure to deliver the logs
traces
| project timestamp, message
| where timestamp > ago(5m)
Test is successful if the logs contain the following entry:
opensearch.0: All logs successfully send to destination
If the log entry is not present, please consult the Troubleshooting section for common errors and solutions.
Update Protect Service With Event Hub details
In this section, Event Hub details will be provided to the Protect Service installation.
Note
If the Protect function has not been installed yet, you may provide the ‘Event Hub Name’, ‘Event Hub Namespace’ during Protect Service installation and skip the remainder of this section.Navigate to the Protect function environment variables.
Set EVENTHUB_NAME to the output value recorded in Install Log Forwarder via ARM template.
Set EventHub__fullyQualifiedNamespace to the output value recorded in Install Log Forwarder via ARM template.
Apply and Confirm to apply the changes.
Update Policy Agent With Log Forwarder Function Target
Log Forwarder requires a Protegrity policy which is in sync with the Protector Service. This section will describe the steps to update the Policy Agent to include updating the Log Forwarder.
Note
If the Policy Agent has not been installed, follow the steps in
Install Agent via ARM template. Set
PROTEGRITY_PROTECT_FUNCTION to include both Protect Service function and Log Forwarder function.
Navigate to the Policy Agent function created in Install Agent via ARM template
Select Settings > Environment variables > PROTEGRITY_PROTECT_FUNCTION
Edit the value for environment variable PROTEGRITY_PROTECT_FUNCTION to include the Log Forwarder function’s name in the comma separated list of function names.
Select Apply > Apply > Confirm to save the changes
Test Policy Agent installation as described in Test Agent Function Installation
Test Full Log Forwarder Installation
- Install and configure Protegrity Agent, Protect Service and Log Forwarder components.
- Set EVENT_LEVEL environment variable on Protect Service function to Informational.
- Set PTY_LOG_LEVEL environment variable on both Protect Service function and Log Forwarder function to config.
Test Installation
Make a protect operation using a data element or user which will result in audit log generation
Navigate to the Logs for the Protect Service function
Execute ’traces’ query
Expect to see a log similar to the below:
Completed publishing events for Event Hub: audit-logs (Partition Id/Key: '0'), Operation Id: 'e17bacd6-91e6-4fb5-8281-2929788bef09'. Service Retry Count: 0; Duration: '0.02' seconds
Navigate to the Logs for the Log Forwarder function
Execute ’traces’ query
Expect to see a log similar to the below:
opensearch.0: All logs successfully send to destination
Troubleshooting
Configure additional logging for functions:
- Set EVENT_LEVEL environment variable on Protect function to Informational.
- Set PTY_LOG_LEVEL environment variable on both Protect function and Log Forwarder function to config.
Error | Detail |
|---|
Unhandled exception. System.Exception: Failed to initialize
function type,expecting environment variable
'AzureWebJobs.AuditLogForwarder.Disabled'
to be set to either 'true' or 'false'
| - An environment variable ‘AzureWebJobs.AuditLogForwarder.Disabled’ is expected. This environment variable is added automatically when functions are deployed with ARM templates.
- Verify this environment variable exists and is set to ’true’ for Protect Service functions and is set to ‘false’ for Log Forwarder functions.
|
[2024/08/08 10:00:00] [error] [tls] error: unexpected EOF
| Log Forwarder failed to verify ESA certificate - If ESA is configured with self-signed certificate, verify that Log Forwarder ‘PTY_ESA_CA_SERVER_CERT’ is correctly set to ESA CA certificate string. Refer to Certificates on ESA for details.
- If ESA is configured with publicly signed certificate, ensure Log Forwarder ‘PTY_LOG_LEVEL’ is set to ‘all’ level, restart and re-test the Log Forwarder. Review the logs to see if your root CA is used. If not used, you may supply your public CA in Log forwarder configuration ‘PTY_ESA_CA_SERVER_CERT’.
- During initial non-production setup, SSL verification can be disabled by setting ‘PTY_ESA_DISABLE_TLS_CERT_VERIFY’ environment variable to ‘1’ or ’true’
|
Failed to aggregate audit logs, 1 audit logs dropped, error:
The user, group or application 'appid=;oid=;iss=' does not have
secrets get permission on key vault ';location='...
Status: 403 (Forbidden)
ErrorCode: Forbidden
| Log Forwarder has no permissions to use Key Vault - Verify Log Forwarder has access to the Key Vault.
- Consult section Update Function Key Vault Access Policies
|
TCP connection timed out: 001.001.001.001:9200
| Log Forwarder failed to connect to ESA - Ensure ESA is available on given IP address and 9200 port
- Consult section ESA Audit Store Configuration
|
fail: Protect.Aggregate[0] Failed to aggregate audit logs,
1 audit logs dropped, error: Invalid URI: The format of the URI
could not be determined.
info: iap[0] Shared memory segment POLICY does not exist: The
system cannot find the file specified.
| Invalid Key Vault Uri format - Ensure that environment variable KEY_VAULT_URI has correctly formatted url.
- Example 1: https://<keyvaultname>.vault.azure.net/
- Example 2: https://<keyvaultname>.vault.usgovcloudapi.net/
|
[Error] Azure-Messaging-EventHubs: An exception occurred while
publishing a batch of events for buffered producer instance with
identifier 'x' to Event Hub: audit-logs, Partition Id: '0',
Operation Id: 'x'. Error Message: 'Unauthorized access.
| Protect Service function failed to send messages to Event Hub - Ensure Forwarder Function managed identity has ‘Azure Event Hubs Data Sender’ role assigned for the Event Hub resource.
- See Function User-Assigned Managed Identity and Function System-Assigned Managed Identity
|
3.6 -
Prerequisites
| Requirement | Detail |
|---|
| Protegrity distribution and installation scripts | These artifacts are provided by Protegrity |
| Protegrity ESA 10.0+ | The Cloud VNet must be able to obtain network access to the ESA |
| Azure Account (Azure Global or US Government Subscription) | Recommend creating a new resource group for Protegrity. |
3.7 -
Required Skills and Abilities
Role / Skillset | Description |
|---|
Azure Account Administrator | Ability to run Azure Resource Manager (or perform steps manually), create/configure Entra ID Application Registrations |
Protegrity Administrator | The ESA credentials required to extract the policy for the Policy Agent |
Network Administrator | Needed to open firewall to access ESA and evaluate Azure network setup |
Tip
During the installation you will need to record output of certain steps that will be used in downstream installation procedures. We recommend copying the following cheat sheet into a notepad and fill in the information as you progress with the installation.
Azure Subscription ID (AzureSubscriptionID): ____________________
Azure Resource Group ID (ApiResourceGroup): ___________________
Azure Region (ApiRegion): ___________________
Key Vault Name (PolicyKeyValue): ___________________
Storage Account Name (StorageAccountName): ___________________
Storage Account Blob Service Url (StorageAccountBlobServiceUrl): ___________________
Protect Function Blob URL (ProtectFuncURL): ___________________
Forward Function Blob URL (ForwardFuncURL): ___________________
Agent Function Blob URL (AgentFuncURL): ___________________
Protect Function Policy Blob URL (ProtectFuncPolicyBlobUrl): ____________________
Agent Policy Blob Container Name (AgentPolicyBlobContainer): ___________________
Entra ID Application Name (EntraIDApplicationName): ___________________
Entra ID Application ID (EntraIDApplicationID): ___________________
Protect Function User-Assigned Identity (ProtectFuncUserAssignedIdentity): ___________________
Protect Function Name (ProtectFuncName): __________________
Protect Function System-Assigned Identity (ProtectFuncSystemAssignedIdentity): __________________
Protect Function App Key (FuncAppKey): ___________________
Sample Policy Blob Url (SamplePolicyBlobUrl): ___________________
ESA Credentials function URL (EsaCredentialsFnUrl): ___________________
ESA Credentials function key (EsaCredentialsFnKey): ___________________
ESA Credentials function key secret name (EsaCredentialsFnKeySecretName): ___________________
ESA Credentials function Application ID URI (EsaCredentialsFnAppIdUri): ___________________
Forward Function User-Assigned Identity (ForwardFuncUserAssignedIdentity): ___________________
Forward Function Name (ForwardFuncName): __________________
Azure Tenant ID (AzureTenantID): ____________________
ESA IP Address (EsaIpAddress): ___________________
ESA CA Server Certificate (EsaCaCert): ___________________
ESA Username Secret Name (UserSecretName): ___________________
ESA Password Secret Name (PasswordSecretName): ___________________
ESA Client Certificate (EsaClientCert): ___________________
ESA Client Certificate Key Secret Name (EsaClientCertKeySecretName): ___________________
Policy Encryption Key ID (PolicyEncryptionKey): _________________
Agent Function User-Assigned Identity (AgentFuncUserAssignedIdentity): __________________
Agent Function Name (AgentFuncName): __________________
Event Hub Name (EventHubName): __________________
Event Hub Namespace (EventHubNamespace): __________________
3.8 -
4 - REST API
Reference for Cloud API authorization and specification
REST API
The following sections describe key concepts for understanding the REST API.
Base URL:
https://{ProtectFuncName}.azurewebsites.net/api
Substitute the Protect function name recorded during the Protect function installation.
Note
For Cloud API on Azure Government Cloud use the following URL:
https://{ProtectFuncName}.azurewebsites.us/api
4.1 - Export an OpenAPI Spec
Exporting OpenAPI Spec from Azure Function App
Export an OpenAPI Spec
Once the Cloud API on Azure is installed, you can export the OpenAPI documentation file from:
https://{ProtectFuncName}.azurewebsites.net/api/v1/openapi
Authentication and functions key are required to get the URL.
Note
For Cloud API on Azure Government Cloud use the following URL:
https://{ProtectFuncName}.azurewebsites.us/api/v1/openapi
Tip
Go to the Function App instance on the Azure portal, on the left menu choose Functions under Functions section, click on v1-openapi and press Get Function URL.For testing the REST API, we recommend using a client tool, such as Postman.
4.2 - Payload Encoding
Describes the request/response payload encoding
Payload Encoding
The following encoding formats are supported in the REST API.
For every encoding, the resultant protected data is returned in the same encoding. For example, if request is hex-encoded, the response is also hex-encoded.
For more information about the encoding formats, refer to the Protection Methods Reference.
Encoding | Supported by data elements | Notes |
|---|
utf8 | All except binary data elements. | Default encoding if encoding is not specified. |
hex | All | Default encoding for binary data elements. |
base64 | All | |
base64_mime | All | - Uses RFC 2045 Alphabet.
- Accepts input on multiple lines.
- Lines can be separated by any combination of CR and LF characters.
- Lines must not be longer than 76 characters long.
- Response lines are separated by CRLF characters.
- Optional padding.
- Does not accept any non-base64 characters.
|
base64_pem | All | - Uses RFC 1421 Alphabet.
- Accepts input on multiple lines.
- Lines can be separated by any combination of CR and LF characters.
- Lines must not be longer than 64 characters long.
- Response lines are separated by CRLF characters.
- Optional padding.
- Does not accept any non-base64 characters.
|
base64_url | All | |
The following sections provide the payload schema and its examples.
4.3 - v1 Specification
Describes the v1 REST API specification
Request
AWS Lambda service limits maximum size of payload to 6 MB. Client applications of Protegrity Cloud API must ensure their payload size is within this limit. This applies to all types of requests described below.
Performs a policy operation such as protect, unprotect, or reprotect.
URI
/v1/protect or /v1/unprotect or /v1/reprotect
Method
POST
Parameters
data: Input data to the policy operation.
data_element: Data element to use for the policy operation.
encoding: Optional, encoding of the data. One of: base64, base64_mime, base64_pem, base64_url, hex, or utf8. Defaults to hex for binary data elements, otherwise defaults to utf8.
external_iv: Optional, external initialization vector.
old_data_element: (reprotect) Data element for unprotecting the input.
old_external_iv: (reprotect) Optional, external initialization vector for the input.
query_id: Optional, identifier for the request.
user: User performing the operation.
Result
Returns the output of the policy operation.
Example 1 - without external IV
{
"encoding": "utf8",
"query_id": "1",
"user": "user1",
"data_element": "Alphanum",
"data":[<data1>,<data2>]
}
Example 2 - with external IV
{
"encoding": "utf8",
"query_id": "1",
"user": "user1",
"data_element": "Alphanum",
"external_iv": "abc123",
"data":[<data1>,<data2>]
}
Example 3 - reprotect
{
"encoding": "utf8",
"query_id": "1",
"user": "user1",
"data_element": "deName",
"old_data_element": "Alphanum",
"data":[<data1>,<data2>]
}
Performs policy operations using different data elements for each data set.
URI
/v1/protect or /v1/unprotect or /v1/reprotect
Method
POST
Parameters
encoding: Optional, encoding of the data. One of: base64, base64_mime, base64_pem, base64_url, hex, or utf8. Defaults to hex for binary data elements, otherwise defaults to utf8.
query_id: Optional, prefix for the request identifier.
user: User performing the operation.
arguments[].data: Input data to the policy operation.
arguments[].data_element: Data element to use for the policy operation.
arguments[].external_iv: Optional, external initialization vector.
arguments[].id: Optional, request identifier.
arguments[].old_data_element: (reprotect) Data element for unprotecting the input.
arguments[].old_external_iv: (reprotect) Optional, external initialization vector for the input.
Note
When multiple data elements are sent in the payload, the Cloud API generates an audit log per argument. The Cloud API appends the argument id, if it exists, to the query_id. For example: query_id.id:{id}. If an argument id is not provided then the index in the argument array is appended to the query_id. For example: query_id.index:{index}.Example 4 - multiple data elements support payload
{
"encoding": "utf8",
"query_id": "query1234",
"user": <policy_user>,
"arguments": [
{
"id": "1",
"external_iv": "<external iv>",
"data_element": "<data element name>",
"data":["<data1>","<data2>"]
},
{
"data_element": <data element name>,
"data":["<data1>","<data2>"]
}
]
}
External IV
The External IV feature provides an additional level of security by allowing different tokenized results across protectors for the same input data and token element, depending on the External IV set on each protector. External IVs must adhere to certain guardrails and not all data elements support External IV. To read more about the Tokenization model with External IV, refer to the External Initialization Vector (IV) chapter in the Protection Methods Reference.
Response
responsePayloadV1:
type: object
properties:
success:
type: bool
error_msg:
type: string
description: When success is false, error_msg is included
results:
type: array
items:
type: string
Example success:
{
"encoding": "utf8",
"results":["str1","str2"],
"success": true
}
If the request was successful, the success flag will always be true.
Example failure:
{
"error_msg": "token expired",
"success": false
}
If the request fails, the success flag will always be false.
Multi Data Elements Support Payload
responsePayloadV2:
type: object
properties:
success:
type: boolean
results:
type: array
items:
type: object
properties:
success:
type: bool
error_msg:
type: string
description: When success is false, error_msg is included
id:
type: string
description: When id is sent in the request payload, id is included in the response
results:
type: array
items:
type: string
Example success:
{
"encoding": "utf8",
"results":[
{
"encoding": "utf8",
"results":["str1","str2"],
"success": true
},
{
"encoding": "utf8",
"results":["str1","str2"],
"success": true
}
],
"success": true
}
If the all the subrequests were successful, the success flag will be true.
Example failure:
{
"results": [
{
"error_msg":
"Protect failed. Data element not found. Refer to audit log for details",
"success": false
},
{
"encoding": "utf8",
"results":["str1","str2"],
"success": true
}
],
"success": false
}
It is possible to have a mix of successful and unsuccessful results. In this case, the global success flag will be false.
4.4 - Legacy Specification
Describes the Legacy REST API specification
Protegrity has multiple products with REST API capabilities, such as Protection Server (out of support), DSG, and the latest product - IAP REST. Each one has its use case. To help you move to cloud-native implementation, Cloud Product REST API supports legacy payload.
Request
Performs a policy operation such as protect, unprotect, or reprotect.
Method
POST
Parameters
dataelementname: (protect/unprotect) Data element to use for the policy operation.
externaliv: (protect/unprotect) Optional, external initialization vector.
newdataelementname: (reprotect) Data element to use for the output.
newexternaliv: (reprotect) Optional, external initialization vector for the output.
olddataelementname: (reprotect) Data element to use for the input.
oldexternaliv: (reprotect) Optional, external initialization vector for the input.
policyusername: User performing the operation.
bulk.id: Optional, identifier for the request.
bulk.data[].content: Input data to the policy operation.
Result
Returns the output of the policy operation.
Example 1 - protect without external IV
{
"protect": {
"policyusername": "user1",
"dataelementname": "Alphanum",
"bulk": {
"id": "1",
"data": [
{
"content": <Data encoded in base64>
}
]
}
}
}
Example 2 - protect with external IV
{
"protect": {
"policyusername": "user1",
"dataelementname": "Alphanum",
"externaliv": "abc123",
"bulk": {
"id": "1",
"data": [
{
"content": <Data encoded in base64>
}
]
}
}
}
Example 3 - unprotect
{
"unprotect": {
"policyusername": "user1",
"dataelementname": "Alphanum",
"bulk": {
"id": "1",
"data": [
{
"content": <Data encoded in base64>
}
]
}
}
}
Example 4 - reprotect
{
"reprotect": {
"policyusername": "user1",
"newdataelementname": "deName",
"olddataelementname": "Alphanum",
"bulk": {
"id": "1",
"data": [
{
"content": <Data encoded in base64>
}
]
}
}
}
Response
Example:
{"protect":{"bulk":{"returntype":"success","data":[{"returntype":"success","message":"Data
protection was successful.","content":"RGZBUFR4ODAzejFwNjQ5TWg0TEFpcFNqbA=="},{"returntype":"success",
"message":"Data protection was successful.","content":"aHNnVVB5QWFDYw=="}]}}}
4.5 - SSL Certificates
Reference for SSL Certificate resources in Azure Function Apps
SSL Certificates
By default, the Azure function app function support HTTPS.
To setup SSL Certificates in the Protect Function App please go to the following Azure documentation link:
App Service, Configure SSL Certificate
5 - Performance
Performance benchmarks and considerations.
5.1 - Function App Performance
Guidance on Function App Performance Performance settings and considerations.
Overview
Azure Function apps offer different hosting plans that directly impact the performance, scalability, and cost of Cloud Protect deployments.
Understanding these plans and their characteristics is essential for optimizing your data protection operations.
Azure Function App Service Plans
Azure Functions provides several hosting options, each with different characteristics:
Consumption Plan
The Consumption plan provides automatic scaling and charges only for compute resources used during function execution. While cost-effective for sporadic workloads, this plan has limitations:
- Cold start latency: Functions may experience delays when starting after periods of inactivity
- Limited execution time: Maximum execution duration of 10 minutes per function invocation
- Shared infrastructure: Resources are shared across tenants, which can lead to variable performance
- Memory constraints: Limited to 1.5 GB of memory per instance
Important
Not recommended for Cloud Protect due to cold start issues and limited resources for data protection operations.Premium Plan (Recommended)
The Premium plan is the recommended option for Cloud Protect on Azure. It provides enhanced performance and enterprise-grade features:
- Pre-warmed instances: Always-ready instances eliminate cold start delays, ensuring consistent performance
- Enhanced compute resources: Flexible compute sizing, see App Service Premium version 3 plan
- VNET integration: Secure connectivity to on-premises resources and Azure private networks
- Unlimited execution duration: No time limits for long-running protection operations
- Predictable performance: Dedicated infrastructure ensures consistent throughput
- Better scaling control: Minimum and maximum instance count configuration
Important
Use Premium plan for: Production workloads, high-volume data protection, latency-sensitive applications, and enterprise deployments.Elastic Premium Plan (Recommended)
The Elastic Premium plan extends the Premium plan with additional elasticity and performance optimization:
- Rapid scale-out: Faster scaling response to demand spikes
- Greater instance limits: Support for larger-scale deployments
- Optimized cold start: Even faster initialization compared to standard Premium
- Event-driven scaling: More granular scaling based on event sources
- All Premium features: Includes VNET integration, pre-warmed instances, and unlimited execution time
Important
Use Elastic Premium plan for: Large-scale deployments, highly variable workloads, mission-critical applications requiring maximum performance and availability.Cloud Protect Recommendations
Cloud Protect on Azure recommends using either Premium or Elastic Premium plans for production deployments. These plans provide:
- Consistent Performance: Pre-warmed instances ensure data protection operations execute immediately without cold start delays
- Sufficient Resources: Memory and CPU resources adequate for cryptographic operations and high-volume data processing
- Reliability: Dedicated infrastructure for predictable performance and SLA compliance
- Security: VNET integration enables secure communication with ESA (Enterprise Security Administrator) and other protected resources
- Scalability: Automatic scaling handles variable workloads while maintaining performance standards
When deploying Cloud Protect on Azure Functions, consider the following factors:
Instance Sizing
Select appropriate instance sizes based on your workload:
- EP1 (Elastic Premium 1): 1 vCPU, 3.5 GB RAM - suitable for moderate workloads
- EP2 (Elastic Premium 2): 2 vCPU, 7 GB RAM - recommended for standard production deployments
- EP3 (Elastic Premium 3): 4 vCPU, 14 GB RAM - for high-volume or resource-intensive operations
Scaling Configuration
Configure scaling parameters to match your protection requirements:
- Minimum instances: Set to at least 1-2 pre-warmed instances to eliminate cold starts
- Maximum instances: Configure based on peak load expectations and budget constraints
- Scale-out rules: Define appropriate triggers based on CPU, memory, or queue depth metrics
Network Considerations
- Use VNET integration to reduce latency when communicating with ESA servers
- Enable private endpoints for secure, high-performance connectivity to Azure services (Storage, Key Vault)
- Consider proximity placement to co-locate Function apps with dependent resources
Monitoring and Optimization
- Monitor execution duration metrics to identify bottlenecks
- Track instance count and scaling patterns to optimize configuration
- Review memory and CPU utilization to right-size your plan
- Set up Application Insights for detailed performance telemetry and diagnostics
While Premium and Elastic Premium plans have higher baseline costs compared to Consumption, they provide:
- Predictable performance and cost structure
- Reduced total cost for steady-state workloads (no per-execution charges)
- Better resource utilization through persistent instances
- Lower operational overhead from consistent behavior
For Cloud Protect deployments handling sensitive data with compliance requirements, the Premium/Elastic Premium investment ensures reliable, performant data protection operations.
5.2 - Log Forwarder Performance
Guidance on Log Forwarder Performance settings and considerations.
Log forwarder architecture is optimized to minimize the amount of connections and reduce the overall network bandwidth required to send audit logs to ESA. This is achieved with batching and aggregation taking place on two levels.
The first level is in protect function instances, where audit logs from consecutive requests to an instance are batched and aggregated. The second level of batching takes place in Azure Event Hub instance where log records from different protect function instances are additionally batched and sent to log forwarder function where they are aggregated.
These sections show how to configure the deployment to accommodate different patterns of anticipated audit log stream. It also shows how to monitor deployment resources to detect problems so that audit records are not lost.
Protect Service Function Environment Variables
PTY_CORE_FLUSHINTERVAL: Defines for how long audit logs are aggregated before they are sent to Azure Event Hub. Default value is ten seconds. Audit logs are always aggregated into one minute buckets, therefore a value greater than sixty seconds will affect mostly the batching interval.
MAX_WAIT_TIME: Defines for how long aggregated audit logs are batched before they are sent to Azure Event Hub. Default value is ten seconds.
Increasing MAX_WAIT_TIME may result in:
Increased latency or lag of audit logs arriving to Event Hub and therefore ESA
Increased throughput rates due to fewer network requests overall
Increased aggregation rates for values up to one minute
Lowering MAX_WAIT_TIME may result in:
Reduced latency or lag for audit logs to arrive to Event Hub and therefore ESA
Reduced throughput rates due to higher number of network requests overall
Reduced aggregation rates for values up to one minute
It is not recommended to set MAX_WAIT_TIME lower in production workloads as it may overload the Event Hubs service. Lowering MAX_WAIT_TIME may be beneficial for speeding up log delivery to ESA in dev/test environments.
Log Forwarder ARM Template Parameters
- New Event Hub Namespace Sku Name and New Event Hub Namespace Sku Tier directly affect the quotas applied to new Event Hub instances. Review Azure Event Hub Quotas related to selected tier in Azure documentation: Azure Event Hub Quotas
- New Event Hub Namespace Sku Capacity: Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. Capacity directly controls the purchased throughput of Event Hub instance. Review details in Azure documentation: Event Hub Instance Throughput
- New Event Hub Partition Count: The number of partitions represents the level of parallel log streams in the Event Hub. It is proportional to throughput capacity of the Event Hub instance. If the number of partitions is too low and the volume of audit logs is too high, a throughput ceiling may be reached on Event Hub and some audit records sent from protect function may be lost. Review details in Azure documentation: Event Hub Scalability
- New Event Hub Audit Log Retention In Days: Number of days audit logs are to be available in Event Hub. Applies to both primary Event Hub instance and dead-letter queue Event Hub instance. While audit logs are processed by Log Forwarder in near-realtime, it may be beneficial to keep audit logs available in Event Hub for extended period in case Log Forwarder or ESA require maintenance.
- Event Hub Name DLQ: Dead-letter Queue Event Hub name. This Event Hub will be used by Log Forwarder in case ESA is temporarily unavailable. Messages from DLQ Event Hub can be re-processed by another instance of Log Forwarder either manually or on schedule once ESA connectivity is restored.
Azure Event Hub Metrics: Any positive value in ‘Throttled Requests’ metric indicates that audit logs rate from protect function is too high. The recommended actions may include:
- Increase aggregation and batching intervals of Protect function by increasing values of PTY_CORE_FLUSHINTERVAL and MAX_WAIT_TIME
- Increase number of partitions for Event Hub
- Purchase additional capacity units for Event Hub
- Use a higher Event Hub namespace tier
Azure Event Hub Metrics for DLQ Event Hub: Any positive value in ‘Incoming Messages’ metric indicates that not all audit logs are being delivered to ESA. Review whether connection to ESA is set up in Audit Log Forwarder Installation
Protect Function Logs: If protect function is unable to send logs to Event Hub, it will log the following message:
Failed to forward {n} events to Event Hub
Count number of protect operations: Query logs in Log Analytics workspace of Protect Service or Log Forwarder functions:
traces
| where timestamp >= ago(20h)
| where message has 'additional_info'
| parse message with * "cnt\":" Count: long * ",\"correlation" *
| summarize count_sum = sum(Count)
View number of function instances on a graph: Query logs in Log Analytics workspace of Protect Service or Log Forwarder functions:
requests
| summarize InstanceCount = dcount(cloud_RoleInstance) by bin(timestamp, 1s)
| where timestamp >= ago(2h)
| order by timestamp desc
| render timechart
6 - Audit Logging
Audit log description/formatting
Audit Logging
Audit records and application logs stream to Azure Storage Account. Cloud Protect uses a JSON format for audit records that is described in the following sections.
You can analyze and alert on audit records using Protegrity ESA or Azure Application Insights. For more information about forwarding your audit records to ESA, contact Protegrity. Azure Application Insights contains only a sample of the audit records. The complete audit records are written to Azure Storage Account. For more information about Azure Application Insights,, refer to the Azure Application Insights overview.
For more information about audit records, refer to the Protegrity Analytics Guide.
Audit record fields
The audit record format has been altered in version 3.1 of the protector to provide more information.
| Field | Description |
|---|
| additional_info.deployment_id | The deployment_id contains the name of the Protect Function. It is automatically set based on the cloud-specific environment variables assigned to the Protect Function. This allows identifying the Cloud Protect deployment responsible for generating audit log. |
| additional_info.cluster | (Optional) Redshift cluster ARN |
| additional_info.description | A human-readable message describing the operation |
| additional_info.query_id | (Optional) Identifies the query that triggered the operation |
| additional_info.request_id | (Optional) AWS Lambda request identifier |
| cnt | Number of operations, may be aggregated |
| correlationid | (Deprecated) Use additional_info instead |
| level | Log severity, one of: SUCCESS, WARNING, ERROR, EXCEPTION |
| logtype | Always “Protection” |
| origin.ip | The private IP address of the compute resource that operates the Protect Function and is responsible for generating the log entry.NoteThe IP address is private, meaning it is used for internal network communication and is not accessible directly from the public internet. When Log Forwarding is enabled the IP address may be aggregated into minimal CIDR blocks. |
| origin.hostname | Hostname of the system that generated the log entry |
| origin.time_utc | UTC timestamp when the log entry was generated |
| protection.audit_code | Audit code of the protect operation; see the log return codes table in the Protegrity Troubleshooting Guide |
| protection.dataelement | Data element used for the policy operation |
| protection.datastore | Name of the data store corresponding to the deployed policy |
| protection.mask_setting | (Optional) Mask setting from policy management |
| protection.operation | Operation type, one of: Protect, Unprotect, Reprotect |
| protection.policy_user | User that performed the operation |
| protector.core_version | Internal core component version |
| protector.family | Always “cp” for Cloud Protect |
| protector.lambda_version | Protector Lambda application version. |
| protector.pcc_version | Internal pcc component version |
| protector.vendor | Identifies the cloud vendor and the database vendor |
| protector.version | Protector version number |
| signature.checksum | Hash value of the signature key ID used to sign the log message when the log is generated |
| signature.key_id | Key used to sign the log message when the log is generated |
Example Audit Records
The following are sample audit messages:
Protect Success:
{
"additional_info": {
"deployment_id": "Protegrity-Protect-function-deployment-id",
"description": "Data protect operation was successful.",
"query_id": "sf-query-id:01978dbc-0582-d7e4-0000-002a3603a20d",
"request_id": "8476a536-e9f4-11e8-9739-2dfe598c3fcd"
},
"cnt": 4000,
"correlationid": "sf-query-id:01978dbc-0582-d7e4-0000-002a3603a20d",
"logtype": "Protection",
"level": "SUCESS",
"origin": {
"hostname": "localhost",
"ip": "127.0.0.1",
"time_utc": 1635363966
},
"protection": {
"dataelement": "deAddress",
"operation": "Protect",
"audit_code": 6,
"datastore": "SAMPLE_POLICY",
"policy_user": "test_user"
},
process":{
"name":"protect",
"id":"13",
"module":"coreprovider",
"thread_id":"573580544",
"user":"sbx_user1051",
"platform":"\"Linux_x64\"",
"version":"UNKNOWN"
},
"client": {
"ip":"169.254.62.117"
},
"protector": {
"family": "cp",
"version": "4.0.0.102",
"vendor": "aws.snowflake",
"datastore":"SAMPLE_POLICY",
"pcc_version": "4.0.0.9",
"core_version": "2.1.4+0.g93016.2.1",
"lambda_version":"4.0.1"
},
"signature": {
"key_id": "95f5a194-b0a4-4351-a",
"checksum": "B324AF7C56944D91C47847A77C0367C594C0B948E7E75654B889571BD4F60A71"
}
}
User permission denied:
{
"additional_info": {
"deployment_id": "Protegrity-Protect-function-deployment-id",
"description": "The user does not have the appropriate permissions to perform the requested operation.",
"query_id": "sf-query-id:01978dbc-0582-d7e4-0000-002a3603a20d",
"request_id": "8476a536-e9f4-11e8-9739-2dfe598c3fcd"
},
"cnt": 4000,
"correlationid": "sf-query-id:01978dbc-0582-d7e4-0000-002a3603a20d",
"logtype": "Protection",
"level": "ERROR",
"origin": {
"hostname": "localhost",
"ip": "127.0.0.1",
"time_utc": 1635363966
},
"protection": {
"dataelement": "deAddress",
"operation": "Protect",
"audit_code": 3,
"datastore": "SAMPLE_POLICY",
"policy_user": "test_user"
},
process":{
"name":"protect",
"id":"13",
"module":"coreprovider",
"thread_id":"573580544",
"user":"sbx_user1051",
"platform":"\"Linux_x64\"",
"version":"UNKNOWN"
},
"client": {
"ip":"169.254.62.117"
},
"protector": {
"family": "cp",
"version": "4.0.0.102",
"vendor": "aws.snowflake",
"datastore":"SAMPLE_POLICY",
"pcc_version": "4.0.0.9",
"core_version": "2.1.4+0.g93016.2.1",
"lambda_version":"4.0.1"
},
"signature": {
"key_id": "95f5a194-b0a4-4351-a",
"checksum": "A216797C56944D91C47847A77C0367C594C0B948E7E75654B889571BD4F60A71"
}
}
Data element not found:
{
"additional_info": {
"deployment_id": "Protegrity-Protect-function-deployment-id",
"description": "The data element could not be found in the policy.",
"query_id": "sf-query-id:01978dbc-0582-d7e4-0000-002a3603a20d",
"request_id": "8476a536-e9f4-11e8-9739-2dfe598c3fcd"
},
"cnt": 4000,
"correlationid": "sf-query-id:01978dbc-0582-d7e4-0000-002a3603a20d",
"logtype": "Protection",
"level": "ERROR",
"origin": {
"hostname": "localhost",
"ip": "127.0.0.1",
"time_utc": 1635363966
},
"protection": {
"dataelement": "deAddress",
"operation": "Protect",
"audit_code": 2,
"datastore": "SAMPLE_POLICY",
"policy_user": "test_user"
},
process":{
"name":"protect",
"id":"13",
"module":"coreprovider",
"thread_id":"573580544",
"user":"sbx_user1051",
"platform":"\"Linux_x64\"",
"version":"UNKNOWN"
},
"client": {
"ip":"169.254.62.117"
},
"protector": {
"family": "cp",
"version": "4.0.0.102",
"vendor": "aws.snowflake",
"datastore":"SAMPLE_POLICY",
"pcc_version": "4.0.0.9",
"core_version": "2.1.4+0.g93016.2.1",
"lambda_version":"4.0.1"
},
"signature": {
"key_id": "95f5a194-b0a4-4351-a",
"checksum": "AF09217C56944D91C47847A77C0367C594C0B948E7E75654B889571BD4F60A71"
}
}
7 - No Access Behavior
Unauthorized unprotect requests behaviour.
No Access Behavior
The security policy maintains a No Access Operation, configured in an ESA, which determines the response for unauthorized unprotect requests.

The following table describes the result returned in the response for the various no access unprotect permissions.
| No Access Operation | Data Returned |
|---|
| Null | null |
| Protected | (protected value) |
| Exception | Query will fail with an exception |
Note
An unauthorized protect will throw an exception.8 - Upgrading To The Latest Version
Instructions for upgrading the protector.
Important
- Upgrading the Policy Agent component to version 4 from any previous major version requires a new installation
- Upgrading the Protector and Log Forwarder component to version 4 from versions <3.2, or versions of 3.2 which use shared access key for loading the source, requires a new installation
Upload Deployment Artifacts
You can download the latest version of the deployment package from https://my.protegrity.com. Navigate to Data Protection > Cloud Protect to download the latest version.
After downloading the deployment package from the Protegrity Portal, go to Azure console. Navigate to the storage account that was previously created to upload deployment artifacts (see: Agent Policy Blob Container).
Upload the following artifacts to the Azure storage container:
- protegrity-protect-<version>.zip
- protegrity-agent-<version>.zip
After upload is complete, note the blob url for each file. Blob URL may be found in the blob properties.
Record Blob URL values below
New Protect Function Blob URL: ___________________
New Log Forwarder Function Blob URL: ___________________
Note
Log Forwarder shares the same source as Protect Function, use the value of protegrity-protect-<version>.zip blob url here.New Agent Function Blob URL: ___________________
Perform the following steps to upgrade the Policy Agent, Protect, and Log Forwarder Functions separately.
Important
If new versions are available for both Policy Agent and Protect/Log Forwarder functions, Policy Agent function must be installed or upgraded first.Disable Protegrity Agent Function Timer Trigger
App Function Timer Trigger is used to periodically run Protegrity Agent Function to synchronize policy from ESA. The trigger must be disabled temporarily for the time of the upgrade process.
Follow the steps below to disable the Agent Function Timer Trigger.
From Azure Console, go to Function App service and select Protegrity Agent Function.
Navigate to Overview.
The functions list should contain agent function with Trigger type Timer and status Enabled.
Click on the three dots in the same row as the agent function. Then select Disable.
Upgrading Policy Agent Function
Note
If the release version of the artifact zip file has not changed since the previous installation, you can skip the Agent Function upgrade.Important
If Policy Agent version is less than version 4, a new installation must be created. Carefully observe the below points:
- Create a new Container in the Storage Account for policy storage for the installation, as the version 4 policy package differs from version 3.
- To prevent overwriting production environment policies with incompatible policy package, follow Disable Protegrity Agent Function Timer Trigger after deploying the new function with arm template. Do not add the production Protect or Forwarder functions to the PROTEGRITY_PROTECT_FUNCTION environment variable of new Policy Agent until the trigger is disabled
- Skip to Disable Agent Policy Deployment and Test Policy Agent Function once installation is complete.
Upgrade Policy Agent Runtime Package
From Azure console, navigate to Function App service and select agent function app. Navigate to Settings > Environment variables.
Click on WEBSITE_RUN_FROM_PACKAGE configuration entry.
Save existing URL. You may need it to rollback upgrade.
WEBSITE_RUN_FROM_PACKAGE: _______________
Replace URL with New Agent Function Blob URL.
Click Apply then select Apply and Confirm to finalize.
Using menu on the left, navigate to Overview. Stop the function using Stop button at the top. Then start it again.
In the next section the Agent function will be tested to make sure it works as expected.
(Optional) If you need to rollback to older version of Agent Function, replace WEBSITE_RUN_FROM_PACKAGE with URL recorded in previous steps.
Disable Agent Policy Deployment and Test Policy Agent Function
Policy agent generates a backup of pulled policy when triggered. The policy will then be deployed to Protect and Log Forwarder functions. Deployment of policies to functions should be disabled during the upgrade process.
Follow the steps below to disable policy deployment:
From Azure Console, navigate to Policy Agent Function App
Navigate to Settings > Environment variables.
set DISABLE_DEPLOY to 1 if it is not already set.
Note
This will prevent Agent from overwriting production policy files or their references in deployed functions.Stop/Start the Agent function. It may take a few minutes for the function to start.
Test/Run Policy Agent Function to Generate Latest Policy
Follow the steps below to run the upgraded policy agent to refresh latest backup policy. Record the latest backup policy URL for later upgrade steps.
From Azure Console, navigate to the Policy Agent Function App
Navigate to the agent Test/Run feature as described in Test Agent Function Installation.
Run the policy agent. Verify the agent executed successfully by carefully inspecting the logs.
Use the following Azure Blob url from your Policy Agent Function Settings > Environment variables
Note
If resources are deployed in gov cloud, use blob.core.usgovcloudapi.net domainupgraded_agent_policy_blob_url: _______________________
Upgrading Protect Function
Note
If the release version of the artifact zip file has not changed since the previous installation, you can skip the Protect Function upgrade.Important
Upgrading the Protector component to version 4 from versions <3.2, or versions of 3.2 which use shared access key for loading the source, requires a new installationDiagram below illustrates upgrade steps.

Create Staging Deployment Slot (Protector)
Creating new deployment slot allows updating the function without interruptions to the existing traffic.
From Azure console, navigate to Function App service and select the Protect Function App to upgrade. Navigate to Deployments > Deployment Slots.
Click Add slot. Specify slot name.
Click Add. Wait for the slot to be created.
After the slot is added, select Close to close the dialog box.
There should be a new slot available in the list of deployment slots. You will use this deployment slot as staging for the upgraded function. After upgrade is done and tested, you will swap staging slot with production slot.
Click on the new deployment slot. This will open the newly created replica of Cloud Protect Function.
Copy the function URL from the overview window.
Staging Protect Function URL: ________________
Navigate to Identity section under Settings.
If your installation utilizes System Assigned Identity:
Select System Assigned tab and switch Status On. Click Save.
This will generate the Object ID for the newly deployed function in the deployment slot.
Add Role Assignments to the identity as described in section Function System-Assigned Managed Identity
Tip
Reference production function slot for current permissions.Use the Object ID to update Key Vault policy to allow function in the deployment slot to use policy encryption key. See Protect Function Key Vault Access Policies for instructions how to update Key Vault policy.
If your installation utilizes User Assigned Identity:
Select User Assigned tab
Select Add. Choose the identity in use on the production function, then complete by selecting Add again.
Navigate to App Keys section from the menu on the left. Record default key value under Host Keys section.
Staging Protect Function Default Host Key: ________________
Navigate to the staging Function App Settings > Environment variables
Click on WEBSITE_RUN_FROM_PACKAGE configuration entry.
Replace value with New Protect Function Blob URL.
Set EVENTHUB_NAME to the output value recorded in Install Log Forwarder via ARM template for the newly deployed log forwarder.
Set EventHub__fullyQualifiedNamespace to the output value recorded in Install Log Forwarder via ARM template.
Click Apply, then Apply to finalize.
Load Production Policy and Test New Protect Function In Staging
Navigate to the new staging Protect function Settings > Environment variables
Set AZURE_POLICY_BLOB_URL environment variable to the upgraded_agent_policy_blob_url value recorded in previous steps.
Start/Stop the protect function.
Test New Protect Function in staging. You can use curl command below, replacing Staging Protect Function URL and Staging Protect Function Default Host Key with values recorded in previous section.
curl -X POST "<Staging Protect Function URL>/api/Protect" -k \
-H 'sf-custom-X-Protegrity-HCoP-Rules: {"jsonpaths":[{"op_type":"unprotect","data_element":"alpha"}]}' \
-H 'sf-context-current-user: test' \
-H 'sf-external-function-current-query-id: test-id' \
-H 'x-functions-key: <Staging Protect Function Default Host Key>' \
-H 'Content-Type: application/json' \
-d '{
"data": [
["0", "UtfVk UHgcD!"]
]
}'
curl -X POST "<Protect Function URL>/api/v1/protect" -k \
-H 'x-functions-key: <Protect Function app key>' \
-H 'Content-Type: application/json' \
-d '{
"data": ["test"],
"user": "test",
"data_element": "test"
}'
Finalize Protector upgrade
Upgraded Protect Function can now be swapped in to production deployment slot to serve production traffic.
Go to your main Protect Function.
Select deployment slots.
Select Swap.
Select staging Protect Function slot as source and production Function as target.
Click swap and wait until the functions are swapped.
If you need to rollback swap the application slots again.
Upgrading Log Forwarder Function
Note
If the release version of the artifact zip file has not changed since the previous installation, you can skip the Log Forwarder upgrade.Important
Upgrading the Log Forwarder component to version 4 from versions <3.2, or versions of 3.2 which use shared access key for loading the source, requires a new installationDisable Log Forwarder Event Hub Trigger
Disabling the Event Hub trigger will prevent audit log delivery during the upgrade process. This reduces the chance for any duplicate or lost audit logs. Later steps will indicate when this trigger may be re-enabled.
Follow the steps below to disable the Event Hub trigger:
From Azure Console, go to Function App service and select Protegrity Log Forwarder Function.
Navigate to Overview.
The functions list should contain AuditLogForwarder function with Trigger type Event Hub and Status Enabled.
Click on the three dots in the same row as the AuditLogForwarder function. Then select Disable.
Create Staging Deployment Slot (Log Forwarder)
Creating new deployment slot allows updating the function such that it may easily be rolled back. Log Forwarder Function will be disabled during the upgrade process. Logs generated during this time will be processed once Log Forwarder is re-enabled
From Azure console, navigate to Function App service and select the Log Forwarder Function App to upgrade. Navigate to Deployments > Deployment Slots.
Click Add slot. Specify slot name.
Click Add. Wait for the slot to be created.
After the slot is added, select Close to close the dialog box.
There should be a new slot available in the list of deployment slots. You will use this deployment slot as staging for the upgraded function. After upgrade is done, you will swap staging slot with production slot.
Click on the new deployment slot. This will open the newly created replica of Log Forwarder Function.
Navigate to the staging Function App environment variable settings Settings > Environment variables
Click on WEBSITE_RUN_FROM_PACKAGE configuration entry.
Replace value with New Log Forwarder Function Blob URL. Click Apply.
Click on AZURE_POLICY_BLOB_URL configuration entry.
Replace value with upgraded_agent_policy_blob_url. Click Apply.
Click Apply and Confirm to push the configuration changes.
Finalize Log Forwarder Upgrade
Upgraded Log Forwarder Function will be swapped into production deployment slot to serve production traffic and re-enabled,
Swap Upgraded Function Slot to Production
Go to your main Log Forwarder Function.
Select deployment slots.
Select Swap.
Select staging Log Forwarder Function slot as source and current Function as target.
Click Start Swap and wait until the functions are swapped.
If you need to rollback, swap the application slots again.
Re-Enable Log Forwarder Function Trigger
Go to your main Log Forwarder Function.
Navigate to environment variable settings Settings > Environment variables
Click on AzureWebJobs.AuditLogForwarder.Disabled configuration entry.
Replace value with false. Click Apply then Apply and Confirm to finalize.
Re-enable Policy Agent Deployment Setting
Skip this step if changes were not made to the DISABLE_DEPLOY setting in previous upgrade steps
Navigate to Agent function Settings > Environment variables
Set DISABLE_DEPLOY to 0.
apply changes and restart the Agent Function App
Enable Protegrity Agent Function Timer Trigger
If the Agent Function Timer Trigger was disabled at the beginning of the upgrade process, you must re-enabled it. Follow the steps below to enable Policy Agent Timer Trigger.
Navigate back to Protegrity Agent Function.
Select Overview.
Click on the three dots in the same row as the agent function in the list of functions. Then select Enable.
9 - Known Limitations
Known product limitations.
- FPE is supported only for ASCII values.
10 - Appendices
Additional references for the protector.
10.1 - Integrating Cloud Protect with PPC (Protegrity Provisioned Cluster)
Concepts for integrating with PPC (Protegrity Provisioned Cluster)
This guide describes how to configure the Protegrity Policy Agent and Log Forwarder to connect to a Protegrity Provisioned Cluster (PPC), highlighting the differences from connecting to ESA.
Key Differences: PPC vs ESA
| Feature | ESA 10.2 | PPC (this guide) |
|---|
| Datastore Key Fingerprint | Optional/Recommended | Required |
| CA Certificate on Agent | Optional/Recommended | Optional/Recommended |
| CA Certificate on Log Forwarder | Optional/Recommended | Not supported |
| Client Certificate Authentication from Log Forwarder | Optional/Recommended | Not supported |
| IP Address | ESA IP address | PPC address |
Prerequisites
- Access to PPC and required credentials.
- Tools:
curl, kubectl installed.
Policy Agent Setup with PPC
Important
When connecting to PPC, the Policy Agent
requires use of a datastore key fingerprint. For connecting to ESA 10.2 with Cloud Protect Policy Agent, the fingerprint is optional but recommended. See
Policy Agent Installation for general setup steps.
Follow these instructions as a guide for understanding specific inputs for Policy Agent integrating with PPC:
Obtain the Datastore Key Fingerprint
To retrieve the fingerprint for your Policy Agent:
Retrieve public key from the Cloud Provider Key Management service for the policy encryption key created in pre-configuration:
- Navigate to the Key Management Service in AWS console and open Customer Managed Keys
- Select the desired key
- Select the Public Key tab
- Select Download
- Navigate to the Key Vault in Azure console and open Objects>Keys
- Select the desired key
- Select the key indicated as CURRENT VERSION
- Select Download public key
- Navigate to Key Management in GCP console
- Select the desired key and open the Versions tab
- Select Get public key from the Actions column menu
- Select Download
Escape the new line characters in the downloaded public key for use in the next step - for example:
awk 'NF {printf "%s\\n",$0}' "<public_key_file>" > "new-line-escaped-public-key.pem"
cat new-line-escaped-public-key.pem
Export key fingerprint using the PPC API as indicated in the curl example below:
curl -k -H "Authorization: Bearer ${TOKEN}" -X POST https://${HOST}/pty/v2/pim/datastores/1/export/keys -H "Content-Type: application/json" --data '{
"algorithm": "RSA-OAEP-256",
"description": "example-key-from-key-management",
"pem": "<value of new-line-escaped-public-key>"
}'
Sample Output:
{"uid":"1","algorithm":"RSA-OAEP-256","fingerprint":"4c:46:d8:05:35:2e:eb:39:4d:39:8e:6f:28:c3:ab:d3:bc:9e:7a:cb:95:cb:b1:8e:b5:90:21:0f:d3:2c:0b:27","description":"example-key-from-kms"}
Record the value for fingerprint and configure the Policy Agent:
Set the environment variable PTY_DATASTORE_KEY in the Policy Agent Lambda function to the fingerprint value.
Set the environment variable PTY_DATASTORE_KEY in the Policy Agent Function App to the fingerprint value.
Set the variable in Policy Agent main.tf pty_datastore_key to the fingerprint value and apply the changes.
Retrieve the PPC CA Certificate
To obtain the CA certificate from PPC:
kubectl -n api-gateway get secret ingress-certificate-secret -o jsonpath='{.data.ca\.crt}' | base64 -d > CA.pem
Use the ProtegrityCA.pem that was returned as described in Policy Agent Installation.
Configure the PPC Address
Use the PPC address in place of the ESA IP address wherever required in your configuration.
Log Forwarder Setup with PPC
Note
When using PPC, certificate authentication and CA validation are
not supported for the Log Forwarder. Configuration steps related to certificates in
Log Forwarder Installation do
not apply to PPC.
If you attempt to use certificates provided by PPC, the Log Forwarder will not function correctly.
- The Log Forwarder will proceed without certificates and will print a warning if
PTY_ESA_CA_SERVER_CERT is not provided. - No additional certificate or CA configuration is needed for PPC.
10.2 - Configuring Regular Expression to Extract Policy Username
Example configurations for user extraction with regular expressions
Cloud Protect Function exposes USERNAME_REGEX configuration to allow extraction of policy username from user in the request.
USERNAME_REGEX Function Environment configuration
The USERNAME_REGEX environment variable can be set to contain regular expression with one capturing group. This group is used to extract the username. Examples below show different regular expression values and the resulting policy user.
10.3 - Getting JWT for Service Account in Azure Active Directory
How to get JWT using OAuth 2.0 client credentials grant flow in Azure Active Directory and authorize the Client ID in Protegrity Policy
Getting JWT for Service Account in Azure Active Directory
Protect Function App can use Microsoft identity platform endpoint for identity-as-a-service, available in Azure Active Directory, to implement OpenID Connect and OAuth 2.0 authorization. This section describes how to get JWT using OAuth 2.0 client credentials grant flow in Azure Active Directory and authorize the Client ID in Protegrity Policy.
Note
Protect Function App and Azure Active Directory support more authorization methods, and the correct procedure should be chosen based on the use case.Suggested reading: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow
High-level design:
- Active Directory Admin creates App registration for the service account.
- Active Directory Admin gives consent for the Service Account App ID.
- Daemon uses the Service Account App ID and the Service Account App ID Secret or Certificate, Protect Function App ID as the scope, and gets back the Access Token (JWT).
- Daemon sends the request to the Protect Function App, including the access token in the Authorization Bearer header.
Configure the Protect Function App:
From the Azure console, navigate to Function App service and select protect function app.
Navigate to Settings > Environment variables and click OPENID_ENABLED. Make sure it is set to true.
Click on OPENID_AUDIENCES, make sure it is set to the App ID recorded in EntraIDApplicationID.
Click or Add the authorization environment variable. Make sure it is set to jwt.
Click or Add on jwt_user_claim environment variable, make sure it is set to [“azp”, “appid”]. For more information on claims on AAD access token, refer:
https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens
To register a Service Account:
In the Azure portal navigate to Azure Active Directory.
Under Manage, select App registrations > New registration.
Enter a Name and select Accounts in any organizational directory.
Redirect URI is set to http://localhost.
Select Register.
After registration is complete record Application ID and Directory (tenant) ID displayed in the overview window:
Service Account App ID: ___________________
Directory (tenant) ID: ___________________
In the Azure portal, in App registrations, select your application.
Select Certificates & secrets > New client secret.
Add a description for your client secret.
Select a duration.
Click Add.
Record the secret’s value for use in your client application code. This secret value is never displayed again after you leave this page.
Service Account App Secret: ___________________
For more information on app registration, see Azure documentation Quickstart Registering App
Admin Consent the Service Account:
https://login.microsoftonline.com/{tenant}/adminconsent?
client_id={Service Account App ID}
&state=12345
&redirect_uri=http://localhost
Replace the tenant and the Service Account App ID with the values recorded in the previous step. At this point, Azure AD enforces that only a tenant administrator can sign into complete the request. The administrator will be asked to approve all the direct application permissions that were requested for the app in the app registration portal.
Get the access token
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id={Service Account App ID}&scope={EntraIDApplicationID }%2F.default&client_secret={Service Account App Secret}&grant_type=client_credentials' 'https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token'
Replace Service Account App ID, EntraIDApplicationID, Service Account App Secret, and tenant with values recorded in previous steps.
Example for successful response:
{
"token_type": "Bearer",
"expires_in": 3599,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBP..."
}
\
Record the access_token from the response. access_token: ___________________
Note
Ensure that the claims azp or appid are included in the JWT and that the value exists in the policy as user with protect permissions.Use the token
curl -X POST "https://<Protect hostname>/api/v1/protect" -k \
-H 'x-functions-key: <Protect Function app key>' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{
"data": ["hello world!"],
"data_element": "alpha"
}'
Replace the {Protect hostname}, {Protect Function app key} and {access_token} with the.
Troubleshooting:
- Service Account App ID redirect URL matches the redirect URL in the request for admin consent.
- Active Directory administrator does admin consent.
- JWT aud claim is the same as OPENID_AUDIENCES.
- JWT iss claim is the same as OPENID_ISSUERS.
- Protect Function configuration authorization=JWT
- At least one of thejwt_user_claim exists in the JWT
- The user claim in the token has permissions to make protect request.
- The data element exists in the Protect Function App current policy.
- JWT is not expired
10.4 - Protection Methods
Cloud API supported protection methods
Protection Methods
For more information about the protection methods supported by Protegrity, refer to the Protection Methods Reference.
Tokenization Type | Supported Input Data Types | Notes |
|---|
Numeric Credit Card Alpha Upper-case Alpha Alpha-Numeric Upper Alpha-Numeric Lower ASCII Printable Decimal Unicode Unicode Base64 Unicode Gen2 Email | STRING NULL | |
Integer | NUMBER NULL | |
Date Datetime | STRING NULL | For information about supported formats, refer to the Protection Methods Reference. |
Binary | STRING NULL | Must be hex encoded unless a different encoding is specified. Another supported encoding is base64. |
Protection Method | Supported Input Data Types | Notes |
|---|
No Encryption | STRING NUMBER NULL | |
Encryption Algorithm | Supported Input Data Types | Notes |
|---|
3DES AES-128 AES-256 CUSP 3DES CUSP AES-128 CUSP AES-256 | STRING | Must be hex encoded unless a different encoding is specified. Another supported encoding is base64. |
10.5 - ARM Template Installation - Required Permissions
Outlines the required permissions to deploy Cloud Protect with provided ARM templates
ARM Template Installation - Required Permissions
Permissions below are required to install Protegrity service using ARM template.
All permissions in the table must be granted with the Resource group scope.
Permissions | Description | Built-In Azure Role |
|---|
Microsoft.Insights/components/read
Microsoft.OperationalInsights/workspaces/read
| Read access to monitoring data and settings | Monitoring Reader |
Microsoft.Insights/components/write
Microsoft.OperationalInsights/workspaces/write
| Write and manage access to monitoring data and settings | Monitoring Contributor |
Microsoft.Web/serverFarms/write
Microsoft.Web/sites/write
Microsoft.Web/sites/host/listkeys/action
Microsoft.Web/serverFarms/join/action
Microsoft.Web/register/action
| Write and manage access to web apps | Website Contributor |
Microsoft.ManagedIdentity/userAssignedIdentities/assign/action
Microsoft.ManagedIdentity/userAssignedIdentities/read
| Manage and assign managed identities NoteThese permissions are only required when user assigned identity is used. | Managed Identity Operator |
Microsoft.Resources/deployments/validate/action
Microsoft.Resources/deployments/write
Microsoft.Resources/deployments/operationStatuses/read
Microsoft.Resources/deployments/read
| Manage and validate deployments | Deployment Contributor |
Log Forwarder service ARM deployment requires additional permissions below:
Permissions | Description | Built-In Azure Role |
|---|
Microsoft.EventHub/namespaces/write
Microsoft.EventHub/namespaces/eventhubs/write
Microsoft.EventHub/namespaces/networkrulesets/write
| Allow for the creation, update, and deletion of Event Hub namespaces, event hubs within those namespaces, and their network rule sets, enabling full management of Event Hub resources. Note: These permissions are only required when deploying new event Hub. | Event Hubs Contributor |
Microsoft.EventHub/namespaces/read
| Read monitoring data and metrics, including Event Hub namespace data. | Monitoring Reader |
The additional permissions listed below are required when API management is part of the deployment.
Permissions | Description | Built-In Azure Role |
|---|
Microsoft.ApiManagement/service/write
Microsoft.ApiManagement/service/apis/write
Microsoft.ApiManagement/service/diagnostics/write
Microsoft.ApiManagement/service/apis/operations/write
Microsoft.ApiManagement/service/apis/operations/policies/write
Microsoft.ApiManagement/service/backends/write
Microsoft.ApiManagement/service/loggers/write
Microsoft.ApiManagement/service/policies/write
Microsoft.ApiManagement/service/apis/diagnostics/write
| Create or update API Management service instances, APIs, diagnostics, API operations, operation policies, backends, loggers, tenant policies, and API diagnostics. | API Management Service Contributor |
Microsoft.ApiManagement/service/read
Microsoft.ApiManagement/service/operationResults/read
| Read metadata for API Management service instances and get the status of long-running operations. | API Management Service Reader |
10.6 - Associating ESA Data Store With Cloud Protect Agent
Configure ESA data store for Policy Agent
Associating ESA Data Store With Cloud Protect Agent
ESA controls which policy is deployed to protector using concept of data store. A data store may contain a list of IP addresses identifying servers allowed to pull the policy associated with that specific data store. Data store may also be defined as default data store, which allows any server to pull the policy, provided it does not belong to any other data stores. Node registration occurs when the policy server (in this case the policy agent) makes a policy request to ESA, where the agent’s IP address is identified by ESA.
Note
For more information about ESA data store refer to
Policy Management Section which is part of Protegrity ESA documentation.
Policy agent function source IP address used for node registration on ESA depends on ESA hubcontroller configuration ASSIGN_DATASTORE_USING_NODE_IP and the PTY_ADDIPADDRESSHEADER configuration exposed by the agent function.
The function service uses multiple network interfaces, internal network interface with ephemeral IP range of 169.254.x.x and external network interface with IP range described in Function app outbound IP addresses section under function configuration. By default, when agent function is contacting ESA to register node for policy download, ESA uses agent function outbound IP address. This default behavior is caused by the default ESA hubcontroller configuration ASSIGN_DATASTORE_USING_NODE_IP=false and agent default configuration PTY_ADDIPADDRESSHEADER=yes.
In some cases, when there is a proxy server between the ESA and agent function, the desirable ESA configuration is ASSIGN_DATASTORE_USING_NODE_IP=true. and PTY_ADDIPADDRESSHEADER=no which will cause the ESA to use proxy server IP address.
The table below shows how the hubcontroller and agent settings will affect node IP registration on ESA.
| Agent source IP | Agent Function Outbound IP | Proxy IP | ESA config - ASSIGN_DATASTORE_USING_NODE_IP | Agent function config - PTY_ADDIPADDRESSHEADER | Agent node registration IP |
|---|
| 169.254.144.81 | 20.75.43.207 | No Proxy | true | yes | 169.254.144.81 |
| true | no | | | | 20.75.43.207 |
| false | yes | | | | 20.75.43.207 |
| false | no | | | | 20.75.43.207 |
| 169.254.144.81 | 20.75.43.207 | 34.230.42.110 | true | yes | 169.254.144.81 |
| true | no | | | | 34.230.42.110 |
| false | yes | | | | 34.230.42.110 |
| false | no | | | | 34.230.42.110 |