Technology

Audit trail: tracking who views and exports your data

A logging specification you can copy: events, fields per line, retention, who reads the logs and the alert rules that catch a bulk export.

Audit trail: tracking who views and exports your data
Contents
  1. The test export check, in four steps
  2. Why does an authorised export slip past your current logs?
  3. The logging specification to copy
  4. How long should you keep logs, and where?
  5. Can the business pull the access report without IT?
  6. What does Moroccan Law 09-08 say, and what does it require in return?
  7. Would a consumer credit company have seen its customer file leave?
  8. FAQ
  9. Sources

You will know only if your system treats viewing and exporting as events in their own right. Most business applications log sign-ins and changes to records, since that is what the financial auditor asks about. An export by an authorised employee changes nothing and trips no security alert: their rights allow it. To see it, you need three things. One log line per export (who, when, which filter, how many rows, which format), storage that neither the user nor the application administrator can alter, and an alert rule on volume.

A leak through an unlogged export comes to light through someone else: a competitor calling your customers one by one, a complaint, a spreadsheet doing the rounds. You can't say who took the data, what it contained or when it left, and suspicion hangs over a whole team for weeks. If you have to notify customers or answer the data protection authority (the CNDP in Morocco), you will be estimating the scope of the leak blind.

The test export check, in four steps

It takes a morning and needs no tools. It shows what your log actually records, whatever the vendor's documentation says.

  1. Ask an authorised user, or a test account with the same role, to export a list from your main application with a specific filter (one branch, one status). Write down the time, the filter and the number of rows.
  2. The next day, ask IT for the matching log line without telling them the time.
  3. Compare their answer with your notes. The named user, the time, the screen, the filter, the row count and the format should all be there.
  4. Note how long the answer took, then ask who in IT could have deleted that line.

If the answer takes several days, or amounts to "the user was signed in at 10:12", you know where you stand. Run the test again with a print and with an email sent from inside the application, the two other ways data leaves.

Why does an authorised export slip past your current logs?

The transaction log records who created or changed a record, which is what the auditor needs. The technical log keeps sign-ins and errors for the operations team. Neither tells you who opened a customer file or who pulled a list of twenty thousand rows.

Security tools are tuned to spot an attacker (an unusual country, bursts of failed passwords). The employee exporting their region's portfolio signs in from their own desk, with their own password, during working hours. Nothing about it looks like an intrusion.

Rights decide who may export, which is what the access rights matrix sets out, with export as an action separate from viewing. The log is what proves who did it. What is usually missing is a third log, covering views and exports.

The logging specification to copy

You can paste it into a specification as it stands. Thresholds and retention periods are parameters for IT, the business and management to agree.

1. Events to log

EventAlso record
Sign-in, successful or refusedChannel (web, mobile, API)
Record viewed (customer, contract)Record reference, never its content
Search or list displayedCriteria entered, number of results
Export to Excel or CSVFilter, row count, format
Print or email sent from the applicationAs for an export, plus the recipient
Extraction by a technical account or APIData flow, named owner
Data changedBefore and after values for sensitive fields
Access rights changedWho granted, who received
Access refusedObject requested, reason for refusal
Log read or changedAny change raises an alert

2. Fields on every line

FieldContent
TimestampTo the second, time zone stated, clock synchronised to a common source
UserNamed ID, never a shared account
RoleRole active at the time
OriginWorkstation or IP address
FunctionScreen or function used
EventType from the list above
ObjectReference of the record or list
Criteria and volumeFilter entered, row count
Format and destinationExcel, CSV, PDF, printer, email address
OutcomeSuccess or refusal
IntegritySequence number, hash chained to the previous line

3. Parameters to set

ParameterDecision
Searchable retentionPeriod during which a report comes out in minutes
ArchiveExtra period, sealed log, released on a reasoned request
Export thresholdRows per export that trigger an alert
Relative thresholdMultiple of the user's average daily volume over thirty days
Normal hoursHours and days outside which any export is flagged
Response timeTime the recipient has to qualify an alert

4. Who reads the log

ReaderRights
Information securityWhole log and alerts, read only
Internal control or complianceWhole log, read only
Business managerReport limited to their own team
Application and database administratorsNo write access, no disabling without an alert
External auditorOne-off extraction, itself logged

5. Alert rules

RuleTriggerSent to
Bulk exportExport threshold exceededSecurity, the user's manager
Change of paceRelative threshold exceededSecurity
Out of hoursExport outside normal hoursSecurity
LeaverExport by a user serving notice or ending a contractSecurity, HR
Blocking exportExport threshold exceeded by an account serving noticeThe user's manager; export held until the manager approves
Protected recordsView of an employee's record or a flagged customerCompliance
Log tamperingLogging disabled, parameter changed, write attempt on the logSecurity, executive management

In a specification, the central requirement can be copied as written: "The system records every view, search, export, print and email with the named user, timestamp, criteria, volume and format, in a log that neither the user nor the application administrator can alter, and alerts security whenever an export exceeds the configured thresholds." An application that can't do this today can often be completed, without replacing it, through configuration, a log collector or an added layer. Our free audit can start from your test export result and show, event by event, what is missing.

How long should you keep logs, and where?

Set the period according to the usual gap, in your business, between a leak and its discovery. NIST SP 800-53 also leaves the retention period to the organisation (control AU-11). In France, the data protection authority (CNIL) recommends six months to a year in the general case, and accepts up to three years where logs support internal control of high-risk processing, provided that is justified. That guidance doesn't apply in Morocco, but it gives you a reasoned order of magnitude.

The same CNIL recommendation asks for logs to be kept apart from the main system, suggests write-only storage where no existing line can be overwritten, and asks for logs to be timestamped and signed as they are created. A log that lives in the database it monitors, editable by the same administrator, will carry little weight with an auditor.

Can the business pull the access report without IT?

It should be able to, for at least two questions. Who viewed or exported this customer file in the last six months? That one comes up every time a customer complains about being cold-called. What has this employee exported in the last thirty days? You ask that when someone leaves or when there is a suspicion.

If every request needs an IT ticket, the report arrives too late and people stop asking. A read-only screen, limited to the manager's scope and logged as well, is enough. A digital audit of your system will show the shortest route, and our digital consulting work helps you set the parameters with management.

What does Moroccan Law 09-08 say, and what does it require in return?

Article 23 of Law 09-08 requires the data controller to put in place appropriate technical and organisational measures to protect personal data against, among other things, disclosure and unauthorised access. It does not mention logging, but a log of views and exports helps show the obligation is being met. Article 24 goes into more detail but covers sensitive and health data, and the after-the-fact check it requires concerns data being entered, not data being read.

Logging cuts both ways, and Article 1 explains why: it lists consultation and extraction among processing operations. As the log identifies each employee, logging what they do is itself processing of their personal data. Tell users about the log, restrict its use to security and don't copy the viewed data into it. Your lawyer can check the CNDP formalities, which our Law 09-08 compliance guide walks through.

Would a consumer credit company have seen its customer file leave?

A consumer credit company has thirty branches, 350 users of its loan management application and 220,000 active customers. The company and the figures are invented for illustration. Its log records sign-ins and changes to loan files. About forty supervisors export customer lists for collection follow-ups, and those exports leave no trace.

The test export confirms it. IT takes three days to answer and finds only a sign-in at the time given. Management adopts the specification above with its own parameters: twelve months searchable, an alert above 5,000 rows per export or when a day's volume exceeds ten times the user's average daily volume over thirty days, and normal hours of 8:00 to 19:00, Monday to Friday.

At 120 views per user per day, the 350 users produce 42,000 log lines a day. Nobody will read them. The alert rules do that work.

A few months later, a regional supervisor serving notice, whose scope covers three branches and 24,000 customers, exports that entire portfolio on a Friday at 19:40. His average is 400 rows a day, which puts his relative threshold at 4,000 rows. The export is above 5,000 rows, above his relative threshold, out of hours and from an account serving notice: four alerts go out, and the blocking export rule applies. The file is never produced. The log line shows the filter ("all branches in my scope, all statuses"), the Excel format and the workstation. On Monday morning, security and the regional director have the held request and a dated, sealed record.

FAQ

Will logging every view slow the application down?

Writing a log line is light if it goes to a collection service rather than into the business tables. Measure the effect during a load test with your real volume of views. If one heavily used screen becomes a problem, keep full detail for lists and exports and log simple record views in a more compact form.

Can't we just block exports instead of logging them?

Removing export from roles that don't need it does reduce the risk. The roles that export as part of their job remain, and printing gets around the block. The log covers what stays open, provides the evidence and deters once users know it exists.

Do our employees need to be told about this logging?

Yes, since the log records what they do under their own name. A message at sign-in and a line in the IT policy say what is recorded, why and for how long. Telling them also strengthens the deterrent effect, and your lawyer checks the other formalities Law 09-08 sets.

What about exports by contractors and technical accounts?

Every automated flow needs a named owner and an account of its own, with its own thresholds. A technical account shared between several flows leaves the log silent on where an extraction came from, and the access review checks that each one still has an owner. The contractor's contract can also require the same logging for the processing it does on your behalf.

Sources

Last verified: 2 November 2026.

At your next management meeting, put the test export result on the agenda, with how long IT took to answer and the list of fields missing from the log line.

Read next

  1. Technology

    Security assurance plan: the 12 points to require

    The 12 points to require from a vendor before it gets production access, with the evidence to accept and the answer that should fail the bid.

    11 min read

  2. Technology

    GDPR Compliance in Morocco: A Guide for EU Clients

    Law 09-08, the CNDP, GDPR and Standard Contractual Clauses: the complete guide for Moroccan companies handling European personal data.

    8 min read

  3. Technology

    Enterprise AI: Where Do Your Documents Actually Go?

    The software you're buying now reads your documents with AI. Where do they go, do they train a model, and who actually holds the subscription?

    9 min read

  4. Technology

    AI Governance: Controlling ChatGPT in the Enterprise

    Your teams already paste contracts into ChatGPT. How to regain control without blocking productivity: the three layers and what each costs.

    10 min read

Let's discuss your priorities

A free audit of your information system.

For companies of 50 people or more, or with several sites, with a decision-maker present. Two to four hours of interviews, then a written report that is yours to keep.

* Required field

Only if you'd rather we called you.

A few words are enough. Don't include passwords or sensitive data.

We use this information to reply to your inquiry and, if you've accepted cookies, to measure how well our campaigns perform. To find out how it's stored and how to exercise your rights, see our privacy policy.

Would you rather talk it through?Call us on +212 715 659 190