ciphergate-cli 0.7.0__tar.gz

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 (141) hide show
  1. ciphergate_cli-0.7.0/.gitignore +42 -0
  2. ciphergate_cli-0.7.0/CHANGELOG.md +272 -0
  3. ciphergate_cli-0.7.0/LICENSE +202 -0
  4. ciphergate_cli-0.7.0/NOTICE +4 -0
  5. ciphergate_cli-0.7.0/PKG-INFO +531 -0
  6. ciphergate_cli-0.7.0/README.md +492 -0
  7. ciphergate_cli-0.7.0/SECURITY.md +67 -0
  8. ciphergate_cli-0.7.0/docs/architecture.md +78 -0
  9. ciphergate_cli-0.7.0/docs/claude-code-tooling.md +69 -0
  10. ciphergate_cli-0.7.0/docs/detector-coverage.md +78 -0
  11. ciphergate_cli-0.7.0/docs/examples.md +64 -0
  12. ciphergate_cli-0.7.0/docs/limitations.md +94 -0
  13. ciphergate_cli-0.7.0/docs/policy-schema.md +173 -0
  14. ciphergate_cli-0.7.0/docs/security-and-privacy.md +110 -0
  15. ciphergate_cli-0.7.0/docs/threat-model.md +39 -0
  16. ciphergate_cli-0.7.0/examples/expected/sample.dev_local_dev.csv +4 -0
  17. ciphergate_cli-0.7.0/examples/expected/sample.dev_local_dev.json +34 -0
  18. ciphergate_cli-0.7.0/examples/expected/sample.dev_local_dev.jsonl +3 -0
  19. ciphergate_cli-0.7.0/examples/expected/sample.dev_local_dev.log +6 -0
  20. ciphergate_cli-0.7.0/examples/sample.csv +4 -0
  21. ciphergate_cli-0.7.0/examples/sample.json +26 -0
  22. ciphergate_cli-0.7.0/examples/sample.jsonl +3 -0
  23. ciphergate_cli-0.7.0/examples/sample.log +6 -0
  24. ciphergate_cli-0.7.0/policies/dev_local.yml +58 -0
  25. ciphergate_cli-0.7.0/policies/developer_logs.yml +97 -0
  26. ciphergate_cli-0.7.0/policies/external_ai.yml +66 -0
  27. ciphergate_cli-0.7.0/policies/financial_template.yml +83 -0
  28. ciphergate_cli-0.7.0/policies/healthcare_template.yml +95 -0
  29. ciphergate_cli-0.7.0/policies/local_debug.yml +41 -0
  30. ciphergate_cli-0.7.0/policies/multi_environment.yml +108 -0
  31. ciphergate_cli-0.7.0/policies/prd_external_ai.yml +102 -0
  32. ciphergate_cli-0.7.0/policies/stg_test.yml +68 -0
  33. ciphergate_cli-0.7.0/policies/test_dataset.yml +71 -0
  34. ciphergate_cli-0.7.0/pyproject.toml +116 -0
  35. ciphergate_cli-0.7.0/src/ciphergate/__init__.py +95 -0
  36. ciphergate_cli-0.7.0/src/ciphergate/__main__.py +6 -0
  37. ciphergate_cli-0.7.0/src/ciphergate/cli.py +832 -0
  38. ciphergate_cli-0.7.0/src/ciphergate/config.py +50 -0
  39. ciphergate_cli-0.7.0/src/ciphergate/constants.py +274 -0
  40. ciphergate_cli-0.7.0/src/ciphergate/detectors/__init__.py +5 -0
  41. ciphergate_cli-0.7.0/src/ciphergate/detectors/base.py +53 -0
  42. ciphergate_cli-0.7.0/src/ciphergate/detectors/custom_regex.py +37 -0
  43. ciphergate_cli-0.7.0/src/ciphergate/detectors/dates.py +92 -0
  44. ciphergate_cli-0.7.0/src/ciphergate/detectors/email.py +56 -0
  45. ciphergate_cli-0.7.0/src/ciphergate/detectors/field_names.py +220 -0
  46. ciphergate_cli-0.7.0/src/ciphergate/detectors/ip_address.py +85 -0
  47. ciphergate_cli-0.7.0/src/ciphergate/detectors/network.py +42 -0
  48. ciphergate_cli-0.7.0/src/ciphergate/detectors/payment_card.py +77 -0
  49. ciphergate_cli-0.7.0/src/ciphergate/detectors/phone.py +67 -0
  50. ciphergate_cli-0.7.0/src/ciphergate/detectors/presidio_ner.py +112 -0
  51. ciphergate_cli-0.7.0/src/ciphergate/detectors/regex_safety.py +40 -0
  52. ciphergate_cli-0.7.0/src/ciphergate/detectors/registry.py +194 -0
  53. ciphergate_cli-0.7.0/src/ciphergate/detectors/secrets.py +130 -0
  54. ciphergate_cli-0.7.0/src/ciphergate/errors.py +119 -0
  55. ciphergate_cli-0.7.0/src/ciphergate/models/__init__.py +1 -0
  56. ciphergate_cli-0.7.0/src/ciphergate/models/context.py +69 -0
  57. ciphergate_cli-0.7.0/src/ciphergate/models/finding.py +108 -0
  58. ciphergate_cli-0.7.0/src/ciphergate/models/policy.py +402 -0
  59. ciphergate_cli-0.7.0/src/ciphergate/models/report.py +115 -0
  60. ciphergate_cli-0.7.0/src/ciphergate/pipeline/__init__.py +1 -0
  61. ciphergate_cli-0.7.0/src/ciphergate/pipeline/atomic_output.py +143 -0
  62. ciphergate_cli-0.7.0/src/ciphergate/pipeline/batch.py +533 -0
  63. ciphergate_cli-0.7.0/src/ciphergate/pipeline/inspector.py +282 -0
  64. ciphergate_cli-0.7.0/src/ciphergate/pipeline/paths.py +98 -0
  65. ciphergate_cli-0.7.0/src/ciphergate/pipeline/planner.py +192 -0
  66. ciphergate_cli-0.7.0/src/ciphergate/pipeline/rescan.py +120 -0
  67. ciphergate_cli-0.7.0/src/ciphergate/pipeline/sanitizer.py +392 -0
  68. ciphergate_cli-0.7.0/src/ciphergate/pipeline/stdio.py +173 -0
  69. ciphergate_cli-0.7.0/src/ciphergate/pipeline/streams.py +152 -0
  70. ciphergate_cli-0.7.0/src/ciphergate/policy/__init__.py +26 -0
  71. ciphergate_cli-0.7.0/src/ciphergate/policy/context.py +203 -0
  72. ciphergate_cli-0.7.0/src/ciphergate/policy/engine.py +194 -0
  73. ciphergate_cli-0.7.0/src/ciphergate/policy/loader.py +116 -0
  74. ciphergate_cli-0.7.0/src/ciphergate/policy/precedence.py +149 -0
  75. ciphergate_cli-0.7.0/src/ciphergate/policy/validator.py +632 -0
  76. ciphergate_cli-0.7.0/src/ciphergate/py.typed +0 -0
  77. ciphergate_cli-0.7.0/src/ciphergate/readers/__init__.py +113 -0
  78. ciphergate_cli-0.7.0/src/ciphergate/readers/accesslog_reader.py +244 -0
  79. ciphergate_cli-0.7.0/src/ciphergate/readers/base.py +131 -0
  80. ciphergate_cli-0.7.0/src/ciphergate/readers/csv_reader.py +241 -0
  81. ciphergate_cli-0.7.0/src/ciphergate/readers/json_reader.py +184 -0
  82. ciphergate_cli-0.7.0/src/ciphergate/readers/jsonl_reader.py +97 -0
  83. ciphergate_cli-0.7.0/src/ciphergate/readers/jsonlog_reader.py +178 -0
  84. ciphergate_cli-0.7.0/src/ciphergate/readers/line_structure.py +125 -0
  85. ciphergate_cli-0.7.0/src/ciphergate/readers/logfmt_reader.py +100 -0
  86. ciphergate_cli-0.7.0/src/ciphergate/readers/stacktrace_reader.py +103 -0
  87. ciphergate_cli-0.7.0/src/ciphergate/readers/syslog_reader.py +309 -0
  88. ciphergate_cli-0.7.0/src/ciphergate/readers/text_reader.py +59 -0
  89. ciphergate_cli-0.7.0/src/ciphergate/reporting/__init__.py +1 -0
  90. ciphergate_cli-0.7.0/src/ciphergate/reporting/audit.py +85 -0
  91. ciphergate_cli-0.7.0/src/ciphergate/reporting/safe_text.py +71 -0
  92. ciphergate_cli-0.7.0/src/ciphergate/reporting/serializer.py +44 -0
  93. ciphergate_cli-0.7.0/src/ciphergate/reporting/terminal.py +147 -0
  94. ciphergate_cli-0.7.0/src/ciphergate/templates/starter_policy.yml +77 -0
  95. ciphergate_cli-0.7.0/src/ciphergate/transforms/__init__.py +6 -0
  96. ciphergate_cli-0.7.0/src/ciphergate/transforms/date_shift.py +79 -0
  97. ciphergate_cli-0.7.0/src/ciphergate/transforms/generalize.py +107 -0
  98. ciphergate_cli-0.7.0/src/ciphergate/transforms/keys.py +177 -0
  99. ciphergate_cli-0.7.0/src/ciphergate/transforms/pseudonymize.py +113 -0
  100. ciphergate_cli-0.7.0/src/ciphergate/transforms/redact.py +9 -0
  101. ciphergate_cli-0.7.0/src/ciphergate/transforms/registry.py +201 -0
  102. ciphergate_cli-0.7.0/src/ciphergate/transforms/replace.py +16 -0
  103. ciphergate_cli-0.7.0/tests/__init__.py +0 -0
  104. ciphergate_cli-0.7.0/tests/conftest.py +106 -0
  105. ciphergate_cli-0.7.0/tests/integration/__init__.py +0 -0
  106. ciphergate_cli-0.7.0/tests/integration/test_api_batch_streams.py +242 -0
  107. ciphergate_cli-0.7.0/tests/integration/test_atomic_output.py +192 -0
  108. ciphergate_cli-0.7.0/tests/integration/test_batch.py +356 -0
  109. ciphergate_cli-0.7.0/tests/integration/test_cli_e2e.py +348 -0
  110. ciphergate_cli-0.7.0/tests/integration/test_domain_templates.py +115 -0
  111. ciphergate_cli-0.7.0/tests/integration/test_environment_matrix.py +258 -0
  112. ciphergate_cli-0.7.0/tests/integration/test_pipelines.py +337 -0
  113. ciphergate_cli-0.7.0/tests/integration/test_stdio.py +299 -0
  114. ciphergate_cli-0.7.0/tests/regression/__init__.py +0 -0
  115. ciphergate_cli-0.7.0/tests/regression/test_known_cases.py +67 -0
  116. ciphergate_cli-0.7.0/tests/security/__init__.py +0 -0
  117. ciphergate_cli-0.7.0/tests/security/test_key_file.py +123 -0
  118. ciphergate_cli-0.7.0/tests/security/test_no_network.py +77 -0
  119. ciphergate_cli-0.7.0/tests/security/test_no_raw_value_leaks.py +154 -0
  120. ciphergate_cli-0.7.0/tests/security/test_path_safety.py +127 -0
  121. ciphergate_cli-0.7.0/tests/security/test_policy_fail_closed.py +88 -0
  122. ciphergate_cli-0.7.0/tests/security/test_review_findings.py +341 -0
  123. ciphergate_cli-0.7.0/tests/tooling/__init__.py +0 -0
  124. ciphergate_cli-0.7.0/tests/tooling/test_ci_supply_chain.py +65 -0
  125. ciphergate_cli-0.7.0/tests/tooling/test_claude_tooling.py +207 -0
  126. ciphergate_cli-0.7.0/tests/tooling/test_git_tooling.py +155 -0
  127. ciphergate_cli-0.7.0/tests/tooling/test_publish_workflow.py +71 -0
  128. ciphergate_cli-0.7.0/tests/unit/__init__.py +0 -0
  129. ciphergate_cli-0.7.0/tests/unit/test_accesslog.py +398 -0
  130. ciphergate_cli-0.7.0/tests/unit/test_detectors.py +392 -0
  131. ciphergate_cli-0.7.0/tests/unit/test_jsonlog.py +444 -0
  132. ciphergate_cli-0.7.0/tests/unit/test_logfmt.py +257 -0
  133. ciphergate_cli-0.7.0/tests/unit/test_policy_engine.py +369 -0
  134. ciphergate_cli-0.7.0/tests/unit/test_policy_precedence.py +212 -0
  135. ciphergate_cli-0.7.0/tests/unit/test_policy_validation.py +320 -0
  136. ciphergate_cli-0.7.0/tests/unit/test_presidio_ner.py +299 -0
  137. ciphergate_cli-0.7.0/tests/unit/test_properties.py +178 -0
  138. ciphergate_cli-0.7.0/tests/unit/test_readers.py +246 -0
  139. ciphergate_cli-0.7.0/tests/unit/test_stacktrace.py +370 -0
  140. ciphergate_cli-0.7.0/tests/unit/test_syslog.py +402 -0
  141. ciphergate_cli-0.7.0/tests/unit/test_transforms.py +349 -0
@@ -0,0 +1,42 @@
1
+ # Python / build
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .eggs/
8
+ # Virtual environments
9
+ .venv/
10
+ venv/
11
+ env/
12
+ # Tool caches and coverage
13
+ .pytest_cache/
14
+ .mypy_cache/
15
+ .ruff_cache/
16
+ .hypothesis/
17
+ .coverage
18
+ .coverage.*
19
+ coverage.xml
20
+ htmlcov/
21
+ # Secrets and keys (never commit)
22
+ .env
23
+ .env.*
24
+ !.env.example
25
+ *.key
26
+ *.pem
27
+ secrets/
28
+ # Local / real data and CipherGate outputs (keep synthetic examples/ and policies/)
29
+ data/
30
+ real_data/
31
+ *.sanitized.*
32
+ *.report.json
33
+ ciphergate-policy.yml
34
+ .ciphergate-*.tmp
35
+ # Claude Code machine-local settings
36
+ .claude/settings.local.json
37
+ # Editors / OS
38
+ .idea/
39
+ .vscode/
40
+ *.swp
41
+ .DS_Store
42
+ Thumbs.db
@@ -0,0 +1,272 @@
1
+ # Changelog
2
+
3
+ All notable changes are documented here. Format: [Keep a Changelog](https://keepachangelog.com/);
4
+ versioning: [PEP 440](https://peps.python.org/pep-0440/) with SemVer meaning (pre-1.0: minor versions may break;
5
+ `aN` = alpha pre-release).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.7.0] - 2026-10-30
10
+
11
+ First release published to PyPI. CLI, API and policy behaviour are unchanged, except for the
12
+ corrected NER install hint below.
13
+
14
+ ### Changed
15
+
16
+ - The PyPI distribution is now named `ciphergate-cli`, because `ciphergate` on PyPI is an
17
+ unrelated project. The import package and the `ciphergate` command are unchanged. The optional
18
+ NER extra is `ciphergate-cli[ner]`: the old hint `pip install 'ciphergate[ner]'` would have
19
+ installed that unrelated package.
20
+
21
+ ### Added
22
+
23
+ - Release publishing workflow (`.github/workflows/publish.yml`). On each published GitHub
24
+ release it builds from the tag on a GitHub runner, checks and smoke-tests the files, and
25
+ attaches them with `SHA256SUMS`. After maintainer approval it uploads the same files to PyPI
26
+ with Trusted Publishing (no stored token).
27
+
28
+ ## [0.6.1] - 2026-10-30
29
+
30
+ Starter-policy update for `--format stacktrace`. No code changes.
31
+
32
+ ### Changed
33
+
34
+ - Starter policies: `dev_local` keeps stack-trace frames and source lines (`stack_trace`
35
+ detector) for local debugging. `developer_logs` keeps them for `local_dev`, `approved_internal`
36
+ and `production_monitoring` and redacts them for every other destination. Before, these
37
+ findings fell back to review with `--format stacktrace`. Other `proprietary.source` findings
38
+ are unchanged.
39
+
40
+ ## [0.6.0] - 2026-10-30
41
+
42
+ Adds stack-trace-aware log input as `--format stacktrace`. Existing formats behave as before.
43
+
44
+ ### Added
45
+
46
+ - Stack-trace format (#47): `--format stacktrace` scans each line like `text` and also
47
+ recognises Python tracebacks and JVM/Node.js frames. Frame and Python source lines get a
48
+ `proprietary.source` finding from the new `stack_trace` detector (`/stack/frames/N`,
49
+ `/stack/frames/N/source`), so policies can redact, review or block them; exception lines get
50
+ `/stack/exception` (`/stack/caused_by`, `/stack/suppressed`). No lookahead or buffering;
51
+ never selected from the file extension.
52
+
53
+ ## [0.5.0] - 2026-10-29
54
+
55
+ Adds syslog (RFC 5424 and RFC 3164) and CEF parsing as `--format syslog`. Existing formats
56
+ behave as before; rescan additionally recognises CipherGate markers inside escaped fields.
57
+
58
+ ### Added
59
+
60
+ - syslog/CEF format (#46): `--format syslog` for RFC 5424 and RFC 3164 lines (including rsyslog
61
+ files) and CEF records, bare or as a syslog message. Header fields, RFC 5424 structured-data
62
+ parameters (`/sd/<sd-id>/<name>`) and CEF headers and extensions (`/cef/extension/<key>`)
63
+ become fields. Short CEF keys get canonical names for the field-name heuristics (`suser`,
64
+ `src`, ...; `csN` via `csNLabel`) while findings keep the raw key. Escapes are decoded for
65
+ scanning and re-applied to replacements; every rewritten line must still parse.
66
+
67
+ ### Changed
68
+
69
+ - Rescan recognises a field whose whole decoded value is a CipherGate marker or replacement,
70
+ even when a pattern matched only part of its escaped form (e.g. `[REDACTED:...\]` in syslog
71
+ structured data).
72
+
73
+ ## [0.4.0] - 2026-10-29
74
+
75
+ Adds two structured log formats, JSON-in-log and nginx/Apache access logs, and fixes a phone
76
+ detection gap in logfmt. Existing formats behave as before, except that `remote_user` fields
77
+ are now classified as customer identifiers.
78
+
79
+ ### Added
80
+
81
+ - JSON-in-log format (#39): `--format jsonlog` for log lines that embed JSON objects. Each line
82
+ is scanned exactly like `text`; embedded objects add field context (JSON Pointer paths,
83
+ field-name heuristics and policy classifications on keys, decoding of escaped values and
84
+ keys). Rewrites are JSON-escaped and re-validated; a rewrite that would break an embedded
85
+ object fails the run. Never selected from the file extension.
86
+ - Access-log format (#39): `--format accesslog` for nginx/Apache common and combined lines.
87
+ Fields get nginx variable names (`/remote_addr`, `/request/path`, `/http_user_agent`, ...),
88
+ query parameters of the request and referer become fields (`/request/query/<name>`), and log
89
+ escapes and percent-encoding are decoded for scanning. Replacements are re-encoded per field
90
+ and every rewritten line must still parse, or the run fails.
91
+
92
+ ### Changed
93
+
94
+ - The `remote_user` field name is now classified as `pii.customer_identifier` in every format.
95
+
96
+ ### Fixed
97
+
98
+ - Phone numbers inside a value whose field name implies email (for example
99
+ `email="call 202-555-0143"` in logfmt) are no longer suppressed by the whole-value field-name
100
+ finding.
101
+
102
+ ## [0.3.0] - 2026-10-29
103
+
104
+ Adds the Python API for streams and directories, and fixes a macOS path-safety bug in
105
+ directory runs that shipped in 0.2.0. CLI behaviour on Linux and Windows is unchanged.
106
+
107
+ ### Added
108
+
109
+ - Python API for streams and directories (#38): `inspect_stream`, `plan_stream`,
110
+ `rescan_stream` and `sanitize_stream` take binary streams (format required; input spooled to
111
+ a private, size-capped workspace; output written only after a successful run).
112
+ `inspect_directory`, `plan_directory`, `rescan_directory` and `sanitize_directory` expose
113
+ directory runs and return the newly exported `BatchReport`. `sanitize_directory` refuses
114
+ `force=True`, as the CLI does.
115
+
116
+ ### Changed
117
+
118
+ - CI runs the test suite on macOS (py3.12) again (#37). Case-alias tests now run on any
119
+ case-insensitive filesystem instead of only on Windows.
120
+
121
+ ### Fixed
122
+
123
+ - macOS: a directory run accepted an output directory inside the input directory when the
124
+ output path used a different letter case (`--output IN/out` for input `in`), because path
125
+ comparison relied on `normcase`, which does nothing on POSIX. The check now compares file
126
+ identity up the parent chain. The same applies to `--report` placement in directory runs.
127
+ Windows and Linux were not affected. Found by the new macOS CI job (#37).
128
+
129
+ ## [0.2.0] - 2026-10-29
130
+
131
+ Feature release. Existing policies, reports and single-file behaviour are unchanged, except
132
+ where noted below.
133
+
134
+ ### Added
135
+
136
+ - Optional local NER detector (#7): `pip install 'ciphergate[ner]'` plus a user-installed spaCy
137
+ model; enable with `detectors.presidio` in the policy (off by default). Presidio entities map
138
+ to categories (default `PERSON` -> `pii.person_name`, `LOCATION` -> `location.coarse`) and
139
+ findings use detector `presidio_ner`. A missing extra or model fails with exit 6 and is never
140
+ downloaded. Third-party error messages are replaced. Tested with a fake engine only.
141
+ - Directory (batch) runs (#9): `inspect`, `plan`, `rescan` and `sanitize` accept a directory
142
+ INPUT, with `--recursive` and `--max-files` (default 1000). Symlinks, junctions and special
143
+ files are skipped and reported, never followed. `sanitize` stages the whole output tree and
144
+ publishes a new directory only if every file was sanitized. Batch report schema
145
+ `ciphergate.batch-report/v1`; the exit code is the first failing file's. CLI only.
146
+ - logfmt format (#11): `--format logfmt` for `key=value` log lines. Each line is scanned exactly
147
+ like `text` (property-tested: never fewer findings), plus field context: findings inside a
148
+ value are attributed to that field (`/key`) and field-name heuristics run on keys, so policy
149
+ field rules apply to log fields. Lines are rewritten span by span, preserving quoting.
150
+ `drop_field` becomes `review`. In span transforms, each finding now uses its own field path
151
+ for pseudonym scope (unchanged for existing formats).
152
+ - Key files (#10): set `<key_env>_FILE` (e.g. `CIPHERGATE_HMAC_KEY_FILE`) to a key file path.
153
+ The file must be regular and at most 4 KiB; on POSIX it must be owned by the current user with
154
+ no group/other permissions (symlink targets are checked). Windows ACLs are not checked (a
155
+ warning is logged). Setting both sources is refused. Failures exit 6 (`key_file_invalid`)
156
+ without output. Reports add the key `source` (`env`/`file`), never the path.
157
+ - stdin/stdout support in the CLI (#8): `-` as INPUT for `inspect`, `plan`, `sanitize` and
158
+ `rescan` (requires `--format`), and `sanitize --output -`. stdin is spooled to a private,
159
+ size-capped temporary workspace that is always removed; stdout receives data only after every
160
+ check passed, with the summary on stderr. A closed pipe exits 5 (`stdout_broken_pipe`).
161
+ `--report -` is refused (it would previously have created a file named `-`).
162
+
163
+ ### Changed
164
+
165
+ - Run reports list a `source` for each key (`env` or `file`).
166
+ - The Python API still rejects a directory input (`input_is_directory`); the message now points
167
+ to the CLI, which supports directory runs.
168
+
169
+ ## [0.1.1] - 2026-10-29
170
+
171
+ Patch release: corrects the declared minimum dependency versions and hardens CI. No change
172
+ to detection, policy or transform behaviour.
173
+
174
+ ### Fixed
175
+
176
+ - Runtime dependency floors were not actually supported: with `typer` 0.12–0.18 and a current
177
+ `click`, most CLI commands failed. The minimum is now `typer>=0.19`, and `PyYAML>=6.0.1`
178
+ (6.0 does not install on current Python). A new `min-deps` CI job runs the suite at the
179
+ declared lower bounds (`ci/constraints-min.txt`) so floors stay tested (#5).
180
+
181
+ ### Security
182
+
183
+ - CI actions are pinned to full commit SHAs (`actions/checkout` v7.0.1,
184
+ `actions/setup-python` v7.1.0) and checkout no longer persists the GitHub credential; a
185
+ tooling test enforces both (#5).
186
+ - Dependabot only raises dependency lower bounds when a new release falls outside the declared
187
+ range, groups Actions updates, and never updates `ci/constraints-min.txt`.
188
+
189
+ ## [0.1.0] - 2026-10-28
190
+
191
+ First release (still alpha quality: pre-1.0, interfaces may change). Same software as 0.1.0a1,
192
+ plus a configured security contact. Policy templates still need review for each real workflow
193
+ (#3); a successful run is never proof that output contains no sensitive data.
194
+
195
+ ### Added
196
+
197
+ - Security contact in `SECURITY.md` (email), target response times, report scope and
198
+ supported versions (#2).
199
+
200
+ ## [0.1.0a1] - 2026-10-28
201
+
202
+ Pre-release (alpha). Licensed under Apache-2.0. Not a final release: the security contact in
203
+ `SECURITY.md` is still a placeholder (#2), and policy templates need review for real workflows
204
+ (#3).
205
+
206
+ ### Added
207
+
208
+ - Apache-2.0 license (`LICENSE`, `NOTICE`, package metadata).
209
+ - Repository workflow: `scripts/git_safety_check.py` (protected-branch, forbidden-path, size and
210
+ secret-pattern checks with a hashed allowlist), `scripts/check_commit_msg.py` (Conventional
211
+ Commits), pre-commit `git-safety`/`commit-msg` hooks, a `repo-safety` CI job with PR-title
212
+ check, PR template, issue forms, Dependabot, and the `/git-workflow` Claude Code skill.
213
+ - `ciphergate` CLI (first implementation, #12): `init`, `validate-policy`, `inspect`, `plan`, `sanitize --apply`, `rescan`,
214
+ `explain`, `--version`; documented exit codes 0–8 and 130.
215
+ - Python API: `load_policy`, `validate_policy`, `inspect_file`, `plan_file`, `sanitize_file`,
216
+ `rescan_file`.
217
+ - Readers/writers for CSV, JSON, JSONL/NDJSON and text/log with size, line, depth and findings
218
+ limits; strict UTF-8 by default.
219
+ - Detectors: field names, policy classifications, email, phone, IPv4/IPv6, Luhn cards, dates/DOB,
220
+ secrets (incl. multi-line PEM blocks), internal hosts, custom regex with safety heuristics.
221
+ - Policy schema v1 (pydantic, unknown keys rejected), safe YAML loader, computed precedence
222
+ levels, conflict rejection, credential hard constraints, risky-allow acknowledgement,
223
+ environment/destination context with pinning and explicit overrides, run-level guardrails
224
+ (PRD -> non-production, strict + rescan for external/unknown/prd targets), reviewed transfer
225
+ approvals.
226
+ - Actions: allow, redact, replace, pseudonymize (HMAC-SHA-256, transform version `pz1`),
227
+ generalize, date_shift, drop_field, drop_record, block, review. `tokenize` rejected.
228
+ - Two-pass sanitize with plan/apply consistency check, residual rescan gate, input-change
229
+ detection and atomic, no-overwrite publishing.
230
+ - Privacy-safe JSON (`ciphergate.report/v1`) and text reports.
231
+ - Policy templates: dev_local, stg_test, prd_external_ai, developer_logs, test_dataset,
232
+ external_ai, healthcare_template, financial_template, local_debug, multi_environment.
233
+ - Synthetic examples with expected outputs; docs; CI workflow; Claude Code skills, subagents and
234
+ hooks for development.
235
+
236
+ ### Changed
237
+
238
+ - CI tests Linux (Python 3.11-3.13) and Windows (3.12); macOS was dropped because hosted
239
+ runners could not be acquired (#21).
240
+
241
+ ### Security fixes before first release (from an independent review)
242
+
243
+ - CSV header cells are now scanned, transformed (allow/drop_field/block/review), rescanned and
244
+ hidden in reports when they produce a finding; previously the header was published unscanned.
245
+ - The rescan gate can no longer be emptied: `fail_on_categories: []` is rejected,
246
+ `credential.secret` always gates, and untrusted destinations gate on every high-risk category.
247
+ - A missing destination is treated as untrusted by run-level gates (strict + rescan required).
248
+ - `secret_pattern`/`field_name` cannot be disabled for strict/untrusted/transfer policies or runs.
249
+ - JSON keys must be scanned for untrusted destinations; all templates set `scan_json_keys: true`.
250
+ - Custom categories in high-risk families are high-risk; external/unknown target environments
251
+ count as untrusted for `allow` acknowledgement.
252
+ - Transfer approvals must name every supplied context dimension; future `approved_on` rejected.
253
+ - Temp-file cleanup failures are logged; a report-write failure after publishing says so.
254
+ - `developer_logs` keeps identifiers for internal destinations only for DEV/STG-origin data.
255
+ - CSV writer quotes rows containing a lone CR/LF (previously such a value could be corrupted).
256
+
257
+ ### Known limitations
258
+
259
+ See `docs/limitations.md`. Deferred: optional NER/Presidio detectors, stdin/stdout streaming,
260
+ directory processing, structured log parsers, key files, reversible token vault, lossy decoding.
261
+
262
+ [Unreleased]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.7.0...HEAD
263
+ [0.7.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.6.1...v0.7.0
264
+ [0.6.1]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.6.0...v0.6.1
265
+ [0.6.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.5.0...v0.6.0
266
+ [0.5.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.4.0...v0.5.0
267
+ [0.4.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.3.0...v0.4.0
268
+ [0.3.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.2.0...v0.3.0
269
+ [0.2.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.1.1...v0.2.0
270
+ [0.1.1]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.1.0...v0.1.1
271
+ [0.1.0]: https://github.com/aashishkumar-tech/ciphergate/compare/v0.1.0a1...v0.1.0
272
+ [0.1.0a1]: https://github.com/aashishkumar-tech/ciphergate/releases/tag/v0.1.0a1
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
@@ -0,0 +1,4 @@
1
+ CipherGate
2
+ Copyright 2026 Aashish Kumar
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).