MSBA-273 · Lesson 11 of 12 · 20 min
Security for integrations
▶ Video coming soon A video version of this lesson is on the way.
Dr. Philippa Ondaatje-Ruiz, the college's privacy officer, joined the eleventh session with a question she asked about every system: if someone outside the college got hold of this integration's identity tomorrow, what could they read, what could they change, and how long would it take Lumenvale to notice? Integrations are attractive to attackers because they hold credentials that work without a person, often carry broad access, and move data across boundaries where controls are weakest. The session pulled together the security practices scattered through the earlier lessons into one defensive design, so that each new integration could be reviewed against it.
Thinking about threats
A short threat model for each integration helps the team see where to put controls. Signe used a simple table of things that can go wrong, how each would happen, and which control addresses it.
| Threat | How it happens | Main controls |
|---|---|---|
| Stolen credential | A secret copied from a file, log or repository | Managed identities, federated credentials, Key Vault, rotation |
| Over-privileged identity | An application user given broad roles for convenience | Custom least-privilege roles, reviews |
| Data sent to the wrong place | A flow or job posts data to an unapproved address | Data policies, endpoint filtering, tenant isolation |
| Forged inbound request | Someone calls a webhook receiver or API pretending to be Dataverse or a partner | Authentication, HTTPS, value checks, network restrictions |
| Injection | Untrusted text placed directly into a query | Escaping, parameters, validation |
| Undetected misuse | An identity used at odd hours or from odd places | Sign-in logs, audit, alerts |
Identity: the first boundary
Lesson 2 set out the identity rules, and they remain the most important security control. Every unattended integration has its own identity. Managed identities are used wherever code runs in Azure, federated credentials for deployment pipelines, and certificates where neither is possible. Client secrets are not created for production. Each identity is linked to an application user in only the environments where it is needed, and each application user holds a custom role with only the privileges its job requires.
Least privilege applies at several levels in Dataverse. Table privileges set what the identity can do with each table and at what depth: user, business unit, parent and child business units, or organization. Column-level security profiles can hide sensitive columns even from identities that can read the row; application users are subject to them like anyone else. Business units can scope an identity to one part of the organization. The research export's identity, for example, could read completed work orders at organization level but was not in the column security profile that allowed reading the cost-recovery notes, which sometimes mentioned individuals.
Privileges need regular review because they drift. A role created for one job is reused for another, a privilege is added during an incident and never removed. Rupert's team reviewed every application user's roles twice a year, comparing them with the integration's documented needs, and removed anything unexplained.
Secrets that cannot be avoided
Some external systems accept only an API key or a password, as LedgerPoint's reporting API did. For those, the secret lives in Azure Key Vault. Power Platform solutions reference it through an environment variable of the Secret type, which points to the vault and secret name; the value is retrieved at run time by the platform, and makers never see it. Azure Functions read secrets through Key Vault references in their configuration or through the Key Vault client with their managed identity. Access to the vault is granted through Azure role-based access, with the secret-reader role given only to the identities that need it.
Every secret has an owner, an expiry date and a rotation procedure. Key Vault can raise events when a secret is close to expiry, and the CoE team subscribed to those. Rotation was rehearsed in test: create the new value in the external system, store it in Key Vault as a new version, confirm the integration picks it up, then revoke the old value. An integration that cannot survive a rotation without downtime is a design problem to fix before it goes live.
Secret inventory entry (design record, values never written here)
Name: LedgerPoint reporting API key (production)
Stored in: Key Vault kv-lcc-integration-prod, secret lp-reporting-key
Used by: Custom connector connection "LedgerPoint Reporting (prod)";
environment variable lcc_LedgerPointApiKey (Secret type)
Readers: Power Platform environment identity; ledgerpoint-sync function identity
Owner: Signe Tavernier-Mbeki; business owner Ysaline Dabrowski
Rotation: Every 180 days or on staff change; rehearsed in test first
Expiry alert: Key Vault near-expiry event to the CoE channel, 30 days aheadData policies and tenant boundaries
Data policies control which connectors can be used together in each environment, and Lesson 9 showed how endpoint filtering and custom connector URL patterns narrow the HTTP and custom connector routes. Tenant isolation, configured in the Power Platform admin centre, adds a boundary at the tenant level: it blocks connections that use Entra ID identities from other tenants, inbound or outbound, except for tenants on an allow list. Without it, a maker could connect a flow in Lumenvale's tenant to a storage account or mailbox in a personal or partner tenant and move data there. Lumenvale had turned tenant isolation on with an allow list containing only the partner university that shared research data.
Network controls
Identity is the main boundary in cloud services, but network controls add depth. Dataverse offers an IP firewall for Managed Environments, which limits the addresses from which the environment accepts requests, and it can be run in an audit-only mode first to see what would be blocked. Virtual network support for Power Platform, also for Managed Environments, lets plug-ins and supported connectors reach Azure resources through a delegated subnet in the organization's own virtual network, so those resources need not be exposed to the internet. On the Azure side, Function Apps, Service Bus namespaces and Key Vaults can be restricted to private endpoints or selected networks.
Network controls have to be designed together with the features that need open access. Lesson 8 noted that a Fabric workspace used by Fabric Link must allow inbound access from all networks; an IP firewall on Dataverse must allow the addresses of every legitimate integration; and some Microsoft services reach Dataverse from address ranges published as Azure service tags. Signe's advice was to start each network restriction in audit mode where available, review what it would block, and then enforce.
Securing inbound requests
Any address that accepts requests, such as a webhook receiver, an Azure Function or a flow's HTTP trigger, is reachable by anyone who learns it unless something stops them. Lesson 3 set out the receiver rules: require HTTPS, check the shared value Dataverse sends in constant time, check the organization header against the expected environment, and keep the shared value in Key Vault. Where possible, a stronger control should sit in front: Entra ID authentication on the Function App for callers that can obtain tokens, network restrictions so that only expected sources can connect, or a Service Bus queue so that there is no public receiver at all. Receivers should also limit the size of requests they accept and reject anything that does not match the expected schema.
Replay deserves a thought. A captured request sent again would look valid. Idempotent processing, which ignores identifiers already seen, limits the damage, and checking a timestamp in the payload against a short window narrows it further.
Injection and untrusted input
Integration code often builds queries from data it received: a supplier number from LedgerPoint, a building code from the alarm gateway, a search term from a user. If that text goes straight into an OData filter or a FetchXML string, a crafted value can change the meaning of the query. In OData, a single quote ends a string literal, so any quote in the value must be doubled before the value is placed inside quotes. In FetchXML, values must be XML-encoded. Better still, validate the input against the expected format first: a building code at Lumenvale is three letters, so anything else is rejected before any query is built.
// C#: validate, then escape, before putting external text into an OData filter.
static readonly Regex BuildingCode = new("^[A-Z]{3}$");
string FilterForBuilding(string code)
{
if (!BuildingCode.IsMatch(code))
throw new ArgumentException("Unexpected building code format"); // reject early
var literal = code.Replace("'", "''"); // OData quote escaping
return $"lcc_buildingcode eq '{literal}'";
}
// With ServiceClient, prefer QueryExpression conditions, which pass values as data, not text.Privacy by design
Dr. Ondaatje-Ruiz's contribution to the session was a reminder that security protects data, and the best-protected data is data that was never copied. Every integration that copies personal information creates another place where it must be secured, retained correctly and eventually deleted. Her checklist asked four questions. Does the integration need personal information at all, or would identifiers and counts do? Does every copy have a retention rule, and is it enforced? Is the destination covered by the college's privacy commitments, including where the data is stored? And is the integration listed in the privacy impact assessment for the solutions it touches?
The research link from Lesson 8 passed that review because work orders contained almost no personal information and the cost-recovery notes were excluded. A proposal to link student hold records for analysis did not pass, and was redesigned to send only aggregated counts by program and term.
Detecting misuse
Controls reduce the chance of misuse; monitoring shortens the time to notice it. Entra ID sign-in logs record each service principal and managed identity sign-in, including its source address and result. Dataverse audit history records changes by each application user, and exported API telemetry shows request volumes per user. Lumenvale's security team built alerts for sign-ins by integration identities from unexpected locations, for application users suddenly reading far more rows than usual, and for any change to the roles assigned to an application user. Each alert went to the security team and the integration's technical owner.
Supply chain and deployment
Integrations are code, and code has dependencies. Azure Functions and plug-ins use NuGet packages; custom connectors may include scripts; deployment pipelines use actions from public repositories. Lumenvale's repositories used GitHub's dependency alerts and code scanning, pinned the versions of actions in workflows, and required review of every change to a workflow file. Deployment pipelines signed in with federated credentials, so there was no deployment secret to steal, and the identity used by the production pipeline could deploy solutions but could not read business data.
Worked problem
Reviewing an over-privileged identity
A review finds that the supplier sync's application user holds the System Customizer role and a custom role with organization-level read and write on suppliers, work orders and contacts. The sync only reads and writes suppliers and writes rows to the integration error table. What should change?
Show solution
- Remove System Customizer: the sync never changes tables, forms or other customizations.
- Reduce the custom role to create, read and write on suppliers and create on the integration error table.
- Remove access to work orders and contacts, which the sync never touches.
- Check whether delete is needed: the design deactivates suppliers rather than deleting them, so it is not.
- Record the new role and the reason for each privilege in the integration documentation.
Answer: One custom role with create, read and write on suppliers and create on the error table. A stolen credential would then expose only supplier data and could not change customizations, work orders or contacts.
Security reviews as part of delivery
Security is cheapest when it is designed in. Lumenvale's integration template placed the security questions alongside the functional ones, so that a design could not reach review without its threat table, identity list, secret inventory and privacy answers. Rupert's team checked those sections at design review, again before the first production deployment, and again at the twice-yearly role review. Dr. Ondaatje-Ruiz received the privacy section for every integration that touched personal information, and her sign-off was a condition of going live. None of this required specialist tools; it required the same questions to be asked every time and the answers to be written down where the next person could find them.
Common mistakes
MistakeGiving an integration System Administrator or System Customizer to make it work.
InsteadBuild a custom role with only the privileges the integration uses, and review it twice a year.
MistakeKeeping an API key in a flow, a setting or a repository.
InsteadStore it in Key Vault and reference it through a Secret environment variable or a Key Vault reference.
MistakePutting external text straight into an OData filter or FetchXML.
InsteadValidate the format, then escape quotes or XML-encode, or pass values as query conditions.
MistakeTreating an unguessable webhook address as security.
InsteadAuthenticate every request, restrict networks where possible and process idempotently.
MistakeEnforcing a new IP firewall immediately.
InsteadRun it in audit mode first and allow every legitimate integration.
MistakeCopying personal data into analytics because it might be useful.
InsteadSend identifiers or aggregates unless the privacy assessment justifies more.
Summary and key terms
- Integrations hold non-human credentials and cross boundaries, so each needs a threat model and layered controls.
- Identity is the first boundary: managed identities, federated credentials, one application user per integration and custom least-privilege roles.
- Unavoidable secrets live in Key Vault with owners, expiry alerts and rehearsed rotation.
- Data policies, endpoint filtering and tenant isolation stop data flowing to unapproved places; IP firewall and virtual network support add network depth.
- Inbound receivers authenticate requests, check sources and resist replay; untrusted input is validated and escaped before it enters a query.
- Privacy by design limits copies of personal data, and monitoring of sign-ins, audit and request volumes detects misuse.
- Threat model
- A structured list of what could go wrong in a system, how, and which controls address each threat.
- Least privilege
- Granting an identity only the access it needs to do its job.
- Column-level security
- Dataverse profiles that control who can read or update specific columns.
- Tenant isolation
- A Power Platform setting that blocks connections using identities from other Entra ID tenants unless allowed.
- IP firewall
- A Dataverse feature for Managed Environments that restricts the network addresses allowed to access an environment.
- Injection
- An attack in which crafted input changes the meaning of a query or command built from it.
Practice problems
Work each problem on paper first, then reveal the answer to check.
What does tenant isolation prevent?
Show answer
Connections that use identities from other Entra ID tenants, unless those tenants are on the allow list.
How should a single quote in a value be handled before placing it in an OData string literal?
Show answer
Double it, after first validating the value's expected format.
Why should a new IP firewall start in audit mode?
Show answer
To see which legitimate integrations would be blocked before enforcing it.
What was changed in the student hold proposal after the privacy review?
Show answer
It was redesigned to send only aggregated counts by program and term instead of personal records.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.