Securing Azure Logic Apps
This lesson explains who can trigger, edit and view a workflow, and how it connects to other services.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the Logic Apps roles.
- Compare ways of protecting a trigger.
- Explain how to protect run history.
- Explain the risk of workflow edit rights.
What needs protecting
Azure Logic Apps automates workflows across services. A workflow may read mail, update a database and call an API, so it holds considerable access. There are several concerns: who can start a workflow, who can edit it, who can read data in its run history, and how it reaches other systems. The Consumption plan runs in a shared environment, and the Standard plan is single-tenant, with stronger network options.
Access to the workflow
Azure roles control who can manage a logic app. The following table lists them.
| Plan | Role | Allows |
|---|---|---|
| Consumption | Logic App Contributor | Managing logic apps |
| Consumption | Logic App Operator | Reading, enabling and disabling, but not editing |
| Standard | Logic Apps Standard Reader | Viewing workflows and run history |
| Standard | Logic Apps Standard Operator | Enabling, resubmitting and disabling workflows |
| Standard | Logic Apps Standard Developer | Editing workflows, but not settings such as virtual network integration |
| Standard | Logic Apps Standard Contributor | Managing all aspects of a workflow app |
A warning applies here. Anyone with Contributor or workflow-editing rights can make a workflow request a bearer token for any audience, using the logic app's managed identity, and tokens last for one hour. Edit rights to a workflow are therefore effectively the rights of its identity, so grant them sparingly.
Logic Apps Standard roles
Protecting triggers
A workflow with a Request trigger has a callback URL that contains a shared access signature. Anyone with that URL can start the workflow, so treat it as a secret. Stronger options are available.
- IP restrictions limit which addresses can call the trigger.
- OAuth with Microsoft Entra ID requires a token, through an authorization policy on Consumption.
- Easy Auth is available on Standard for Request triggers.
- API Management in front adds validation and throttling.
- Private endpoints on Standard give private inbound access.
Consumption workflows can disable SAS authentication when OAuth is used, so that the URL alone is not enough. IP restrictions do not block a call through the Azure REST API, or a call through API Management, which is worth remembering when reasoning about what they protect.
Protecting a Request trigger
Protecting run history
Run history records inputs and outputs of each action, and it can therefore expose secrets or personal data to anyone who can read it. There are two controls. Restrict by IP range limits who can view run history content. Secure inputs and outputs is a setting on a trigger or action that hides its data from run history and from logs, and a value hidden in one action is hidden automatically in actions that use it.
Some built-in operations, such as Compose, Parse JSON and Response, do not support all of these options. Sensitive values in a workflow definition should use parameters of type securestring or secureobject, so that they do not appear in the definition or logs.
Run history
Connections and identity
Prefer a managed identity for connections to Azure resources, and for calling APIs through the HTTP action with Microsoft Entra authentication. Consumption allows one user-assigned identity, and Standard allows several, although only one is used at a time. Standard workflows can use virtual network integration for outbound traffic to private resources.
Microsoft Sentinel playbooks are logic apps, so all of this applies to them too. A playbook may hold high privileges, so its protection deserves particular care.
Sensitive data in run history
A logic app retrieves a secret from Key Vault and calls a partner API. An auditor notices that the secret appears in plain text in run history. Support staff need to see that workflows ran, but not the secret. What should you do?
Turn on Secure outputs on the Key Vault action, and Secure inputs on the action that uses the value, so that it is hidden from run history. Give support staff Logic App Operator, or the Standard Reader role, rather than edit rights, and use a managed identity for the Key Vault connection.
Restricting run history by IP range would limit where it can be viewed, but anyone in that range would still see the secret. Moving the secret into a plain parameter would make matters worse. Deleting run history would remove the evidence that support staff need.
Why is Logic App Operator safer than Contributor for support staff?
Show answer
An Operator can view and enable workflows without editing them. Edit rights can abuse the managed identity.
Exam Tips
Remember for the exam
- A trigger's callback URL is effectively a secret.
- Workflow edit rights are effectively the rights of its managed identity.
- Secure inputs and outputs hide data from run history.
- Standard offers private endpoints and virtual network integration.