GDPR, ISO 27001 and SOC 2
The bundle is not certified, but it gives evidence for your audit: who did what and when, who read the entries, and which entry changed.
Setup for an audit
- Record the actions: enable the sources that you need and add
#[Auditable]to your classes. Enable theusercontext provider: it records the author of each entry, except in the console. - Keep the sensitive data out: put
#[AuditIgnore]or#[AuditTransform]on the sensitive fields, for example the password. See Transformations. - Restrict the access: the EasyAdmin pages need the
ROLE_AUDIT_LOG_VIEWERrole. Give it only to the users who must read the entries. Protect your own pages that show the entries withsecurity.access_control. See EasyAdmin viewer. - Detect a changed entry: enable integrity. Run
audit-log:verifyon a schedule, and alert on a non-zero exit code and on theerrorlogs of the bundle. - Limit the retention and protect the storage: run
audit-log:purgeon a schedule, and stop it during an incident. Give thedbaloutput a database account that cannot change or delete rows. - Run it safely: keep the secrets in the Symfony secrets vault. Synchronise the server clocks. Back up the audit storage. With Messenger, configure a
failure_transport.
Statuses
| Status | Meaning |
|---|---|
| Default | The bundle does it without configuration. |
| Opt-in | The bundle gives it. You enable it. |
| Partial | Even when you enable everything, a part is missing. The comment tells what. |
| Not covered | The bundle does not cover it. |
| Your process | Outside the bundle: a process or a contract of your organisation. The comment tells how the bundle helps. |
GDPR
Text: Regulation (EU) 2016/679 (General Data Protection Regulation).
| Rule | What it requires | Status | Comment |
|---|---|---|---|
| Art. 4(5) Pseudonymisation | Defines pseudonymisation: processing the data so that you cannot link it to a person without extra information that you keep apart and protect. | Opt-in | Use keyed_hash on the entity fields, and a listener for the user and IP values. See Pseudonymisation. |
| Art. 5(1)(c) Data minimisation | Process only the personal data that the purpose needs. | Opt-in | Only the #[Auditable] classes are recorded. Remove or hash each field that the purpose does not need with #[AuditIgnore] and #[AuditTransform]: see Transformations. |
| Art. 5(1)(e) Storage limitation | Keep personal data no longer than the purpose needs. | Opt-in | The bundle has no default retention period. Schedule audit-log:purge, and rotate the filesystem and stdout logs yourself. See Retention. |
| Art. 5(2) Accountability | Be able to show that you obey the GDPR. | Opt-in | The entries show who did what and when. Even with no other source enabled, the bundle records the reads, checks and purges of the entries. See Sources. |
| Art. 6 Lawfulness of processing | Have a legal basis for each processing. | Your process | Choose the legal basis of the audit trail, often the legitimate interest (art. 6(1)(f)). Then the right to object (art. 21) applies: plan how you answer it. |
| Art. 13 and 14 Information to be provided | Tell the persons who you are, which data you process, why, for how long, and which rights they have. | Your process | Tell the persons that the application records their actions and data, in your privacy notice or when they log in (CNIL para. 13). |
| Art. 15 Right of access by the data subject | Give a person a copy of their data on request. | Partial | Find the entries of a person in PHP with the context filter on user_identifier, ip or subject_id. It does not search filesystem, stdout or the changeset of another entity, and the commands have no context filter or export: see Access requests. |
| Art. 17 Right to erasure ('right to be forgotten') | Erase the data of a person without undue delay when art. 17(1) applies, unless art. 17(3) applies. | Partial | Find the entries of a person with the context filter, then delete them in the storage. There is no erase command, and the filter has the same limits as art. 15: see Erasure. |
| Art. 25 Data protection by design and by default | Build data protection into the processing. By default, process only the data that each purpose needs. | Partial | By default, the bundle records only what you mark, masks the token, password and email route parameters, truncates the IP and uses file mode 0600. You set the retention and the field masking, and you protect the Messenger transport: see Async writes. |
| Art. 28 Processor | Have a contract with each processor that handles the data for you. | Your process | This applies to a hosted log platform, or a hosted Elasticsearch or MongoDB. The contract must ask for logging (CNIL para. 14), and transfers outside the EU follow chapter V. |
| Art. 30 Records of processing activities | List each processing in your records. | Your process | Add the audit trail to the record of each audited processing, or give it its own record (CNIL para. 15). |
| Art. 32 Security of processing | Protect the data with measures that fit the risk. | Partial | Integrity detects a changed entry, but not a deleted entry, and it does not cover the context_* columns. The EasyAdmin pages need the ROLE_AUDIT_LOG_VIEWER role: see EasyAdmin viewer. |
| Art. 33 Notification of a personal data breach to the supervisory authority | Notify a breach to the authority within 72 hours, unless it is unlikely to cause a risk to the persons. Document each breach. | Your process | The Doctrine sources, http_kernel and security record who read or changed the data. Your incident process decides on the notification. |
CNIL recommendation on logging
Text: CNIL deliberation 2021-122 of 14 October 2021, in French. The CNIL PDF numbers its paragraphs. The table gives the paragraph number and a short name for each rule.
| Rule | What it requires | Status | Comment |
|---|---|---|---|
| Para. 6 Content of a record | Record the author, the time, the type and the data reference of each create, read, change and delete operation. Avoid copying the data. | Partial | Enable the user context provider to record the author, but a console command has no author. Doctrine reads are not recorded: put #[Auditable] on the controllers that show the data. See Sources. |
| Para. 7 Separate storage | Keep the logs apart from the main system. The application writes only and cannot overwrite an entry. | Opt-in | Give each output its own connection, client or document manager, with an account that cannot change or delete the entries. See Database account. |
| Para. 8 Retention | Keep the logs between six months and one year. A longer period needs a documented reason (para. 16 to 21). | Opt-in | The bundle has no default retention period. Schedule audit-log:purge. See Retention. |
| Para. 9 Analysis and alerts | Analyse the logs in real time or in the short term. Define a process to raise and handle the alerts. | Your process | Send the entries to your log platform with the stdout, filesystem or elasticsearch output. Set the alerts there. |
| Para. 11 Reuse of the logs | Limit the reuse of the logs for another purpose, for example with a usage charter or an alert when an authorised account changes them. | Partial | The commands and the EasyAdmin viewer record each read, check and purge by default. ReaderInterface and a direct access to the storage are not recorded, and the bundle sends no alert. See Access to the entries. |
| Para. 12 Timestamp and signature | Timestamp and sign each record when you create it. Keep the logs confidential, available and intact. | Partial | Integrity adds an HMAC-SHA256 hash to each entry, and audit-log:verify detects a changed entry. The hash is not a signature, the time comes from the server clock, and a deleted entry is not detected (planned): see Limits. |
| Para. 18 Sensitive data | Do not collect sensitive data in the logs (GDPR art. 9) when the main processing does not hold them. | Opt-in | Put #[AuditIgnore] on the sensitive fields: the bundle then does not store them. Only the #[Auditable] classes are recorded: see Transformations. |
| Para. 22 Short retention of the main data | If the main data is kept less than six months, do not keep it in the logs. Keep only pseudonymised identifiers, or automatically purge the data whose retention has ended. | Opt-in | Use #[AuditIgnore] or keyed_hash on these fields, and pseudonymise the user and IP values with a listener. See Pseudonymisation. |
ISO/IEC 27001:2022
Text: ISO/IEC 27001:2022. The standard is not free, and its controls are not public. The table gives the title of each Annex A control and a short summary.
| Control | What it requires | Status | Comment |
|---|---|---|---|
| A.5.18 Access rights | Give, review, change and remove the access rights as your access control policy says. | Partial | Enable doctrine_orm and add #[Auditable] to the entity that holds the roles. A role given through a to-many relation is not recorded: see Sources. |
| A.5.25 Assessment and decision on information security events | Assess the security events and decide if they are security incidents. | Opt-in | Find the entries of a user or an object with the context filter, in PHP. |
| A.5.26 Response to information security incidents | Respond to the security incidents with documented procedures. | Your process | At the start of an incident, stop the scheduled purge and run audit-log:verify. |
| A.5.28 Collection of evidence | Identify, collect and keep the evidence of security events. | Partial | Each entry has a UUID, and integrity shows that an entry did not change. Integrity does not detect a deleted entry, and no trusted third party timestamps the entries: see Limits. |
| A.5.33 Protection of records | Protect the records from loss, destruction, falsification, unauthorised access and unauthorised release. | Partial | Integrity detects a changed entry, but not a deleted entry (planned). With dbal and elasticsearch, the hash does not cover the context_* columns and fields. See Limits. |
| A.5.34 Privacy and protection of PII | Obey the laws and contracts that apply to PII. | Partial | Use the personal data tools. Some GDPR rules are partial or your process: see the GDPR table. |
| A.8.2 Privileged access rights | Restrict and manage the privileged access rights. | Opt-in | The security source records each user switch, and with the user context provider each entry made during the switch has impersonator_identifier. Each purge writes a PURGE entry, but a console purge has no author: see security. |
| A.8.3 Information access restriction | Restrict the access to information as your access control policy says. | Your process | The EasyAdmin pages need the ROLE_AUDIT_LOG_VIEWER role. Give it as your policy says. See EasyAdmin viewer. |
| A.8.5 Secure authentication | Use secure authentication technologies and procedures. | Partial | The security source records each login, login failure and logout. A LOGIN_FAILURE entry has no identifier, so you cannot count the failures of one account. See security. |
| A.8.10 Information deletion | Delete the information when you no longer need it. | Opt-in | Schedule audit-log:purge for the dbal, elasticsearch and mongodb outputs, and rotate the filesystem and stdout logs. See Retention. |
| A.8.11 Data masking | Mask the data as your access control policy and business needs say. | Opt-in | Hide, hash or remove each field with #[AuditTransform] and #[AuditIgnore]. By default, http_kernel masks the token, password and email route parameters, and the request provider truncates the IP: see Transformations. |
| A.8.13 Information backup | Keep backup copies of the information and test them. | Your process | Back up the audit storage. Apply the same retention period to the backups. |
| A.8.15 Logging | Produce, store, protect and analyse logs of activities, exceptions, faults and other events. | Opt-in | Seven sources record the Doctrine changes, controller access, commands, logins, Messenger messages and workflow transitions. A lost entry is logged at the error level, and a bulk DQL or SQL query is not recorded: see Sources. |
| A.8.16 Monitoring activities | Monitor the networks, systems and applications for unusual behaviour. | Your process | Run audit-log:verify on a schedule and alert on a non-zero exit code. Alert on the error logs of the bundle. |
| A.8.17 Clock synchronization | Synchronise the clocks with approved time sources. | Your process | The dbal and mongodb outputs store the time in UTC. Synchronise the server clocks, for example with NTP. |
| A.8.24 Use of cryptography | Define and apply rules for cryptography and key management. | Opt-in | Integrity uses HMAC-SHA256 by default, and keyed_hash always does. Do not set integrity.algorithm to md5 or sha1, and note that a key rotation is not supported: see Limits. |
SOC 2
Text: 2017 Trust Services Criteria (With Revised Points of Focus - 2022), AICPA. The download can ask for a free account. The criteria have no short titles, so the table gives a summary of each.
| Criterion | What it requires | Status | Comment |
|---|---|---|---|
| CC4.1 | Evaluate the controls on a regular basis to check that they work. | Your process | Run audit-log:verify on a schedule. Each run writes a VERIFY entry. |
| CC6.1 | Protect the information assets with logical access security. | Your process | The EasyAdmin pages need the ROLE_AUDIT_LOG_VIEWER role. Protect your own pages that show the entries with security.access_control. The commands and the EasyAdmin pages record each read: see Access to the entries. |
| CC6.2 | Register and authorise each new user before you give access. Remove the credentials when the access is no longer authorised. | Opt-in | Enable doctrine_orm and add #[Auditable] to your user entity, to record each creation, change and deletion of a user. Put #[AuditIgnore] on the password field. |
| CC6.3 | Give, change and remove access based on roles, with least privilege. | Partial | Enable doctrine_orm and add #[Auditable] to the entity that holds the roles, but a role given through a to-many relation is not recorded. With the user context provider, each entry made during a user switch has impersonator_identifier. See Sources. |
| CC6.6 | Protect the system against threats from outside its boundaries. | Partial | The security source records each login failure, but not the identifier that the user typed. The IP needs the request context provider, which truncates it by default. See security. |
| CC7.2 | Monitor the system components for unusual behaviour and analyse it. | Your process | Send the entries to your log platform and set alerts there. Alert on the error logs of the bundle. |
| CC7.3 | Evaluate the security events to find the security incidents. | Opt-in | Find the entries of a user or an object with the context filter, in PHP. To filter on transaction_id, add it to indexed_context. |
| CC7.4 | Respond to security incidents with a defined incident response program. | Your process | At the start of an incident, stop the scheduled purge and run audit-log:verify. |
| CC8.1 | Authorise, test, approve and apply the changes to infrastructure, data, software and procedures. | Partial | The Doctrine sources record each change that flush() writes, with the old and the new values. A bulk DQL query or a native SQL query is not recorded: see Sources. |
| A1.2 | Manage the environmental protections, data backups and recovery infrastructure. | Your process | Back up the audit storage. With Messenger, configure a failure_transport: see Async writes. |
| C1.1 | Identify and keep the confidential information. | Opt-in | Hide, hash or remove the confidential fields with transformations before they are stored. Only the #[Auditable] classes are recorded. |
| C1.2 | Dispose of the confidential information. | Opt-in | Schedule audit-log:purge. Each purge writes a PURGE entry by default. |
| PI1.2 | Control the completeness and accuracy of the system inputs. | Partial | Same limit as CC8.1. By default, the bundle only logs a lost entry: alert on the error logs. |
| PI1.4 | Deliver the output completely, accurately and on time. | Partial | Each output gets each entry, even if another output fails, and by default an audit failure never breaks your application: it is logged at the error level. With Messenger, configure a failure_transport: see Async writes. |
| PI1.5 | Store the inputs, items in processing and outputs completely and accurately. | Partial | Same limits as ISO A.5.33. See Limits. |
| P4.2 | Keep personal information only as long as your objectives need. | Opt-in | The bundle has no default retention period. Schedule audit-log:purge: see Retention. |
| P4.3 | Dispose of personal information securely. | Partial | audit-log:purge deletes by age only. To delete the entries of one person, see Erasure. |
| P5.1 | Give the data subjects access to their stored personal information. | Partial | Same limits as GDPR art. 15. See Access requests. |
This table does not make your application compliant or certified. Compliance and certification belong to your organisation, its processes and its audit.