Growing a SaaS Product

Roles, Permissions and Audit Logs for SaaS: What Enterprise Buyers Check

The first large customer usually arrives with a security questionnaire. Many of its questions ask who can do what in your product, and how you would know if someone did something they shouldn’t. Here is how to design roles, enforce permissions and keep audit logs that stand up to that review.

By Rahul D SarkerPublished November 28, 2026Updated November 28, 202631 min read

Part of our Growing a SaaS Product series. Start with Product Strategy Frameworks: From Idea to Decision-First Roadmap.

Figures come from the sources linked under each claim, checked on 28 November 2026. Where we give our own view, from building permission systems and audit logs into client products, we say so. This guide is about software design; it is not legal advice on UK GDPR or any certification.

Read the transcript

One hundred percent. That’s the share of applications OWASP tested that had some form of broken access control. It’s the number one risk on the web. And it’s the first thing enterprise buyers check. Most products start with one flag. Admin, or not. Then the first big customer sends a security questionnaire, and asks who can do what. So how do you build access control that passes an enterprise security review?

Part one. Roles and permissions. There are four ways to decide access. Roles. Roles scoped to a project. Relationships, like owner of a folder. And attributes, like region or time. Most B2B products start with scoped roles. Start with permissions, not roles. Name every action. Then group them into four to six roles. Keep powerful actions with admins. Make the default safe. And write it down.

Part two. Enforcing it. The most common bug is a check on the role, but not on the record. Change the number in the URL, and you’re reading another customer’s invoice. So every request takes the same path. Authenticate. Load the record inside the customer’s own tenant. Check the permission. Then act, or deny. And record it. OWASP’s guidance is blunt. Deny access by default. Check permissions on every request. And never trust a check made in the browser.

Part three. Identity and leavers. Large customers want people to sign in with single sign-on, and to be removed automatically with SCIM. When someone leaves, end their sessions and tokens too. A live session is still access. Your own staff are users too. Shared support logins fail every review. Buyers prefer access they grant, for a limited time, recorded in their own audit log.

Part four. The audit log. An audit log records actions that matter. Role changes, exports, deletions, sign-ins. Each event says when, where, who and what, and whether it worked. Never passwords or tokens. Not every actor is a person. API keys, integrations and AI agents change data too. Record the agent, and the user it acted for. A log that can be edited proves nothing. Make it append-only. And keep it. The NCSC suggests at least six months, because intrusions take an average of a hundred and one days to find.

Part five. Proving it. Buyers will ask for your role matrix, how tenants are separated, and who can see their data. Show them tests that try to read another tenant’s data, a recent penetration test, and an audit log they can export.

So, what do buyers check? That every request is checked, every customer is kept apart, and every important action is recorded. Start the audit log now. You can’t log the past. The full guide, with six working tools, is free at loomstrat.com.

In this guide25 sections
  1. 01The short answer
  2. 02Why buyers care
  3. 03The words that matter
  4. 04Four access models
  5. 05Designing your roles
  6. 06Keeping customers apart
  7. 07Enforcing permissions
  8. 08Custom and scoped roles
  9. 09SSO, SCIM and leavers
  10. 10Admins, support and break-glass
  11. 11API keys, integrations and AI agents
  12. 12What an audit log records
  13. 13Anatomy of an audit event
  14. 14Protecting the log
  15. 15How long to keep it
  16. 16The customer-facing audit log
  17. 17Access reviews
  18. 18Testing access control
  19. 19Passing the security review
  20. 20Build or buy
  21. 21A plan in four stages
  22. 22Ten mistakes to avoid
  23. 23Glossary
  24. 24Questions and answers
  25. 25Sources and method

The short answer

What do enterprise buyers expect from a SaaS product’s roles, permissions and audit logs?

They expect a small, documented set of roles built on least privilege, with permissions checked on the server for every request and every customer’s data kept strictly apart. Larger buyers want roles scoped to teams or projects, single sign-on with SCIM so leavers lose access automatically, and controlled, logged support access. They expect an audit log that records who did what, to which record, from where, when and whether it worked; that cannot be edited; that is kept for at least six months, and often a year; and that their own admins can search and export. Broken access control is the top risk in OWASP’s 2025 Top 10, so reviewers test it first.

Access control is the part of a product that decides who can see and change what. In a small product with a handful of users it can be a single “is admin” flag. Once you sell to companies with hundreds of staff, departments, contractors and auditors, that flag stops being enough. Buyers need to give each person the access their job requires and no more, and they need to prove afterwards who did what.

Two things make this hard to retrofit. Permission checks end up scattered through the code, so tightening them means touching almost every endpoint. And audit logging only helps for events you recorded at the time: you cannot go back and log last year. Both reward getting the design right early.

This guide covers the design decisions and the engineering behind them, in the order you would meet them. There are six working tools: an access model chooser, a role matrix that flags what a security reviewer would question, an authorisation check simulator, an audit event builder, a retention calculator and an enterprise readiness checklist.

Key facts

Checked 28 November 2026

Top risk
Broken access control is ranked first in the OWASP Top 10:2025, as it was in 2021. OWASP Top 10:2025
How common
OWASP reports that 100% of applications tested had some form of broken access control, with 1,839,701 occurrences across 40 weakness types. OWASP Top 10:2025
Deny by default
OWASP says applications should be configured to deny access by default and validate permissions on every request. OWASP Authorization Cheat Sheet
What to log
OWASP’s logging guidance says logs must record when, where, who and what for each event. OWASP Logging Cheat Sheet
Keep logs
The NCSC suggests keeping logs for at least six months, noting an average of 101 days before an intrusion is detected. NCSC
User provisioning
SCIM, the standard for syncing users from identity providers, is defined in RFC 7643 and RFC 7644, published in September 2015. IETF
UK GDPR
The ICO expects personal data to be accessed only by those you have authorised, acting within the scope of that authority. ICO
RBAC standard
Role-based access control was adopted as the ANSI/INCITS 359 standard in 2004 and revised in 2012. NIST

Why buyers care

When a company buys software that will hold its data, its security team becomes responsible for that data in a system it does not control. It cannot read your code. So it asks questions, usually in a long questionnaire, and asks for evidence. Access control and logging are near the top of every such questionnaire, for three reasons.

It is where applications most often fail. The OWASP Top 10:2025 ranks broken access control as the number one web application security risk. OWASP reports that every application it tested had some form of it: 1,839,701 occurrences across 40 related weakness types, with an average incidence rate of 3.74%. In the 2021 edition, where it also ranked first, the figure was 94% of applications tested. Security teams know these numbers, and many will test your product themselves or ask for your latest penetration test.

The law expects it. Under UK GDPR, a buyer that puts personal data into your product still has to keep it secure. The ICO’s guide to data security says organisations should make sure data can be accessed “only by those you have authorised to do so (and that those people only act within the scope of the authority you give them)”. It also quotes Article 32’s requirement for “appropriate technical and organisational measures to ensure a level of security appropriate to the risk”. A buyer cannot meet that if your product only has one kind of user.

Breaches start with access. Verizon’s 2026 Data Breach Investigations Report finds that 31% of breaches begin with the exploitation of software vulnerabilities. When something does go wrong, the audit log is how the customer’s security team works out what happened and whom they need to tell. If the log is missing or incomplete, they cannot answer either question.

#1Broken access control is the top risk in the OWASP Top 10:2025OWASP
100%of applications OWASP tested had some form of broken access controlOWASP Top 10:2025
101 daysaverage time to detect an intrusion, cited by the NCSCNCSC

In our experience the commercial effect is simple. A product with documented roles, enforced permissions and a usable audit log gets through security review in weeks. A product without them can lose the deal, or win it with a list of promised features and a deadline.

The words that matter

These terms get mixed up constantly, including in security questionnaires. It helps to use them precisely in your own documentation.

Access control vocabulary
TermWhat it meansExample
AuthenticationProving who someone isPassword and passkey, or SSO through Okta
AuthorisationDeciding what an authenticated person may doCan Priya delete this invoice?
PermissionOne action on one kind of resourceinvoice.delete
RoleA named bundle of permissionsBilling Admin
ScopeWhere a role appliesAdmin in the Marketing workspace only
TenantOne customer’s isolated spaceAcme Ltd’s organisation
Least privilegeGiving only the access a job needsSupport can read tickets but not export them
Audit logA tamper-resistant record of security-relevant actionsPriya changed Sam’s role at 09:14 UTC

Authentication is covered in our SaaS authentication guide. This guide starts once you know who the user is. Least privilege is the principle behind everything that follows. NIST defines it as “a security principle that a system should restrict the access privileges of users… to the minimum necessary to accomplish assigned tasks.”

Four access models

There are four common ways to decide whether a request is allowed. They are not exclusive: most mature products combine two of them.

Role-based access control (RBAC). Each user has one or more roles, and each role grants a set of permissions. NIST’s RBAC project describes it simply: “each user is assigned one or more roles, and each role is assigned one or more privileges”. The model became a US national standard, ANSI/INCITS 359, in 2004. RBAC is easy to explain to buyers, easy to document and easy to audit, which is why almost every B2B product starts with it.

Roles scoped to resources. The same idea, but a role is held in a particular place: an organisation, a workspace, a project or a team. A person can be an admin in one project and a viewer in another. This is what most B2B SaaS products need once customers grow past a single team, and it is still recognisably RBAC, so buyers understand it.

Relationship-based access control (ReBAC). Access follows relationships between users and objects: owner of, member of, parent of, shared with. If you can edit a folder, you can edit what is inside it. Document tools, file storage and anything with sharing or nested structures fit this model naturally.

Attribute-based access control (ABAC). Rules look at attributes of the user, the resource and the request: department, data classification, region, time, device. It is the most flexible model and the hardest to reason about, test and explain in a questionnaire.

The OWASP Authorization Cheat Sheet goes further than most guidance and says “ABAC and ReBAC should typically be preferred for application development”, because pure roles tend to multiply and cannot express rules about individual records. Our own view is a little more cautious: start with scoped roles, which cover most B2B needs, and add relationship rules where sharing or hierarchy genuinely requires them. Whatever the model, the check must look at the specific record, not just the role.

Decision tool

Which access model does your product need?

Tick what your customers ask for. The tool suggests the simplest model that covers it. Start simple: you can add scopes and relationships later, but removing complexity is hard.

Suggested starting point

Plain roles (RBAC)

A small fixed set of roles, each a bundle of permissions. Easy to explain to buyers and easy to audit.

Example: Owner, Admin, Member, Viewer across the whole account.

Plain roles
Roles scoped to resources
Relationship-based
Attribute-based
Our weighting, from building permission systems into client SaaS products. Many products combine models, for example scoped roles with a few relationship rules for sharing.
How the four models compare
RBACScoped rolesReBACABAC
Decides byUser’s rolesRoles held in a placeRelationships to the objectAttributes and context
Easy to explain to buyersYesYesMostlyHarder
Handles record-level sharingNoPartlyYesYes
Handles context like region or timeNoNoNoYes
Risk of role explosionHigh as customers growMediumLowLow
Typical fitEarly products, simple teamsMost B2B SaaSDocuments, files, sharingRegulated and high-security data

Designing your roles

Good role design starts with permissions, not roles. List every action in your product that changes data, exposes data or changes security settings, and give each one a name such as invoice.read, invoice.delete or member.invite. Then group them into roles that match real jobs at your customers.

  1. 1

    List the actions

    Walk through the product and write down every action as a permission. Include the dangerous ones that are easy to forget: export, bulk delete, API key creation, integration settings, SSO configuration and changing roles.

  2. 2

    Keep roles few

    Four to six built-in roles cover most products: Owner, Admin, Member, Viewer and perhaps a specialist role such as Billing. Every extra role is something a buyer has to understand and an auditor has to review.

  3. 3

    Separate powerful actions

    Changing roles, configuring SSO, exporting all data and deleting the account should sit with Owner and Admin only. Billing usually deserves its own role, because finance staff need invoices but not customer data.

  4. 4

    Make the default safe

    New users should get the least powerful role that lets them start working. Invitations should default to Member or Viewer, never Admin.

  5. 5

    Write it down

    Publish the role matrix in your help centre. Enterprise buyers will ask for it, and writing it down exposes inconsistencies before a reviewer does.

Interactive matrix

Design a role matrix and see what a security reviewer would flag

Click a cell to grant or remove a permission. The Owner row is fixed: someone must always be able to recover the account. Each change updates the reviewer’s warnings.

PermissionOwnerAdminMemberViewerBilling
View records
Create and edit records
Delete records
Export data
Invite and remove users
Change roles
Manage billing
Configure SSO
View audit log

0

issues a reviewer would raise

2 roles can change roles. Keep that number small.

Clean. Each role does one job, and powerful actions stay with Owner and Admin.

The five roles and nine permissions are a typical starting set for B2B SaaS, not a standard. The checks are the questions enterprise security questionnaires most often ask about access.

The warnings in the matrix are the questions we see most often in enterprise security questionnaires. Who can export all data? Who can change roles, and is that change logged? Who can change SSO? Each has a good answer if you design for it, and an awkward one if you discover it during the review.

Keeping customers apart

In a multi-tenant product, the most damaging access bug is not a member doing an admin’s job. It is one customer seeing another customer’s data. Roles do not prevent this. A user can be a perfectly legitimate admin in their own organisation and still read someone else’s invoices if the code looks up records by ID without checking whose they are.

OWASP calls this an insecure direct object reference. The Authorization Cheat Sheet tells developers to “perform access control checks on every request for the specific object or functionality being accessed”. In practice that means three habits:

  • Scope every query. Every database query that returns customer data includes the tenant identifier, taken from the user’s session, never from the request.
  • Use the database as a backstop. Where your database supports it, row-level security policies enforce the tenant filter even if application code forgets it.
  • Avoid guessable identifiers. Random identifiers make enumeration harder. They are not a control on their own, but they slow down anyone trying sequential numbers.

Our multi-tenant architecture guide covers the choice between shared tables, separate schemas and separate databases. Whichever you choose, the tenant check belongs in shared code, not in each endpoint.

Enforcing permissions

A well-designed role matrix is worthless if the code does not enforce it consistently. The OWASP Authorization Cheat Sheet sets out the rules most reviewers check against:

  • Deny by default. “For security purposes an application should be configured to deny access by default.” A new endpoint with no rule should refuse access, not allow it.
  • Check every request. “Permission should be validated correctly on every request.” OWASP adds that checking “just the majority of requests is insufficient”: attackers look for the one endpoint you missed.
  • Check on the server. “Developers must never rely on client-side access control checks.” Hiding a button is good design, but the API behind it must still refuse.
  • Apply least privilege in both directions. Horizontally, so users cannot reach other users’ or tenants’ records, and vertically, so they cannot reach admin functions.

Simulator

Follow one request through an authorisation check

A user asks for /api/invoices/8812. Change who they are, what they want to do and whose invoice it is. Then switch between a naive check and a safe one to see broken access control happen.

User’s role

Action

Whose invoice

Signed in

  1. Request carries a valid session
  2. Organisation not checked: the ID in the URL is trusted
  3. Member role includes “edit”

Allowed, and that is a data breach

The user’s role is fine, but the invoice is not theirs. Without an ownership check, changing the number in the URL exposes other customers’ data.

Deny by default: every check must pass before access is allowed. The naive version is the pattern behind most insecure direct object reference (IDOR) bugs, which OWASP files under broken access control.

The simulator shows the most common failure. With the naive check, a Member who edits an invoice is allowed whether or not the invoice belongs to them, because the role grants “edit” and nothing checks ownership. Switching to the safe check stops the request before the role is even considered.

The practical fix is architectural. Put every permission decision behind one function or service, such as can(user, action, object), and call it from every endpoint, background job and export. When the rules live in one place, you can test them, review them and change them without hunting through the codebase. When they are scattered, every new feature is a new chance to forget.

Two smaller decisions come up in every review. The first is what to return when access is refused. For records in another tenant, return the same “not found” response you would give for a record that does not exist. A 403 confirms the record is there, which tells an attacker their guess was right. Inside the user’s own organisation, a clear 403 with a message such as “You need the Admin role to change billing” is better, because it tells a legitimate user what to ask for.

The second is speed. Permission checks run on every request, so teams are tempted to cache them. Caching is fine, but a cached “allowed” must expire quickly when roles change, or a demoted admin keeps their powers for the life of the cache. Our rule of thumb is that a role change or deprovisioning should take effect within a minute, and immediately for the person whose access was removed.

“If you cannot point to the one place in the code where a permission decision is made, a reviewer will assume there isn’t one.”

- Our view, from reviewing client codebases before enterprise security assessments

Custom and scoped roles

The first enterprise customer often asks for a role you do not have: a team lead who can approve but not delete, an external auditor who can read everything but change nothing, a regional manager who sees only their region. There are two sustainable ways to say yes.

Scoped roles let a customer assign your existing roles per workspace, project or team. This answers most requests without new roles, because the problem is usually where someone has access rather than what they can do.

Custom roles let a customer build their own role from your permission list. This is powerful and popular with large buyers, but it has costs. Every new permission you add must be placed into customers’ custom roles, or they silently miss features. Customers can create roles that make no sense, such as delete without read. And support becomes harder, because no two customers are configured the same way.

If you offer custom roles, keep the permission list stable and well named, give each permission a plain description, prevent combinations that cannot work, and show the effective permissions of any user on one screen. Changes to custom roles must be audited like any other security change.

SSO, SCIM and leavers

Large customers do not want to manage your product’s users by hand. They want people to sign in through their identity provider, and they want access to end when someone leaves. That is two features: single sign-on, which handles login, and SCIM, which handles the user list.

SCIM, the System for Cross-domain Identity Management, is an open standard. RFC 7643 defines the schema for users and groups and RFC 7644 defines the protocol, “an HTTP-based protocol that makes provisioning and management of identity data on the web easier”. Both were published in September 2015. With SCIM, the customer’s identity provider creates, updates and deactivates users in your product automatically.

Two details matter for access control. First, deprovisioning must take effect quickly. When SCIM deactivates a user, end their sessions and revoke their API tokens, not just their ability to sign in again. A leaver with a live session still has access. Second, map identity provider groups to your roles. If the customer can say “everyone in the Finance group gets Billing” in their identity provider, they manage access in one place and their auditors can check it there.

SSO and SCIM configuration are among the most powerful settings in your product. Restrict them to Owner and Admin, log every change, and consider requiring a second admin to confirm changes that could lock everyone out.

Admins, support and break-glass

Your own staff are users too. Support engineers need to see what a customer sees to help them, and engineers need to fix data problems. Enterprise buyers will ask exactly who at your company can access their data and how that is controlled.

Ways your staff access customer data
ApproachHow it worksWhat buyers think
Shared admin loginStaff sign in to customer accounts with a common credentialFails review. No individual accountability
Database accessEngineers query production directlyAccepted only with strict controls and logging
ImpersonationStaff view the product as a customer userAccepted if logged, visible to the customer and time-limited
Customer-granted accessThe customer switches on support access for a periodPreferred by most enterprise buyers
Break-glassEmergency access with approval and alertsExpected for incidents, if every use is reviewed

Our recommendation is customer-granted, time-limited support access, recorded in the customer’s own audit log as your staff member, not as the customer’s user. The customer sees that support looked at their account, when and why. Keep a break-glass route for genuine emergencies, require approval or at least an immediate alert, and review every use.

Inside your company, apply the same least-privilege thinking: few people with production access, named accounts rather than shared ones, multi-factor authentication everywhere, and a regular review of who still needs access.

API keys, integrations and AI agents

Not every actor in your product is a person. API keys, connected integrations, scheduled jobs and, increasingly, AI agents all read and change data. Each needs permissions, and each needs to appear in the audit log as itself.

API keys should carry their own scopes, chosen when the key is created, rather than inheriting everything the creating user can do. A key that only syncs contacts should not be able to delete the account. Show admins every active key, who created it, its scopes and when it was last used, and let them revoke it. Creating, using for the first time and revoking a key are all audit events.

Integrations connected with OAuth should request the narrowest scopes they need. When an integration acts, the audit log should name the integration and the person who connected it, so a customer can tell “Sam deleted 400 contacts” from “the CRM sync Sam connected deleted 400 contacts”.

AI agents raise the same question in a sharper form. When an agent inside your product drafts, updates or sends something on a user’s behalf, it should act with that user’s permissions or fewer, never more. In our view the audit event should record both identities: the agent as the actor and the user it acted for. Customers deploying agents will ask exactly what they did, and “the system” is not an answer an auditor accepts.

Recording non-human actors
ActorPermissions come fromAudit log should show
API keyScopes chosen when the key is createdKey name and ID, plus who created it
OAuth integrationScopes the user approvedIntegration name, plus who connected it
Scheduled jobA service identity with fixed permissionsJob name, and the setting that triggered it
AI agentThe user it acts for, possibly narrowedAgent as actor, user as “on behalf of”
SCIMThe identity provider connectionSCIM as actor, plus the identity provider

What an audit log records

An audit log is not your application log. Application logs help engineers debug; they are noisy, short-lived and full of technical detail. An audit log is a curated record of actions that matter for security and accountability, kept for months or years and readable by the customer.

The OWASP Logging Cheat Sheet lists events that should always be logged where possible, including “authentication successes and failures”, “authorization (access control) failures” and “user administration actions such as addition or deletion of users, changes to privileges”. For a B2B product, we group audit events into five families:

Five families of audit events
FamilyExamples
IdentitySign-in success and failure, MFA changes, password resets, SSO sign-ins, sessions revoked
AccessUser invited, removed or suspended; role changed; custom role edited; SCIM sync changes
Security settingsSSO configured, allowed domains changed, API keys created or revoked, IP allow-lists edited
DataBulk export, bulk delete, records shared externally, integrations connected
Support and systemSupport access granted and used, break-glass access, retention settings changed

You do not need to log every page view. Reading a single record is usually too frequent and too low-risk for the audit log, though some regulated buyers will ask for read access to sensitive records. Start with every change to access and security settings, every export, every deletion and every failed authorisation attempt on sensitive actions.

Anatomy of an audit event

OWASP’s guidance is that logs must record “when, where, who and what” for each event. For an audit log that customers will rely on, that translates into a consistent structure.

  • When: a precise timestamp in UTC. The NCSC recommends consistent time sources and UTC so events from different systems can be lined up.
  • Who: the actor, with a type (user, API key, SCIM, support staff, system) and a stable identifier, plus the organisation.
  • What: a dotted action name such as role.updated, the target resource, the values before and after, and whether it succeeded.
  • Where: the IP address, user agent and a request identifier that links to your application logs.

Builder

Build an audit log event an enterprise customer can use

An admin has just promoted a member to admin. Choose what the audit event records. OWASP’s logging guidance asks for when, where, who and what. Try adding the fields that should never be logged.

Should never be logged

75/100

Useful for an investigation

{
  "occurred_at": "2026-11-28T09:14:03.412Z",
  "actor": { "type": "user", "id": "usr_41c9" },
  "organization_id": "org_7d20",
  "action": "role.updated",
  "target": { "type": "membership", "id": "mem_88a1" },
  "outcome": "success"
}

An investigator would still ask: before and after, IP address and user agent, request ID.

Field names follow common practice, not a formal standard. Example values are invented. OWASP lists session identifiers, access tokens and passwords among data that should not be recorded directly in logs.

Just as important is what stays out. OWASP lists data that “should usually not be recorded directly in the logs”, including session identifiers, “access tokens” and “authentication passwords”. Audit logs are exported, streamed to customers’ security tools and read by many people. A secret in an audit log is a secret published. Mask or hash anything sensitive, and think twice before logging the full content of records, which may contain personal data you then have to manage under UK GDPR.

Protecting the log

An audit log is only useful if people trust that nobody could have changed it. If an attacker or an insider can edit or delete events, the log proves nothing. The OWASP Logging Cheat Sheet recommends building in tamper detection “so you know if a record has been modified or deleted”, copying log data to read-only storage as soon as possible, and restricting and periodically reviewing who can read log data.

In practice that means:

  • Append-only storage. The application can add events but has no code path to update or delete them. Use storage with write-once or object-lock features for the long-term copy.
  • Separate permissions. The service that writes audit events should not be able to delete them, and engineers who can change production should not be able to quietly edit the log.
  • Tamper evidence. Chaining each event’s hash to the previous one, or signing batches, lets you show that no event has been removed or altered.
  • Protection in transit. The NCSC recommends encrypting logs in transit and restricting who can read and write them.
  • Audit the audit log. Viewing and exporting the audit log, and changing its retention, are themselves audit events.

How long to keep it

The NCSC’s introduction to logging suggests keeping logs for at least six months, and points to an average of 101 days between an intrusion and its detection. A log that only goes back thirty days may not cover the start of an incident that is found three months later.

Enterprise contracts often ask for a year, and buyers in regulated sectors may ask for longer. The answer does not need to be the same for everyone. Many products keep a fixed period on standard plans, offer longer retention on enterprise plans, and let customers stream events to their own storage for as long as they like.

Calculator

How much audit data will you keep?

Estimate the size of an audit log at a given retention period. Most products log far fewer audit events than application events, so this is usually smaller than people fear.

80,000

audit events a day

29.2 m

events held at any time

35 GB

uncompressed storage

Meets the NCSC’s suggested minimum of six months. Many enterprise contracts ask for one year, and some regulated buyers ask for more.

Event size is an assumption: a JSON event with the fields in the builder above is typically around 1 KB before compression. Storage cost depends on your provider and whether older events move to cheaper storage.

Storage is rarely the constraint. A product with a few thousand active users generating dozens of audit events each a day produces gigabytes a year, not terabytes. The harder questions are search speed over long periods, which usually means moving older events to cheaper storage, and deletion: when a customer leaves, their audit log must be deleted along with their other data, according to your contract and privacy policy.

The customer-facing audit log

Recording events is half the job. Enterprise buyers expect their own admins to use the log without asking you. A good customer-facing audit log has four parts:

  1. 1

    A screen admins can search

    Filter by person, action, date range and target. Show events in plain language, such as “Priya changed Sam’s role from Member to Admin”, with the raw details a click away.

  2. 2

    Export

    Let admins download events for a period as CSV or JSON, for investigations and auditors.

  3. 3

    An API

    Let the customer’s security team pull events on a schedule into their own tools.

  4. 4

    Streaming

    For the largest customers, push events as they happen to their security information and event management (SIEM) system or storage.

Plan which tiers get which parts. Many products include a basic audit log screen on business plans and reserve long retention, the API and streaming for enterprise plans. Whatever you decide, write it down: “Do you provide an audit log, and how long is it kept?” appears in almost every security questionnaire we have seen.

Access reviews

Access tends to grow. People change teams and keep their old permissions; contractors finish and stay in the account; a temporary admin grant becomes permanent. Many enterprise customers run periodic access reviews, often quarterly for sensitive systems, in which a manager confirms that each person still needs their access. Your product can make that easy or painful.

At minimum, give admins a single view of every user, their role in each workspace, how they signed in and when they were last active, and let them export it. Better products flag accounts that have not been used for a set period, show external guests separately and let admins set time limits on elevated access, so a temporary admin reverts automatically.

Apply the same discipline internally. Review who at your company has production access and support access on a fixed schedule, remove what is no longer needed, and keep a record that the review happened. Buyers ask for evidence of both: that you review your own staff’s access, and that your product helps them review theirs.

Testing access control

Access control bugs rarely show up in normal use, because legitimate users do not try to read other customers’ invoices. They have to be looked for. OWASP calls logging “one of the most important detective controls” and recommends unit and integration tests for authorisation logic.

  • Test the matrix. For every role and permission pair, write a test that confirms allowed actions succeed and forbidden ones fail. Generate these tests from the same matrix your documentation uses, so they cannot drift apart.
  • Test across tenants. Create two organisations in your test suite and, for every endpoint, try to read and change the second organisation’s records with the first one’s users. Every one should fail.
  • Test new endpoints by default. A test that lists every route and fails if one has no authorisation rule catches the forgotten endpoint before it ships.
  • Test the audit trail. For each sensitive action, assert that the right audit event is written with the right actor and target.
  • Get an independent test. A penetration test that specifically covers access control and tenant isolation is the evidence most buyers ask for. Our penetration testing guide explains how to scope and buy one.

Passing the security review

Enterprise security questionnaires vary in length, but the access control and logging questions are remarkably consistent. Expect to be asked:

  1. Which roles exist, and what can each do? Can you share the matrix?
  2. How is each customer’s data kept separate from other customers’?
  3. Is access enforced on the server for every request?
  4. Do you support SSO with SAML or OIDC, and SCIM provisioning?
  5. What happens to a user’s sessions and tokens when they are deprovisioned?
  6. Who at your company can access our data, and how is that approved and logged?
  7. What does your audit log record, how long is it kept, and can we export it?
  8. How are logs protected from tampering?
  9. When was your last penetration test, and did it cover access control?
  10. How do you review your own staff’s access?

Prepare written answers once and keep them current. A short security page or trust centre that covers these points saves weeks on every deal. Buyers also often ask about frameworks such as ISO 27001 and SOC 2. Both cover access control and logging, so the work in this guide feeds directly into them, but neither certificate replaces good answers to the questions above.

Checklist

Would your access controls pass an enterprise security review?

Ten things enterprise security teams look for when they assess a SaaS vendor. Tick what you could show evidence for today.

26out of 100

Fix the foundations before selling upmarket

Fix these first

  1. Scope every database query to the tenant, so one customer can never read another’s data by changing an ID.
  2. Log role changes, logins, exports, deletions and settings changes with who, what, when and where.
  3. Add tests that try to read and change another tenant’s data, and run them on every release.
Our weighting, from preparing client products for enterprise security reviews. Server-side checks and tenant isolation carry the most weight because failures there expose customer data.

Build or buy

Most products should build their role model and permission checks themselves, because they are tightly bound to the product’s own objects. What you can buy is the machinery around them.

What to build and what to buy
PartUsually buildConsider buying when
Role matrix and permission namesYes: it is your productNever; it is your domain
Policy engineSimple role checks in shared codeYou need ReBAC or ABAC at scale, or policies changed without deploys
SSO and SCIMPossible with librariesYou want many identity providers working quickly
Audit log storage and searchPossible for small volumesYou need long retention, streaming and fast search across years
Customer audit log screenOften, to match your productAn embeddable component from your audit provider is good enough

Open-source authorisation engines such as OpenFGA implement relationship-based models, and hosted services exist for authorisation, enterprise SSO and audit logs. They can save months. They do not remove the design work: you still decide the roles, the permissions and which events matter, and you still need tests that prove your product calls them on every request.

A plan in four stages

Checklist

Getting access control enterprise-ready

The order we use with clients preparing for their first enterprise deals.

0 of 16 done. Current stage: Design.

Stage 1 · Design

Stage 2 · Enforce

Stage 3 · Connect

Stage 4 · Prove

Ten mistakes to avoid

  1. Checking roles but not ownership. The role allows editing invoices; nothing checks the invoice is theirs.
  2. Trusting the client. A hidden button is not a permission check.
  3. Allow by default. New endpoints should be closed until a rule opens them.
  4. Permission checks scattered through the code. Nobody can review what they cannot find.
  5. A new built-in role for every big customer. Use scoped or custom roles instead.
  6. Deprovisioning that leaves sessions alive. Leavers keep access until their token expires.
  7. Shared support logins. No accountability, and an instant fail in review.
  8. Secrets in the audit log. Tokens and passwords in logs become everyone’s tokens and passwords.
  9. An editable audit log. If it can be changed, it proves nothing.
  10. Starting the audit log when the first enterprise customer asks. You cannot log the past.
Access control
The rules and mechanisms that decide who can see and change what in a system.
Authorisation
Deciding whether an authenticated user may perform a specific action on a specific resource.
Permission
A single allowed action on a type of resource, such as invoice.delete.
Role
A named group of permissions assigned to users.
RBAC
Role-based access control: access decided by the roles a user holds.
ReBAC
Relationship-based access control: access decided by relationships between users and objects.
ABAC
Attribute-based access control: access decided by rules over user, resource and request attributes.
Least privilege
Giving each user only the access their tasks require.
Tenant isolation
Keeping each customer’s data inaccessible to other customers.
IDOR
Insecure direct object reference: accessing a record by changing its identifier because ownership is not checked.
SCIM
System for Cross-domain Identity Management: a standard for syncing users and groups from identity providers.
Deprovisioning
Removing a user’s access when they leave or change role.
Break-glass access
Emergency access to systems or data, used rarely and reviewed every time.
Audit log
A tamper-resistant record of security-relevant actions: who did what, to what, when, where and with what outcome.
SIEM
Security information and event management: tools that collect and analyse security events from many systems.

Questions and answers

What is the difference between authentication and authorisation?

Authentication proves who a user is, for example with a password, passkey or single sign-on. Authorisation decides what that user is allowed to do once signed in, such as viewing, editing or deleting a particular record. Enterprise security reviews ask about both separately.

Should a SaaS product use RBAC or ABAC?

Most B2B products should start with role-based access control scoped to workspaces or projects, because it is easy to explain and audit. Add relationship-based rules for sharing and hierarchies, and attribute-based rules only where context such as region or data classification genuinely matters. OWASP’s Authorization Cheat Sheet says ABAC and ReBAC should typically be preferred for application development, because pure roles cannot express record-level rules.

How many roles should a SaaS product have?

Four to six built-in roles cover most products: Owner, Admin, Member, Viewer and perhaps a specialist role such as Billing. For larger customers, add roles scoped to teams or projects, or custom roles built from a fixed permission list, rather than adding more built-in roles.

What is broken access control?

Broken access control is when users can act outside their intended permissions, such as viewing another customer’s data or reaching admin functions. It is ranked first in the OWASP Top 10:2025, and OWASP reports that every application it tested had some form of it.

What should a SaaS audit log record?

Each event should record when (a UTC timestamp), who (the actor and organisation), what (the action, target, changes and outcome) and where (IP address, user agent and request ID). Log sign-ins, role and membership changes, security setting changes, exports, deletions, support access and failed authorisation attempts on sensitive actions.

What should never be in an audit log?

Passwords, session identifiers, access tokens, API keys and other secrets. OWASP’s Logging Cheat Sheet lists these among data that should be removed, masked, hashed or encrypted rather than logged directly. Avoid logging full record contents that contain personal data you do not need.

How long should audit logs be kept?

The NCSC suggests keeping logs for at least six months, because intrusions are often detected long after they begin; it cites an average of 101 days. Enterprise contracts commonly ask for a year, and some regulated buyers ask for longer. Many products offer longer retention or streaming on enterprise plans.

What is SCIM and do enterprise customers need it?

SCIM is an open standard, defined in RFC 7643 and RFC 7644, that lets a customer’s identity provider create, update and deactivate users in your product automatically. Larger customers often require it so that leavers lose access without anyone remembering to remove them by hand.

How should support staff access customer accounts?

Avoid shared logins. The approach most enterprise buyers prefer is customer-granted, time-limited support access, recorded in the customer’s own audit log under the support engineer’s name. Keep a separate break-glass process for emergencies, and review every use.

How should AI agents be handled in permissions and audit logs?

An AI agent acting inside a product should have the permissions of the user it acts for, or fewer, never more. Its audit events should record the agent as the actor and the user as the person it acted on behalf of, so customers can see exactly what the agent did and who started it.

How do I prevent one customer from seeing another customer’s data?

Scope every query to the tenant identifier taken from the user’s session, never from the request. Check ownership of the specific record on every request, use database row-level security as a backstop where available, and run automated tests that try to read and change another tenant’s data on every endpoint.

Sources and method

We read every source below on 27 and 28 November 2026. Quotations are taken from the pages as published. The tools use our own weightings and illustrative values, labelled in each tool. Views labelled as ours come from Loomstrat’s work designing permission systems and audit logs for client SaaS products and preparing them for enterprise security reviews.

Application security

  1. 01
    A01:2025 Broken Access Control

    OWASP Top 10:2025, Checked November 2026. Ranking, 100% of applications tested, occurrences, weakness count and incidence rate.

  2. 02
    A01:2021 Broken Access Control

    OWASP Top 10:2021, 2021. 2021 ranking and 94% of applications tested.

  3. 03
    Authorization Cheat Sheet

    OWASP Cheat Sheet Series, Checked November 2026. Deny by default, checks on every request, server-side enforcement, IDOR, ABAC and ReBAC preference, testing.

  4. 04
    Logging Cheat Sheet

    OWASP Cheat Sheet Series, Checked November 2026. Events to log, when/where/who/what, data not to log, tamper detection and log access.

Standards and government guidance

  1. 05
    Role Based Access Control

    NIST Computer Security Resource Center, Checked November 2026. RBAC definition and ANSI/INCITS 359 history.

  2. 06
    Least privilege (glossary)

    NIST, Checked November 2026. Definition of least privilege.

  3. 07
    Introduction to logging for security purposes

    National Cyber Security Centre, Checked November 2026. Six-month retention, 101-day detection average, UTC, protecting logs.

  4. 08
    RFC 7644: SCIM Protocol

    IETF, September 2015. Definition of the SCIM protocol.

  5. 09
    RFC 7643: SCIM Core Schema

    IETF, September 2015. User and group schema.

  6. 10
    A guide to data security

    Information Commissioner’s Office, Checked November 2026. Authorised access and UK GDPR Article 32.

Breach data

  1. 11
    2026 Data Breach Investigations Report

    Verizon, 2026. Share of breaches starting with exploited vulnerabilities.

Have a build brief already forming in your head?

Loomstrat Studio scopes, builds, and hands over production software in 3–6 weeks - fixed price, 100% repository ownership.

  • Reply within 24 hours
  • Fixed price before we start
  • Zero technical debt guarantee