Access Control
The backend, browser, identity provider, database, and Ledger API connection are all part of the security boundary. Identity and permission checks need to be anchored in trusted server-side state.
A secure Daml model can still be broken by an unsafe web application. The backend, browser, identity provider, database, and Ledger API connection are all part of the security boundary.
- Use a maintained OIDC or OAuth 2.0 library.
- Validate token signature, issuer, audience, expiry, and token type.
- Use short-lived access tokens.
- Require phishing-resistant MFA for administrators.
- Map the authenticated user to ledger parties on the server.
- Never trust
actAs,readAs, tenant ID, role, or owner from the request body. - Check permission for every read, command, export, search, and admin action.
- Use deny-by-default rules.
- Give each service only the ledger rights it needs.
- Test users with the same role against each other's records.
Digital Asset's Ledger API authorization guide explains how participant nodes validate access tokens and ledger permissions.
01await ledger.submit({02 actAs: req.body.party,03 commands: req.body.commands04});01const party = await rightsForUser(req.auth.sub);02const commands = validateAllowedCommands(req.body.commands);03 04await ledger.submit({05 actAs: [party],06 commands07});