ciphergate-cli 0.7.0__py3-none-any.whl

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.
Files changed (74) hide show
  1. ciphergate/__init__.py +95 -0
  2. ciphergate/__main__.py +6 -0
  3. ciphergate/cli.py +832 -0
  4. ciphergate/config.py +50 -0
  5. ciphergate/constants.py +274 -0
  6. ciphergate/detectors/__init__.py +5 -0
  7. ciphergate/detectors/base.py +53 -0
  8. ciphergate/detectors/custom_regex.py +37 -0
  9. ciphergate/detectors/dates.py +92 -0
  10. ciphergate/detectors/email.py +56 -0
  11. ciphergate/detectors/field_names.py +220 -0
  12. ciphergate/detectors/ip_address.py +85 -0
  13. ciphergate/detectors/network.py +42 -0
  14. ciphergate/detectors/payment_card.py +77 -0
  15. ciphergate/detectors/phone.py +67 -0
  16. ciphergate/detectors/presidio_ner.py +112 -0
  17. ciphergate/detectors/regex_safety.py +40 -0
  18. ciphergate/detectors/registry.py +194 -0
  19. ciphergate/detectors/secrets.py +130 -0
  20. ciphergate/errors.py +119 -0
  21. ciphergate/models/__init__.py +1 -0
  22. ciphergate/models/context.py +69 -0
  23. ciphergate/models/finding.py +108 -0
  24. ciphergate/models/policy.py +402 -0
  25. ciphergate/models/report.py +115 -0
  26. ciphergate/pipeline/__init__.py +1 -0
  27. ciphergate/pipeline/atomic_output.py +143 -0
  28. ciphergate/pipeline/batch.py +533 -0
  29. ciphergate/pipeline/inspector.py +282 -0
  30. ciphergate/pipeline/paths.py +98 -0
  31. ciphergate/pipeline/planner.py +192 -0
  32. ciphergate/pipeline/rescan.py +120 -0
  33. ciphergate/pipeline/sanitizer.py +392 -0
  34. ciphergate/pipeline/stdio.py +173 -0
  35. ciphergate/pipeline/streams.py +152 -0
  36. ciphergate/policy/__init__.py +26 -0
  37. ciphergate/policy/context.py +203 -0
  38. ciphergate/policy/engine.py +194 -0
  39. ciphergate/policy/loader.py +116 -0
  40. ciphergate/policy/precedence.py +149 -0
  41. ciphergate/policy/validator.py +632 -0
  42. ciphergate/py.typed +0 -0
  43. ciphergate/readers/__init__.py +113 -0
  44. ciphergate/readers/accesslog_reader.py +244 -0
  45. ciphergate/readers/base.py +131 -0
  46. ciphergate/readers/csv_reader.py +241 -0
  47. ciphergate/readers/json_reader.py +184 -0
  48. ciphergate/readers/jsonl_reader.py +97 -0
  49. ciphergate/readers/jsonlog_reader.py +178 -0
  50. ciphergate/readers/line_structure.py +125 -0
  51. ciphergate/readers/logfmt_reader.py +100 -0
  52. ciphergate/readers/stacktrace_reader.py +103 -0
  53. ciphergate/readers/syslog_reader.py +309 -0
  54. ciphergate/readers/text_reader.py +59 -0
  55. ciphergate/reporting/__init__.py +1 -0
  56. ciphergate/reporting/audit.py +85 -0
  57. ciphergate/reporting/safe_text.py +71 -0
  58. ciphergate/reporting/serializer.py +44 -0
  59. ciphergate/reporting/terminal.py +147 -0
  60. ciphergate/templates/starter_policy.yml +77 -0
  61. ciphergate/transforms/__init__.py +6 -0
  62. ciphergate/transforms/date_shift.py +79 -0
  63. ciphergate/transforms/generalize.py +107 -0
  64. ciphergate/transforms/keys.py +177 -0
  65. ciphergate/transforms/pseudonymize.py +113 -0
  66. ciphergate/transforms/redact.py +9 -0
  67. ciphergate/transforms/registry.py +201 -0
  68. ciphergate/transforms/replace.py +16 -0
  69. ciphergate_cli-0.7.0.dist-info/METADATA +531 -0
  70. ciphergate_cli-0.7.0.dist-info/RECORD +74 -0
  71. ciphergate_cli-0.7.0.dist-info/WHEEL +4 -0
  72. ciphergate_cli-0.7.0.dist-info/entry_points.txt +2 -0
  73. ciphergate_cli-0.7.0.dist-info/licenses/LICENSE +202 -0
  74. ciphergate_cli-0.7.0.dist-info/licenses/NOTICE +4 -0
ciphergate/__init__.py ADDED
@@ -0,0 +1,95 @@
1
+ """CipherGate: local-first, environment- and destination-aware data inspection and sanitization.
2
+
3
+ Supported public API (everything else is internal and may change without notice)::
4
+
5
+ load_policy(path) -> Policy
6
+ validate_policy(path_or_policy) -> ValidationResult
7
+ inspect_file(path, policy, context=None) -> RunReport
8
+ plan_file(path, policy, context=None) -> RunReport
9
+ sanitize_file(input_path, output_path, policy, context=None, options=None) -> RunReport
10
+ rescan_file(path, policy, context=None, strict=None) -> RunReport
11
+
12
+ # binary streams (format required; output written only after a successful run)
13
+ inspect_stream(stream, policy, context=None, *, fmt) -> RunReport
14
+ plan_stream(stream, policy, context=None, *, fmt) -> RunReport
15
+ sanitize_stream(stream, output, policy, context=None, options=None) -> RunReport
16
+ rescan_stream(stream, policy, context=None, *, fmt, strict=None) -> RunReport
17
+
18
+ # directories (links never followed; sanitize publishes a new directory all-or-nothing)
19
+ inspect_directory(root, policy, context=None, *, recursive=False) -> BatchReport
20
+ plan_directory(root, policy, context=None, *, recursive=False) -> BatchReport
21
+ sanitize_directory(root, output_dir, policy, context=None, options=None, *, recursive=False)
22
+ rescan_directory(root, policy, context=None, *, recursive=False, strict=None) -> BatchReport
23
+ """
24
+
25
+ __version__ = "0.7.0"
26
+
27
+ from ciphergate.config import RuntimeSettings
28
+ from ciphergate.constants import (
29
+ Destination,
30
+ DomainProfile,
31
+ Environment,
32
+ InputFormat,
33
+ TargetEnvironment,
34
+ UseCase,
35
+ )
36
+ from ciphergate.models.context import ContextInput
37
+ from ciphergate.models.report import RunReport, RunStatus
38
+ from ciphergate.pipeline.batch import (
39
+ BatchReport,
40
+ inspect_directory,
41
+ plan_directory,
42
+ rescan_directory,
43
+ sanitize_directory,
44
+ )
45
+ from ciphergate.pipeline.sanitizer import (
46
+ SanitizeOptions,
47
+ inspect_file,
48
+ plan_file,
49
+ rescan_file,
50
+ sanitize_file,
51
+ )
52
+ from ciphergate.pipeline.streams import (
53
+ inspect_stream,
54
+ plan_stream,
55
+ rescan_stream,
56
+ sanitize_stream,
57
+ )
58
+ from ciphergate.policy.validator import (
59
+ Policy,
60
+ ValidationResult,
61
+ load_policy,
62
+ validate_policy,
63
+ )
64
+
65
+ __all__ = [
66
+ "BatchReport",
67
+ "ContextInput",
68
+ "Destination",
69
+ "DomainProfile",
70
+ "Environment",
71
+ "InputFormat",
72
+ "Policy",
73
+ "RunReport",
74
+ "RunStatus",
75
+ "RuntimeSettings",
76
+ "SanitizeOptions",
77
+ "TargetEnvironment",
78
+ "UseCase",
79
+ "ValidationResult",
80
+ "__version__",
81
+ "inspect_directory",
82
+ "inspect_file",
83
+ "inspect_stream",
84
+ "load_policy",
85
+ "plan_directory",
86
+ "plan_file",
87
+ "plan_stream",
88
+ "rescan_directory",
89
+ "rescan_file",
90
+ "rescan_stream",
91
+ "sanitize_directory",
92
+ "sanitize_file",
93
+ "sanitize_stream",
94
+ "validate_policy",
95
+ ]
ciphergate/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """Allow ``python -m ciphergate``."""
2
+
3
+ from ciphergate.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ main()