Secure a MuleSoft API in four layers: authenticate every caller at the gateway, limit what each caller can do, keep secrets out of code and configuration files, and log every call in a place that cannot be altered by the people who run the API. Examiners rarely ask about the product. They ask who can call this API, how you know, what stops abuse, and where the proof is. The checklist below is organised the same way.
Policies to apply at the gateway
MuleSoft's API Manager offers a set of built-in policies, and you can write custom ones. Check the current policy list for your version, as names and options change. Tests against the OWASP API Security Top 10 are a good independent yardstick.
| Control | Typical policy | Examiner question it answers |
|---|---|---|
| Authenticate callers | Client ID enforcement, OAuth 2.0 token validation or JWT validation | Who can call this API, and how do you know it is them? |
| Limit who can do what | Scopes or claims checked per operation | Can a caller use only what it was approved for? |
| Block abuse | Rate limiting or throttling, per client | What stops one client from overloading the service or scraping data? |
| Restrict sources | IP allow list | Can the API be reached from anywhere? |
| Reject bad input | Payload size limits, JSON or XML threat protection, schema validation | What happens when someone sends a malformed or hostile request? |
| Protect browsers | Cross-origin rules | Can any website call the API from a user's browser? |
| Hide internals | Header removal, error message control | Do error messages reveal system details? |
| Encrypt in transit | TLS on every hop, including to the back end | Is data encrypted between each system? |
- Every API has an authentication policy. No exceptions without a written reason.
- Policies are applied by a script or template, so a new API starts secure.
- Policy versions are recorded, with the date of each change.
- A test proves each policy: a missing token is rejected, an expired token is rejected, a limit is enforced.
- Back-end systems accept calls only from the gateway, not from anywhere.
Secrets and key handling
| Item | Good practice | Evidence |
|---|---|---|
| Passwords, keys and tokens in flows | Never in source code or plain property files | Code review result, secret scan result |
| Property encryption | Use secure configuration properties or a secrets service, such as Anypoint Secrets Manager, or your own vault | Configuration of the chosen store |
| Encryption key for properties | Held apart from the encrypted files, and not in the same repository | Who holds the key, and how it is rotated |
| Client secrets for APIs | Issued per client, revocable | Client list with issue date and owner |
| Certificates | Inventory with expiry dates and an owner | Expiry report, alerts at 30 and 7 days |
| Rotation | Scheduled, and tested before it is needed | Last rotation date per secret |
| Access to the platform | Single sign-on, multi-factor sign-in, least-privilege roles | Role list and review date |
- A secret scan runs on every repository that holds flows.
- Departing staff lose platform access on the day they leave.
- A lost or leaked key can be revoked in minutes, and the steps are written down.
Audit logging
Log enough to answer "who called what, when, and what happened", and no more personal data than you need.
- Log caller identity, API, operation, time, result code and a correlation ID for every call.
- Do not log full payloads that contain personal or health data unless you have a reason and a control. Mask sensitive fields.
- Send logs to a store the API operators cannot edit or delete, and set retention to your policy.
- Log platform changes too: policy edits, deployments, role changes. MuleSoft's access management and platform audit features cover part of this, so check what is kept and for how long.
- Alert on unusual patterns, such as a burst of rejected calls or a new caller. See the monitoring runbook.
- Test that you can trace one call from the caller through the gateway to the back end.
Review checklist for examiners
Keep this pack ready, and refresh it each quarter.
| Item | What to show |
|---|---|
| API inventory | Every API, owner, data class, environment |
| Policy map | Which policies apply to which API, with test results |
| Access list | Who can change policies, deploy and read logs |
| Secrets register | Where each secret lives, last rotation, owner |
| Certificate list | Expiry dates and owners |
| Log sample | A traced call, from caller to back end |
| Incident record | Last incident, what was done, what changed |
| Change record | Last policy change, with approval |
| Third-party APIs | Which ones you front, and the controls, as in Flex Gateway or proxies |
The pack should be something a new person can read without help. If it takes a conversation to explain, it is not yet evidence. For wider AI agent traffic through the same gateways, see AI gateway and agent governance.
Questions we hear
Which policies should every MuleSoft API have? At minimum, caller authentication, rate limiting and input limits, plus TLS on every hop and logging. Add scope checks and IP restrictions where the risk calls for them.
Where should secrets be stored? Never in source code or plain property files. Use encrypted properties, a secrets service or your own vault, and keep the key apart from the data.
What do examiners usually ask for? An API inventory, proof that authentication is enforced, who can change policies, how secrets are rotated and a traced call in the logs.
Are gateway policies enough on their own? No. You also need network controls, secure back ends, identity management and monitoring.
A first engagement
Duczer East offers a security control review: we check each API against the list below, test the policies, and hand back a gap list with the evidence an examiner would ask for.
Sources checked November 27, 2026:



