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.
- ciphergate/__init__.py +95 -0
- ciphergate/__main__.py +6 -0
- ciphergate/cli.py +832 -0
- ciphergate/config.py +50 -0
- ciphergate/constants.py +274 -0
- ciphergate/detectors/__init__.py +5 -0
- ciphergate/detectors/base.py +53 -0
- ciphergate/detectors/custom_regex.py +37 -0
- ciphergate/detectors/dates.py +92 -0
- ciphergate/detectors/email.py +56 -0
- ciphergate/detectors/field_names.py +220 -0
- ciphergate/detectors/ip_address.py +85 -0
- ciphergate/detectors/network.py +42 -0
- ciphergate/detectors/payment_card.py +77 -0
- ciphergate/detectors/phone.py +67 -0
- ciphergate/detectors/presidio_ner.py +112 -0
- ciphergate/detectors/regex_safety.py +40 -0
- ciphergate/detectors/registry.py +194 -0
- ciphergate/detectors/secrets.py +130 -0
- ciphergate/errors.py +119 -0
- ciphergate/models/__init__.py +1 -0
- ciphergate/models/context.py +69 -0
- ciphergate/models/finding.py +108 -0
- ciphergate/models/policy.py +402 -0
- ciphergate/models/report.py +115 -0
- ciphergate/pipeline/__init__.py +1 -0
- ciphergate/pipeline/atomic_output.py +143 -0
- ciphergate/pipeline/batch.py +533 -0
- ciphergate/pipeline/inspector.py +282 -0
- ciphergate/pipeline/paths.py +98 -0
- ciphergate/pipeline/planner.py +192 -0
- ciphergate/pipeline/rescan.py +120 -0
- ciphergate/pipeline/sanitizer.py +392 -0
- ciphergate/pipeline/stdio.py +173 -0
- ciphergate/pipeline/streams.py +152 -0
- ciphergate/policy/__init__.py +26 -0
- ciphergate/policy/context.py +203 -0
- ciphergate/policy/engine.py +194 -0
- ciphergate/policy/loader.py +116 -0
- ciphergate/policy/precedence.py +149 -0
- ciphergate/policy/validator.py +632 -0
- ciphergate/py.typed +0 -0
- ciphergate/readers/__init__.py +113 -0
- ciphergate/readers/accesslog_reader.py +244 -0
- ciphergate/readers/base.py +131 -0
- ciphergate/readers/csv_reader.py +241 -0
- ciphergate/readers/json_reader.py +184 -0
- ciphergate/readers/jsonl_reader.py +97 -0
- ciphergate/readers/jsonlog_reader.py +178 -0
- ciphergate/readers/line_structure.py +125 -0
- ciphergate/readers/logfmt_reader.py +100 -0
- ciphergate/readers/stacktrace_reader.py +103 -0
- ciphergate/readers/syslog_reader.py +309 -0
- ciphergate/readers/text_reader.py +59 -0
- ciphergate/reporting/__init__.py +1 -0
- ciphergate/reporting/audit.py +85 -0
- ciphergate/reporting/safe_text.py +71 -0
- ciphergate/reporting/serializer.py +44 -0
- ciphergate/reporting/terminal.py +147 -0
- ciphergate/templates/starter_policy.yml +77 -0
- ciphergate/transforms/__init__.py +6 -0
- ciphergate/transforms/date_shift.py +79 -0
- ciphergate/transforms/generalize.py +107 -0
- ciphergate/transforms/keys.py +177 -0
- ciphergate/transforms/pseudonymize.py +113 -0
- ciphergate/transforms/redact.py +9 -0
- ciphergate/transforms/registry.py +201 -0
- ciphergate/transforms/replace.py +16 -0
- ciphergate_cli-0.7.0.dist-info/METADATA +531 -0
- ciphergate_cli-0.7.0.dist-info/RECORD +74 -0
- ciphergate_cli-0.7.0.dist-info/WHEEL +4 -0
- ciphergate_cli-0.7.0.dist-info/entry_points.txt +2 -0
- ciphergate_cli-0.7.0.dist-info/licenses/LICENSE +202 -0
- 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
|
+
]
|