legionio 1.5.7 → 1.5.8
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/legion/compliance/phi_erasure.rb +63 -0
- data/lib/legion/compliance.rb +1 -0
- data/lib/legion/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd1e62d0c34e503458b9648de476a15dd5c03a163bb506db8a4723da486aef24
|
|
4
|
+
data.tar.gz: 43147d5ba26541cf62f3d5255ce973480fccb1362a5d8daf224ff16b82b6e55f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af364276c4d9589d8ee414a2e563640be7c49c472a0ef566a035b502198d7396acd055f42f576756a9bbd0beda57f09e0bb098bcb15b387da8dbf31baa728120
|
|
7
|
+
data.tar.gz: 44671d558a7e20e9dbda648e0ad71efd0c9db546d37507c0e21d3367a9e4c896b79476f8158597e36eb310c46415d1084dea9cfbe389405b7940a74c10609c63
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
# Legion Changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.8] - 2026-03-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `Legion::Compliance::PhiTag` — PHI data classification tagging with `phi?`, `tag`, `tagged_cache_key` methods; gated by `compliance.phi_enabled` setting
|
|
7
|
+
- `Legion::Compliance::PhiAccessLog` — PHI access audit bridge that calls `Legion::Audit.record` with `event_type: 'phi_access'`; gated by `compliance.phi_enabled` setting
|
|
8
|
+
- `Legion::Compliance::PhiErasure` — orchestrates cryptographic erasure via `Legion::Crypt::Erasure`, cache key purge, access log, and verification; all steps guarded by `defined?` checks
|
|
9
|
+
|
|
3
10
|
## [1.5.7] - 2026-03-24
|
|
4
11
|
|
|
12
|
+
### Added
|
|
13
|
+
- `Legion::Audit::Archiver` — tiered hot/warm/cold audit retention orchestrator; delegates hot→warm to `Legion::Data::Retention`, exports warm→cold as compressed JSONL via `ColdStorage`, records manifests, verifies hash chain after each run
|
|
14
|
+
- `Legion::Audit::ColdStorage` — upload/download abstraction with `:local` (filesystem) and `:s3` (aws-sdk-s3, optional) backends; raises `BackendNotAvailableError` when aws-sdk-s3 not installed
|
|
15
|
+
- `Legion::Audit::ArchiverActor` — thread-based weekly scheduled actor with hour/day-of-week cron guard; started by `Service#setup_audit_archiver` after telemetry
|
|
16
|
+
- `legion audit archive --dry-run / --execute` — preview or execute tiered archival from CLI
|
|
17
|
+
- `legion audit verify_chain --tier --start --end` — direct hash chain integrity check for hot or warm tier
|
|
18
|
+
- `legion audit restore --date` — restore cold JSONL archives back to warm tier for querying
|
|
19
|
+
- Feature flag: `audit.retention.enabled` (default `false`); settings: `hot_days`, `warm_days`, `cold_years`, `cold_storage`, `cold_backend`, `archive_schedule`, `verify_on_archive`
|
|
20
|
+
|
|
5
21
|
### Changed
|
|
6
22
|
- `Legion::Service` starts `CertRotation` after `Crypt.start` when `security.mtls.enabled: true`
|
|
7
23
|
- `Legion::Service#shutdown` stops `CertRotation` before `Crypt.shutdown`
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Compliance
|
|
5
|
+
module PhiErasure
|
|
6
|
+
class << self
|
|
7
|
+
def erase(task_id:, reason:)
|
|
8
|
+
result = { task_id: task_id, erased: false, steps: {} }
|
|
9
|
+
|
|
10
|
+
result[:steps][:key_erasure] = erase_key(task_id)
|
|
11
|
+
result[:steps][:cache_purge] = purge_cache(task_id)
|
|
12
|
+
log_erasure(task_id: task_id, reason: reason)
|
|
13
|
+
result[:steps][:verification] = verify_erasure(task_id)
|
|
14
|
+
|
|
15
|
+
key_result = result[:steps][:key_erasure]
|
|
16
|
+
verify_result = result[:steps][:verification]
|
|
17
|
+
|
|
18
|
+
result[:erased] = key_result.nil? || (key_result.is_a?(Hash) && key_result[:erased] != false &&
|
|
19
|
+
verify_result.is_a?(Hash) && verify_result[:erased] != false)
|
|
20
|
+
result
|
|
21
|
+
rescue StandardError => e
|
|
22
|
+
Legion::Logging.error "[Compliance] PhiErasure#erase failed task_id=#{task_id}: #{e.message}" if defined?(Legion::Logging)
|
|
23
|
+
{ task_id: task_id, erased: false, error: e.message }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def erase_key(task_id)
|
|
29
|
+
return nil unless defined?(Legion::Crypt::Erasure)
|
|
30
|
+
|
|
31
|
+
Legion::Crypt::Erasure.erase_tenant(tenant_id: task_id)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def purge_cache(task_id)
|
|
35
|
+
return nil unless defined?(Legion::Cache)
|
|
36
|
+
|
|
37
|
+
prefix = "phi:#{task_id}:"
|
|
38
|
+
Legion::Cache.delete(prefix)
|
|
39
|
+
{ purged: true, prefix: prefix }
|
|
40
|
+
rescue StandardError => e
|
|
41
|
+
{ purged: false, error: e.message }
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def log_erasure(task_id:, reason:)
|
|
45
|
+
return unless defined?(Legion::Compliance::PhiAccessLog)
|
|
46
|
+
|
|
47
|
+
Legion::Compliance::PhiAccessLog.log_access(
|
|
48
|
+
resource: task_id,
|
|
49
|
+
action: 'erasure',
|
|
50
|
+
actor: 'system:phi_erasure',
|
|
51
|
+
reason: reason
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def verify_erasure(task_id)
|
|
56
|
+
return nil unless defined?(Legion::Crypt::Erasure)
|
|
57
|
+
|
|
58
|
+
Legion::Crypt::Erasure.verify_erasure(tenant_id: task_id)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
data/lib/legion/compliance.rb
CHANGED
data/lib/legion/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: legionio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -673,6 +673,7 @@ files:
|
|
|
673
673
|
- lib/legion/cluster/lock.rb
|
|
674
674
|
- lib/legion/compliance.rb
|
|
675
675
|
- lib/legion/compliance/phi_access_log.rb
|
|
676
|
+
- lib/legion/compliance/phi_erasure.rb
|
|
676
677
|
- lib/legion/compliance/phi_tag.rb
|
|
677
678
|
- lib/legion/context.rb
|
|
678
679
|
- lib/legion/data/local_migrations/20260319000001_create_extension_catalog.rb
|