jeffersongoncalves / laravel-lgpd-ripd
LGPD data protection impact assessment (RIPD) for Laravel: risks scored by likelihood and impact with LINDDUN threats, mitigations and residual risk, DPO opinion, approval and periodic review, linked to the records of processing.
Package info
github.com/jeffersongoncalves/laravel-lgpd-ripd
pkg:composer/jeffersongoncalves/laravel-lgpd-ripd
Requires
- php: ^8.2
- illuminate/console: ^12.0|^13.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- jeffersongoncalves/laravel-lgpd: ^1.1
- jeffersongoncalves/laravel-lgpd-records: ^1.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- jeffersongoncalves/pest-plugin-database-migrations: ^1.0
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Data protection impact assessments for the Brazilian General Data Protection Law (LGPD, Lei 13.709/2018). In Portuguese this is the Relatório de Impacto à Proteção de Dados Pessoais, or RIPD (arts. 5, XVII and 38). It is part of the laravel-lgpd suite. Each assessment can be linked to a processing activity from laravel-lgpd-records.
- Describe the processing: what it does, the data it collects, and why that data is necessary and proportionate.
- Score the risks: each risk gets a likelihood and an impact from 1 to 3, both before and after the mitigation measures. A LINDDUN threat category is optional.
- Get the DPO's opinion, then approve: approving schedules the next review. Editing an approved assessment sends it back to draft.
- Find the gaps: see which processing activities with sensitive data, or based on legitimate interest, have no assessment yet. Those are the cases the ANPD is likely to ask about (arts. 10, §3 and 38).
This package gives you tooling. It does not make you compliant on its own. Your assessments need legal review.
Installation
composer require jeffersongoncalves/laravel-lgpd-ripd php artisan vendor:publish --tag="lgpd-records-migrations" # if not published yet php artisan vendor:publish --tag="lgpd-ripd-migrations" php artisan migrate
Usage
use JeffersonGoncalves\LgpdRipd\Models\ImpactAssessment; $ripd = ImpactAssessment::create([ 'title' => 'Telemedicine appointments', 'processing_activity_id' => $telemedicine->id, 'description' => 'Video appointments; we store the diagnosis and prescriptions.', 'necessity' => 'Only data needed for the appointment; recordings are not kept.', 'risks' => [ [ 'title' => 'Diagnosis leak', 'threat' => 'data_disclosure', 'likelihood' => 2, 'impact' => 3, // high 'measures' => 'Encryption at rest, role-based access', 'residual_likelihood' => 1, 'residual_impact' => 3, // medium ], ], 'dpo_opinion' => 'Acceptable with the listed measures.', ]); $ripd->scoredRisks(); // each risk with its level and residual_level $ripd->highestRisk(); // RiskLevel::Medium (residual) $ripd->highestRisk(residual: false); // RiskLevel::High $ripd->approve('Ana Souza (DPO)'); // status approved, next_review_at = now + 1 year $ripd->isReviewDue(); ImpactAssessment::query()->scopes('dueForReview')->get();
A risk's level is likelihood × impact: 1–2 is low, 3–4 is medium and 6–9 is high. When you leave out the residual scores, the residual level is the inherent one. You need at least one risk to approve. Changing the title, activity, description, necessity, risks or DPO opinion of an approved assessment sends it back to draft. Approve it again after the review.
Threats (Threat enum, LINDDUN): linking, identifying, non_repudiation, detecting, data_disclosure, unawareness, non_compliance.
Which activities need one
use JeffersonGoncalves\LgpdRipd\Facades\LgpdRipd; LgpdRipd::candidates(); // [['activity' => ProcessingActivity, 'reasons' => ['sensitive_data']], ...]
An activity is listed when it has no assessment, and either one of its models declares a DataCategory::Sensitive column or its legal basis is legitimate interest. Any other high-risk processing still needs your own judgment: large scale, minors, new technology, automated decisions.
Report
php artisan lgpd:ripd # assessments with inherent/residual risk and next review, then the gaps php artisan lgpd:ripd --json # every assessment, ready to hand to the ANPD
LgpdRipd::export($ripd); // one assessment as an array
Testing
composer test
Changelog
See CHANGELOG.
License
The MIT License (MIT). See License File.
