sealgate 0.1.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 (84) hide show
  1. sealgate-0.1.0/.gitignore +14 -0
  2. sealgate-0.1.0/LICENSE +387 -0
  3. sealgate-0.1.0/NOTICE +6 -0
  4. sealgate-0.1.0/PKG-INFO +92 -0
  5. sealgate-0.1.0/README.md +65 -0
  6. sealgate-0.1.0/licenses/COMMONS-CLAUSE.txt +11 -0
  7. sealgate-0.1.0/licenses/MPL-2.0.txt +373 -0
  8. sealgate-0.1.0/pyproject.toml +37 -0
  9. sealgate-0.1.0/src/sealgate/__init__.py +26 -0
  10. sealgate-0.1.0/src/sealgate/__main__.py +8 -0
  11. sealgate-0.1.0/src/sealgate/api.py +212 -0
  12. sealgate-0.1.0/src/sealgate/attest.py +225 -0
  13. sealgate-0.1.0/src/sealgate/canonical.py +21 -0
  14. sealgate-0.1.0/src/sealgate/checks/__init__.py +1 -0
  15. sealgate-0.1.0/src/sealgate/checks/fields.py +79 -0
  16. sealgate-0.1.0/src/sealgate/checks/intake.py +34 -0
  17. sealgate-0.1.0/src/sealgate/checks/objects.py +48 -0
  18. sealgate-0.1.0/src/sealgate/checks/rawscan.py +95 -0
  19. sealgate-0.1.0/src/sealgate/checks/revisions.py +51 -0
  20. sealgate-0.1.0/src/sealgate/checks/similarity.py +93 -0
  21. sealgate-0.1.0/src/sealgate/cli.py +610 -0
  22. sealgate-0.1.0/src/sealgate/data/matchers.yaml +83 -0
  23. sealgate-0.1.0/src/sealgate/data/signals.yaml +17 -0
  24. sealgate-0.1.0/src/sealgate/hardening/__init__.py +7 -0
  25. sealgate-0.1.0/src/sealgate/hardening/facts.py +614 -0
  26. sealgate-0.1.0/src/sealgate/hardening/profile.py +585 -0
  27. sealgate-0.1.0/src/sealgate/integrity.py +541 -0
  28. sealgate-0.1.0/src/sealgate/inventory.py +179 -0
  29. sealgate-0.1.0/src/sealgate/matchers.py +388 -0
  30. sealgate-0.1.0/src/sealgate/observer.py +54 -0
  31. sealgate-0.1.0/src/sealgate/pipeline.py +293 -0
  32. sealgate-0.1.0/src/sealgate/py.typed +0 -0
  33. sealgate-0.1.0/src/sealgate/sandbox.py +199 -0
  34. sealgate-0.1.0/src/sealgate/settings.py +143 -0
  35. sealgate-0.1.0/src/sealgate/signals.py +183 -0
  36. sealgate-0.1.0/src/sealgate/templates/__init__.py +19 -0
  37. sealgate-0.1.0/src/sealgate/templates/approval.py +121 -0
  38. sealgate-0.1.0/src/sealgate/templates/induce.py +501 -0
  39. sealgate-0.1.0/src/sealgate/templates/learn.py +114 -0
  40. sealgate-0.1.0/src/sealgate/templates/store.py +264 -0
  41. sealgate-0.1.0/src/sealgate/tools/__init__.py +2 -0
  42. sealgate-0.1.0/src/sealgate/tools/evaluate.py +221 -0
  43. sealgate-0.1.0/src/sealgate/tools/fixtures.py +470 -0
  44. sealgate-0.1.0/src/sealgate/tools/mutate.py +723 -0
  45. sealgate-0.1.0/src/sealgate/types.py +135 -0
  46. sealgate-0.1.0/src/sealgate/worker.py +472 -0
  47. sealgate-0.1.0/tests/conftest.py +85 -0
  48. sealgate-0.1.0/tests/data/cyclonedx/SOURCE.md +10 -0
  49. sealgate-0.1.0/tests/data/cyclonedx/bom-1.6.schema.json +5673 -0
  50. sealgate-0.1.0/tests/data/cyclonedx/jsf-0.82.schema.json +240 -0
  51. sealgate-0.1.0/tests/data/cyclonedx/spdx.schema.json +712 -0
  52. sealgate-0.1.0/tests/data/fonts/DejaVuSans.ttf +0 -0
  53. sealgate-0.1.0/tests/data/fonts/LICENSE-DejaVu.txt +78 -0
  54. sealgate-0.1.0/tests/data/rfc9421/SOURCE.txt +13 -0
  55. sealgate-0.1.0/tests/data/rfc9421/b25-signature-base.txt +7 -0
  56. sealgate-0.1.0/tests/data/rfc9421/b25-signature-headers.txt +5 -0
  57. sealgate-0.1.0/tests/data/rfc9421/b26-signature-base.txt +11 -0
  58. sealgate-0.1.0/tests/data/rfc9421/b26-signature-headers.txt +7 -0
  59. sealgate-0.1.0/tests/data/rfc9421/test-key-ed25519.pem +7 -0
  60. sealgate-0.1.0/tests/data/rfc9421/test-request.txt +11 -0
  61. sealgate-0.1.0/tests/data/rfc9421/test-shared-secret.txt +4 -0
  62. sealgate-0.1.0/tests/data/rfc9530/SOURCE.txt +7 -0
  63. sealgate-0.1.0/tests/data/rfc9530/b1-response.txt +11 -0
  64. sealgate-0.1.0/tests/test_attest.py +612 -0
  65. sealgate-0.1.0/tests/test_cli.py +350 -0
  66. sealgate-0.1.0/tests/test_corpus_golden.py +158 -0
  67. sealgate-0.1.0/tests/test_evaluate.py +150 -0
  68. sealgate-0.1.0/tests/test_fixtures.py +161 -0
  69. sealgate-0.1.0/tests/test_hardening.py +816 -0
  70. sealgate-0.1.0/tests/test_induce.py +397 -0
  71. sealgate-0.1.0/tests/test_intake.py +89 -0
  72. sealgate-0.1.0/tests/test_integrity.py +462 -0
  73. sealgate-0.1.0/tests/test_inventory.py +266 -0
  74. sealgate-0.1.0/tests/test_learn.py +76 -0
  75. sealgate-0.1.0/tests/test_matchers.py +288 -0
  76. sealgate-0.1.0/tests/test_mutate.py +82 -0
  77. sealgate-0.1.0/tests/test_observer.py +127 -0
  78. sealgate-0.1.0/tests/test_pipeline.py +273 -0
  79. sealgate-0.1.0/tests/test_rawscan.py +193 -0
  80. sealgate-0.1.0/tests/test_sandbox.py +318 -0
  81. sealgate-0.1.0/tests/test_scripts.py +166 -0
  82. sealgate-0.1.0/tests/test_signals.py +242 -0
  83. sealgate-0.1.0/tests/test_smoke.py +6 -0
  84. sealgate-0.1.0/tests/test_templates.py +445 -0
@@ -0,0 +1,14 @@
1
+ .venv/
2
+ dist/
3
+ .ruff_cache/
4
+ .coverage
5
+ htmlcov/
6
+ sbom/
7
+ __pycache__/
8
+ .pytest_cache/
9
+ coverage*.xml
10
+ # Real samples never enter the repository. The README quick start writes into demo/.
11
+ .local-fixtures/
12
+ /demo/
13
+ *.pdf
14
+ !packages/*/tests/fixtures/**/*.pdf
sealgate-0.1.0/LICENSE ADDED
@@ -0,0 +1,387 @@
1
+ “Commons Clause” License Condition v1.0
2
+
3
+ The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
4
+
5
+ Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software.
6
+
7
+ For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.
8
+
9
+ Software: sealgate
10
+ License: Mozilla Public License 2.0
11
+ Licensor: The sealgate authors
12
+
13
+ ======================================================================
14
+
15
+ Mozilla Public License Version 2.0
16
+ ==================================
17
+
18
+ 1. Definitions
19
+ --------------
20
+
21
+ 1.1. "Contributor"
22
+ means each individual or legal entity that creates, contributes to
23
+ the creation of, or owns Covered Software.
24
+
25
+ 1.2. "Contributor Version"
26
+ means the combination of the Contributions of others (if any) used
27
+ by a Contributor and that particular Contributor's Contribution.
28
+
29
+ 1.3. "Contribution"
30
+ means Covered Software of a particular Contributor.
31
+
32
+ 1.4. "Covered Software"
33
+ means Source Code Form to which the initial Contributor has attached
34
+ the notice in Exhibit A, the Executable Form of such Source Code
35
+ Form, and Modifications of such Source Code Form, in each case
36
+ including portions thereof.
37
+
38
+ 1.5. "Incompatible With Secondary Licenses"
39
+ means
40
+
41
+ (a) that the initial Contributor has attached the notice described
42
+ in Exhibit B to the Covered Software; or
43
+
44
+ (b) that the Covered Software was made available under the terms of
45
+ version 1.1 or earlier of the License, but not also under the
46
+ terms of a Secondary License.
47
+
48
+ 1.6. "Executable Form"
49
+ means any form of the work other than Source Code Form.
50
+
51
+ 1.7. "Larger Work"
52
+ means a work that combines Covered Software with other material, in
53
+ a separate file or files, that is not Covered Software.
54
+
55
+ 1.8. "License"
56
+ means this document.
57
+
58
+ 1.9. "Licensable"
59
+ means having the right to grant, to the maximum extent possible,
60
+ whether at the time of the initial grant or subsequently, any and
61
+ all of the rights conveyed by this License.
62
+
63
+ 1.10. "Modifications"
64
+ means any of the following:
65
+
66
+ (a) any file in Source Code Form that results from an addition to,
67
+ deletion from, or modification of the contents of Covered
68
+ Software; or
69
+
70
+ (b) any new file in Source Code Form that contains any Covered
71
+ Software.
72
+
73
+ 1.11. "Patent Claims" of a Contributor
74
+ means any patent claim(s), including without limitation, method,
75
+ process, and apparatus claims, in any patent Licensable by such
76
+ Contributor that would be infringed, but for the grant of the
77
+ License, by the making, using, selling, offering for sale, having
78
+ made, import, or transfer of either its Contributions or its
79
+ Contributor Version.
80
+
81
+ 1.12. "Secondary License"
82
+ means either the GNU General Public License, Version 2.0, the GNU
83
+ Lesser General Public License, Version 2.1, the GNU Affero General
84
+ Public License, Version 3.0, or any later versions of those
85
+ licenses.
86
+
87
+ 1.13. "Source Code Form"
88
+ means the form of the work preferred for making modifications.
89
+
90
+ 1.14. "You" (or "Your")
91
+ means an individual or a legal entity exercising rights under this
92
+ License. For legal entities, "You" includes any entity that
93
+ controls, is controlled by, or is under common control with You. For
94
+ purposes of this definition, "control" means (a) the power, direct
95
+ or indirect, to cause the direction or management of such entity,
96
+ whether by contract or otherwise, or (b) ownership of more than
97
+ fifty percent (50%) of the outstanding shares or beneficial
98
+ ownership of such entity.
99
+
100
+ 2. License Grants and Conditions
101
+ --------------------------------
102
+
103
+ 2.1. Grants
104
+
105
+ Each Contributor hereby grants You a world-wide, royalty-free,
106
+ non-exclusive license:
107
+
108
+ (a) under intellectual property rights (other than patent or trademark)
109
+ Licensable by such Contributor to use, reproduce, make available,
110
+ modify, display, perform, distribute, and otherwise exploit its
111
+ Contributions, either on an unmodified basis, with Modifications, or
112
+ as part of a Larger Work; and
113
+
114
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
115
+ for sale, have made, import, and otherwise transfer either its
116
+ Contributions or its Contributor Version.
117
+
118
+ 2.2. Effective Date
119
+
120
+ The licenses granted in Section 2.1 with respect to any Contribution
121
+ become effective for each Contribution on the date the Contributor first
122
+ distributes such Contribution.
123
+
124
+ 2.3. Limitations on Grant Scope
125
+
126
+ The licenses granted in this Section 2 are the only rights granted under
127
+ this License. No additional rights or licenses will be implied from the
128
+ distribution or licensing of Covered Software under this License.
129
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
130
+ Contributor:
131
+
132
+ (a) for any code that a Contributor has removed from Covered Software;
133
+ or
134
+
135
+ (b) for infringements caused by: (i) Your and any other third party's
136
+ modifications of Covered Software, or (ii) the combination of its
137
+ Contributions with other software (except as part of its Contributor
138
+ Version); or
139
+
140
+ (c) under Patent Claims infringed by Covered Software in the absence of
141
+ its Contributions.
142
+
143
+ This License does not grant any rights in the trademarks, service marks,
144
+ or logos of any Contributor (except as may be necessary to comply with
145
+ the notice requirements in Section 3.4).
146
+
147
+ 2.4. Subsequent Licenses
148
+
149
+ No Contributor makes additional grants as a result of Your choice to
150
+ distribute the Covered Software under a subsequent version of this
151
+ License (see Section 10.2) or under the terms of a Secondary License (if
152
+ permitted under the terms of Section 3.3).
153
+
154
+ 2.5. Representation
155
+
156
+ Each Contributor represents that the Contributor believes its
157
+ Contributions are its original creation(s) or it has sufficient rights
158
+ to grant the rights to its Contributions conveyed by this License.
159
+
160
+ 2.6. Fair Use
161
+
162
+ This License is not intended to limit any rights You have under
163
+ applicable copyright doctrines of fair use, fair dealing, or other
164
+ equivalents.
165
+
166
+ 2.7. Conditions
167
+
168
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
169
+ in Section 2.1.
170
+
171
+ 3. Responsibilities
172
+ -------------------
173
+
174
+ 3.1. Distribution of Source Form
175
+
176
+ All distribution of Covered Software in Source Code Form, including any
177
+ Modifications that You create or to which You contribute, must be under
178
+ the terms of this License. You must inform recipients that the Source
179
+ Code Form of the Covered Software is governed by the terms of this
180
+ License, and how they can obtain a copy of this License. You may not
181
+ attempt to alter or restrict the recipients' rights in the Source Code
182
+ Form.
183
+
184
+ 3.2. Distribution of Executable Form
185
+
186
+ If You distribute Covered Software in Executable Form then:
187
+
188
+ (a) such Covered Software must also be made available in Source Code
189
+ Form, as described in Section 3.1, and You must inform recipients of
190
+ the Executable Form how they can obtain a copy of such Source Code
191
+ Form by reasonable means in a timely manner, at a charge no more
192
+ than the cost of distribution to the recipient; and
193
+
194
+ (b) You may distribute such Executable Form under the terms of this
195
+ License, or sublicense it under different terms, provided that the
196
+ license for the Executable Form does not attempt to limit or alter
197
+ the recipients' rights in the Source Code Form under this License.
198
+
199
+ 3.3. Distribution of a Larger Work
200
+
201
+ You may create and distribute a Larger Work under terms of Your choice,
202
+ provided that You also comply with the requirements of this License for
203
+ the Covered Software. If the Larger Work is a combination of Covered
204
+ Software with a work governed by one or more Secondary Licenses, and the
205
+ Covered Software is not Incompatible With Secondary Licenses, this
206
+ License permits You to additionally distribute such Covered Software
207
+ under the terms of such Secondary License(s), so that the recipient of
208
+ the Larger Work may, at their option, further distribute the Covered
209
+ Software under the terms of either this License or such Secondary
210
+ License(s).
211
+
212
+ 3.4. Notices
213
+
214
+ You may not remove or alter the substance of any license notices
215
+ (including copyright notices, patent notices, disclaimers of warranty,
216
+ or limitations of liability) contained within the Source Code Form of
217
+ the Covered Software, except that You may alter any license notices to
218
+ the extent required to remedy known factual inaccuracies.
219
+
220
+ 3.5. Application of Additional Terms
221
+
222
+ You may choose to offer, and to charge a fee for, warranty, support,
223
+ indemnity or liability obligations to one or more recipients of Covered
224
+ Software. However, You may do so only on Your own behalf, and not on
225
+ behalf of any Contributor. You must make it absolutely clear that any
226
+ such warranty, support, indemnity, or liability obligation is offered by
227
+ You alone, and You hereby agree to indemnify every Contributor for any
228
+ liability incurred by such Contributor as a result of warranty, support,
229
+ indemnity or liability terms You offer. You may include additional
230
+ disclaimers of warranty and limitations of liability specific to any
231
+ jurisdiction.
232
+
233
+ 4. Inability to Comply Due to Statute or Regulation
234
+ ---------------------------------------------------
235
+
236
+ If it is impossible for You to comply with any of the terms of this
237
+ License with respect to some or all of the Covered Software due to
238
+ statute, judicial order, or regulation then You must: (a) comply with
239
+ the terms of this License to the maximum extent possible; and (b)
240
+ describe the limitations and the code they affect. Such description must
241
+ be placed in a text file included with all distributions of the Covered
242
+ Software under this License. Except to the extent prohibited by statute
243
+ or regulation, such description must be sufficiently detailed for a
244
+ recipient of ordinary skill to be able to understand it.
245
+
246
+ 5. Termination
247
+ --------------
248
+
249
+ 5.1. The rights granted under this License will terminate automatically
250
+ if You fail to comply with any of its terms. However, if You become
251
+ compliant, then the rights granted under this License from a particular
252
+ Contributor are reinstated (a) provisionally, unless and until such
253
+ Contributor explicitly and finally terminates Your grants, and (b) on an
254
+ ongoing basis, if such Contributor fails to notify You of the
255
+ non-compliance by some reasonable means prior to 60 days after You have
256
+ come back into compliance. Moreover, Your grants from a particular
257
+ Contributor are reinstated on an ongoing basis if such Contributor
258
+ notifies You of the non-compliance by some reasonable means, this is the
259
+ first time You have received notice of non-compliance with this License
260
+ from such Contributor, and You become compliant prior to 30 days after
261
+ Your receipt of the notice.
262
+
263
+ 5.2. If You initiate litigation against any entity by asserting a patent
264
+ infringement claim (excluding declaratory judgment actions,
265
+ counter-claims, and cross-claims) alleging that a Contributor Version
266
+ directly or indirectly infringes any patent, then the rights granted to
267
+ You by any and all Contributors for the Covered Software under Section
268
+ 2.1 of this License shall terminate.
269
+
270
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
271
+ end user license agreements (excluding distributors and resellers) which
272
+ have been validly granted by You or Your distributors under this License
273
+ prior to termination shall survive termination.
274
+
275
+ ************************************************************************
276
+ * *
277
+ * 6. Disclaimer of Warranty *
278
+ * ------------------------- *
279
+ * *
280
+ * Covered Software is provided under this License on an "as is" *
281
+ * basis, without warranty of any kind, either expressed, implied, or *
282
+ * statutory, including, without limitation, warranties that the *
283
+ * Covered Software is free of defects, merchantable, fit for a *
284
+ * particular purpose or non-infringing. The entire risk as to the *
285
+ * quality and performance of the Covered Software is with You. *
286
+ * Should any Covered Software prove defective in any respect, You *
287
+ * (not any Contributor) assume the cost of any necessary servicing, *
288
+ * repair, or correction. This disclaimer of warranty constitutes an *
289
+ * essential part of this License. No use of any Covered Software is *
290
+ * authorized under this License except under this disclaimer. *
291
+ * *
292
+ ************************************************************************
293
+
294
+ ************************************************************************
295
+ * *
296
+ * 7. Limitation of Liability *
297
+ * -------------------------- *
298
+ * *
299
+ * Under no circumstances and under no legal theory, whether tort *
300
+ * (including negligence), contract, or otherwise, shall any *
301
+ * Contributor, or anyone who distributes Covered Software as *
302
+ * permitted above, be liable to You for any direct, indirect, *
303
+ * special, incidental, or consequential damages of any character *
304
+ * including, without limitation, damages for lost profits, loss of *
305
+ * goodwill, work stoppage, computer failure or malfunction, or any *
306
+ * and all other commercial damages or losses, even if such party *
307
+ * shall have been informed of the possibility of such damages. This *
308
+ * limitation of liability shall not apply to liability for death or *
309
+ * personal injury resulting from such party's negligence to the *
310
+ * extent applicable law prohibits such limitation. Some *
311
+ * jurisdictions do not allow the exclusion or limitation of *
312
+ * incidental or consequential damages, so this exclusion and *
313
+ * limitation may not apply to You. *
314
+ * *
315
+ ************************************************************************
316
+
317
+ 8. Litigation
318
+ -------------
319
+
320
+ Any litigation relating to this License may be brought only in the
321
+ courts of a jurisdiction where the defendant maintains its principal
322
+ place of business and such litigation shall be governed by laws of that
323
+ jurisdiction, without reference to its conflict-of-law provisions.
324
+ Nothing in this Section shall prevent a party's ability to bring
325
+ cross-claims or counter-claims.
326
+
327
+ 9. Miscellaneous
328
+ ----------------
329
+
330
+ This License represents the complete agreement concerning the subject
331
+ matter hereof. If any provision of this License is held to be
332
+ unenforceable, such provision shall be reformed only to the extent
333
+ necessary to make it enforceable. Any law or regulation which provides
334
+ that the language of a contract shall be construed against the drafter
335
+ shall not be used to construe this License against a Contributor.
336
+
337
+ 10. Versions of the License
338
+ ---------------------------
339
+
340
+ 10.1. New Versions
341
+
342
+ Mozilla Foundation is the license steward. Except as provided in Section
343
+ 10.3, no one other than the license steward has the right to modify or
344
+ publish new versions of this License. Each version will be given a
345
+ distinguishing version number.
346
+
347
+ 10.2. Effect of New Versions
348
+
349
+ You may distribute the Covered Software under the terms of the version
350
+ of the License under which You originally received the Covered Software,
351
+ or under the terms of any subsequent version published by the license
352
+ steward.
353
+
354
+ 10.3. Modified Versions
355
+
356
+ If you create software not governed by this License, and you want to
357
+ create a new license for such software, you may create and use a
358
+ modified version of this License if you rename the license and remove
359
+ any references to the name of the license steward (except to note that
360
+ such modified license differs from this License).
361
+
362
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
363
+ Licenses
364
+
365
+ If You choose to distribute Source Code Form that is Incompatible With
366
+ Secondary Licenses under the terms of this version of the License, the
367
+ notice described in Exhibit B of this License must be attached.
368
+
369
+ Exhibit A - Source Code Form License Notice
370
+ -------------------------------------------
371
+
372
+ This Source Code Form is subject to the terms of the Mozilla Public
373
+ License, v. 2.0. If a copy of the MPL was not distributed with this
374
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
375
+
376
+ If it is not possible or desirable to put the notice in a particular
377
+ file, then You may include the notice in a location (such as a LICENSE
378
+ file in a relevant directory) where a recipient would be likely to look
379
+ for such a notice.
380
+
381
+ You may add additional accurate notices of copyright ownership.
382
+
383
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
384
+ ---------------------------------------------------------
385
+
386
+ This Source Code Form is "Incompatible With Secondary Licenses", as
387
+ defined by the Mozilla Public License, v. 2.0.
sealgate-0.1.0/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ sealgate
2
+ Copyright (c) 2026 The sealgate authors
3
+
4
+ sealgate is licensed under the Mozilla Public License 2.0 with the Commons Clause License Condition v1.0, so it is source-available and not OSI open source.
5
+ The Commons Clause applies to all files in this repository, whatever their SPDX-License-Identifier header says.
6
+ See LICENSE for the full terms; the verbatim texts are in licenses/.
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.5
2
+ Name: sealgate
3
+ Version: 0.1.0
4
+ Summary: Check PDFs against learned layouts and report findings.
5
+ Project-URL: Homepage, https://github.com/D3vl0per/sealgate
6
+ Project-URL: Documentation, https://github.com/D3vl0per/sealgate/tree/main/docs
7
+ Project-URL: Source, https://github.com/D3vl0per/sealgate
8
+ Project-URL: Issues, https://github.com/D3vl0per/sealgate/issues
9
+ License-Expression: LicenseRef-MPL-2.0-with-Commons-Clause
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ License-File: licenses/COMMONS-CLAUSE.txt
13
+ License-File: licenses/MPL-2.0.txt
14
+ Requires-Python: >=3.12
15
+ Requires-Dist: asn1crypto>=1.5.1
16
+ Requires-Dist: fonttools
17
+ Requires-Dist: pdfminer-six
18
+ Requires-Dist: pikepdf
19
+ Requires-Dist: py-tlsh
20
+ Requires-Dist: pyyaml
21
+ Requires-Dist: regex
22
+ Provides-Extra: fixtures
23
+ Requires-Dist: reportlab; extra == 'fixtures'
24
+ Provides-Extra: integrity
25
+ Requires-Dist: cryptography; extra == 'integrity'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # sealgate
29
+
30
+ Checks whether a PDF is a faithful instance of a learned document layout. It returns
31
+ findings and an attack signal. It does not store, delete or forward documents.
32
+
33
+ ## Install
34
+
35
+ ```
36
+ pip install sealgate
37
+ ```
38
+
39
+ Python 3.12 or newer. The HTTP service is the separate `sealgate-server` package.
40
+
41
+ ## Use
42
+
43
+ ```python
44
+ from pathlib import Path
45
+
46
+ from sealgate import Engine, Settings
47
+ from sealgate.templates import TemplateStore
48
+ from sealgate.matchers import load_library
49
+
50
+ settings = Settings(profile_key_path=Path("profile.key"))
51
+ store = TemplateStore(Path("templates"), load_library())
52
+ engine = Engine(store, settings)
53
+
54
+ verdict = engine.verify(
55
+ Path("document.pdf").read_bytes(),
56
+ expected={
57
+ "requestId": "req-123",
58
+ "fields": {"report_no": "IR4K7Q2M9X1B", "site_code": "TEST BAY 07", "inspector": "ROWAN EXAMPLE"},
59
+ },
60
+ )
61
+ print(verdict["status"], verdict["signal"]["level"])
62
+ for f in verdict["findings"]:
63
+ print(f["code"], f["severity"], f["detail"])
64
+ ```
65
+
66
+ For one document, `sealgate.verify(data, "templates")` builds the engine for you.
67
+ Verdicts never hold field values or document text.
68
+
69
+ ## Command line
70
+
71
+ ```
72
+ sealgate verify FILE exit 0 PASS, 10 QUARANTINE, 20 REJECT, 2 error
73
+ sealgate induce DIR draft a template from sample PDFs
74
+ sealgate learn DIR add pending versions from sample PDFs
75
+ sealgate approve approve a pending version
76
+ sealgate mutate FILE write attack variants of a genuine PDF
77
+ sealgate eval DIR run a labelled directory and report detection
78
+ sealgate signals [FILE] assess a stream of verdicts for an attack
79
+ sealgate skeleton FILE print the structural fingerprint
80
+ sealgate keygen PATH write a new profile key
81
+ ```
82
+
83
+ ## Documentation
84
+
85
+ See the [docs](https://github.com/D3vl0per/sealgate/tree/main/docs) directory of the
86
+ repository: `developer-guide.md`, `template-format.md`, `verdict.md`, `findings.md` and the
87
+ design choices in `design.md`.
88
+
89
+ ## License
90
+
91
+ Mozilla Public License 2.0 with the Commons Clause. See `LICENSE`. Source:
92
+ https://github.com/D3vl0per/sealgate
@@ -0,0 +1,65 @@
1
+ # sealgate
2
+
3
+ Checks whether a PDF is a faithful instance of a learned document layout. It returns
4
+ findings and an attack signal. It does not store, delete or forward documents.
5
+
6
+ ## Install
7
+
8
+ ```
9
+ pip install sealgate
10
+ ```
11
+
12
+ Python 3.12 or newer. The HTTP service is the separate `sealgate-server` package.
13
+
14
+ ## Use
15
+
16
+ ```python
17
+ from pathlib import Path
18
+
19
+ from sealgate import Engine, Settings
20
+ from sealgate.templates import TemplateStore
21
+ from sealgate.matchers import load_library
22
+
23
+ settings = Settings(profile_key_path=Path("profile.key"))
24
+ store = TemplateStore(Path("templates"), load_library())
25
+ engine = Engine(store, settings)
26
+
27
+ verdict = engine.verify(
28
+ Path("document.pdf").read_bytes(),
29
+ expected={
30
+ "requestId": "req-123",
31
+ "fields": {"report_no": "IR4K7Q2M9X1B", "site_code": "TEST BAY 07", "inspector": "ROWAN EXAMPLE"},
32
+ },
33
+ )
34
+ print(verdict["status"], verdict["signal"]["level"])
35
+ for f in verdict["findings"]:
36
+ print(f["code"], f["severity"], f["detail"])
37
+ ```
38
+
39
+ For one document, `sealgate.verify(data, "templates")` builds the engine for you.
40
+ Verdicts never hold field values or document text.
41
+
42
+ ## Command line
43
+
44
+ ```
45
+ sealgate verify FILE exit 0 PASS, 10 QUARANTINE, 20 REJECT, 2 error
46
+ sealgate induce DIR draft a template from sample PDFs
47
+ sealgate learn DIR add pending versions from sample PDFs
48
+ sealgate approve approve a pending version
49
+ sealgate mutate FILE write attack variants of a genuine PDF
50
+ sealgate eval DIR run a labelled directory and report detection
51
+ sealgate signals [FILE] assess a stream of verdicts for an attack
52
+ sealgate skeleton FILE print the structural fingerprint
53
+ sealgate keygen PATH write a new profile key
54
+ ```
55
+
56
+ ## Documentation
57
+
58
+ See the [docs](https://github.com/D3vl0per/sealgate/tree/main/docs) directory of the
59
+ repository: `developer-guide.md`, `template-format.md`, `verdict.md`, `findings.md` and the
60
+ design choices in `design.md`.
61
+
62
+ ## License
63
+
64
+ Mozilla Public License 2.0 with the Commons Clause. See `LICENSE`. Source:
65
+ https://github.com/D3vl0per/sealgate
@@ -0,0 +1,11 @@
1
+ “Commons Clause” License Condition v1.0
2
+
3
+ The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
4
+
5
+ Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software.
6
+
7
+ For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.
8
+
9
+ Software: sealgate
10
+ License: Mozilla Public License 2.0
11
+ Licensor: The sealgate authors