orfeas_pam_dsl 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 905dfe93a7bf586dde5d0e90b43d37195ff892ad2ca51f30e13e8338bd1ea12d
4
+ data.tar.gz: 254859b323f8dcd16e15864571feeffc7d7f62f1a69934a824be3713a189b25f
5
+ SHA512:
6
+ metadata.gz: 0503caca59c63a12aa0beb51b2fd52947e80e78f3d7049729e300884d55920e9b6ae1056209f2948f0373597d0da82580d19497c8bc338852c46881073fe5956
7
+ data.tar.gz: e27154dd58c9f6a0a31f1449e28cd211e25a6d0589a80b406b45ecedbbd93bf85a5d5d599778c62df10ca210c79fdf582b572f2e954115121b73bcea44cb3c2a
data/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+ # Changelog
2
+
3
+ All notable changes to PAM DSL will be documented in this file.
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.6.0] - 2026-01-05
8
+
9
+ ### Added
10
+ - `country_code` and `locale` as identifier PII types
11
+ - Health PII patterns: `diagnosis`, `prescription`, `condition`
12
+
13
+ ### Changed
14
+ - Improved policy generator formatting and edge case handling
15
+ - Fixed field DSL method chain return value
16
+
17
+ ### Fixed
18
+ - Field DSL now returns `self` for proper method chaining
19
+
20
+ #### PIIDetector Enhancements
21
+ - `extract_pii_from_records` method for scanning any record collection
22
+ - Generic extractor interface (`attribute_extractor`, `metadata_extractor`)
23
+ - Works with any event store (Lyra, RubyEventStore, ActiveRecord, plain hashes)
24
+ - PII inventory grouped by type with source tracing
25
+
26
+ #### PIIMasker Class (NEW)
27
+ - Batch masking of PII in data structures
28
+ - Three masking strategies: `:partial`, `:full`, `:redact_sensitive`
29
+ - `mask(attributes, strategy:)` for hash masking
30
+ - `mask_field(value, field_name, strategy:)` for individual fields
31
+ - `mask_by_type(value, pii_type, strategy:)` for type-based masking
32
+ - `mask_records(records, attribute_extractor:, attribute_setter:, strategy:)` for collections
33
+
34
+ #### GDPRCompliance Class (NEW)
35
+ - Comprehensive GDPR data subject rights implementation
36
+ - Article 15 (Access): `data_export` with full PII inventory
37
+ - Article 16 (Rectification): `rectification_history` tracking corrections
38
+ - Article 17 (Erasure): `right_to_be_forgotten_report` with deletion strategy
39
+ - Article 20 (Portability): `portable_export` in JSON/CSV/XML formats
40
+ - Article 30 (Processing Records): `processing_activities` documentation
41
+ - `retention_compliance_check` for policy enforcement
42
+ - `consent_audit` for consent tracking and legitimacy verification
43
+ - `full_report` combining all GDPR aspects
44
+ - Generic extractor interface for any event source
45
+
46
+ #### Core DSL
47
+ - Field definitions with PII types and sensitivity levels
48
+ - Purpose definitions with GDPR legal bases
49
+ - Retention policies with field-level granularity
50
+ - Consent management with expiration and granular control
51
+ - Policy validation and access control
52
+ - Transformation support for different contexts
53
+ - Metadata support for all entities
54
+
55
+ #### Reporter Class
56
+ - Policy summary with field types, sensitivity levels, and transformations
57
+ - GDPR Article 30 Records of Processing Activities report
58
+ - PII analysis with event store integration
59
+ - Retention compliance checking
60
+ - Access pattern analysis by operation type and time
61
+ - JSON export for machine processing
62
+
63
+ #### PolicyGenerator Class
64
+ - Generate template policies with sensible defaults
65
+ - Scan ActiveRecord models to detect PII fields
66
+ - Pattern-based field detection (email, phone, name, address, financial, etc.)
67
+ - Exclusion patterns to reduce false positives (timestamps, amounts, foreign keys)
68
+ - Auto-generate purposes based on detected field types
69
+ - Model-specific retention rules for financial data
70
+
71
+ #### PolicyComparator Class
72
+ - Compare two PAM DSL policies programmatically
73
+ - Field comparison: common fields, unique to each policy, type/sensitivity matching
74
+ - Purpose comparison with legal basis and required fields
75
+ - Retention comparison with default durations and rule counts
76
+ - Generate markdown comparison reports with `generate_report(output_path:)`
77
+ - Export comparison data as hash via `to_h` for JSON serialization
78
+ - `pam_dsl:report:compare[policy1,policy2,output_path]` rake task
79
+
80
+ #### Rails Integration
81
+ - Rake tasks under `pam_dsl:report:*` namespace
82
+ - Rake tasks under `pam_dsl:generate:*` namespace
83
+ - Convenience aliases under `privacy:*` namespace
84
+ - Configuration via `Rails.application.config.pam_dsl`
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2025 Michail Pantelelis (mpantel@aegean.gr)
2
+ University of the Aegean - ORFEAS Framework
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.