teef 0.1.2__tar.gz → 0.1.3__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.
- {teef-0.1.2 → teef-0.1.3}/PKG-INFO +4 -4
- {teef-0.1.2 → teef-0.1.3}/README.md +3 -3
- {teef-0.1.2 → teef-0.1.3}/src/teef/__init__.py +1 -1
- {teef-0.1.2 → teef-0.1.3}/src/teef/catalog.py +2 -2
- {teef-0.1.2 → teef-0.1.3}/src/teef/recipient.py +6 -11
- {teef-0.1.2 → teef-0.1.3}/src/teef/report.py +1 -1
- {teef-0.1.2 → teef-0.1.3}/src/teef/rules.py +1 -1
- {teef-0.1.2 → teef-0.1.3}/tests/test_recipient_basic.py +7 -6
- {teef-0.1.2 → teef-0.1.3}/tests/test_rules.py +6 -1
- {teef-0.1.2 → teef-0.1.3}/.gitattributes +0 -0
- {teef-0.1.2 → teef-0.1.3}/.github/workflows/publish.yml +0 -0
- {teef-0.1.2 → teef-0.1.3}/.gitignore +0 -0
- {teef-0.1.2 → teef-0.1.3}/.python-version +0 -0
- {teef-0.1.2 → teef-0.1.3}/LICENSE +0 -0
- {teef-0.1.2 → teef-0.1.3}/pyproject.toml +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/__main__.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/cli.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/context.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/errors.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/findings.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/jose.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/keys.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/models.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/package.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/parsing.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/py.typed +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/reader.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/schema.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/schemas/tprm-evidence-exchange-0.1.0.schema.json +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/serialize.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/sources.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/templates/report.css +0 -0
- {teef-0.1.2 → teef-0.1.3}/src/teef/templates/report.html.j2 +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/conftest.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_cli.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_cli_sig.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_conformance_full.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_context_catalog.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_keys.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_models_basic.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_models_full.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_models_spec.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_package.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_package_sig.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_parsing.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_public_api.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_reader.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_reader_jwe.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_reader_sig.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_recipient_review.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_report_model.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_report_render.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_review_fixes.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_rules_conformance.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_scaffold.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_schema.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_serialize.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_sources_folder.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/tests/test_sources_zip.py +0 -0
- {teef-0.1.2 → teef-0.1.3}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: teef
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Build, verify and read TEEF (TPRM Evidence Exchange Format) packages
|
|
5
5
|
Project-URL: Source, https://github.com/stalpers/pyTEEF
|
|
6
6
|
Project-URL: Issues, https://github.com/stalpers/pyTEEF/issues
|
|
@@ -126,7 +126,7 @@ Mistakes in a single object, such as an `answered` response without an answer or
|
|
|
126
126
|
| TEEF-AR-02, 03 | Type 1 reports cover one date, type 2 reports cover more than one |
|
|
127
127
|
| TEEF-EV-11 | Every declared file is present and matches its digest |
|
|
128
128
|
| TEEF-ARC-01, 03, 06 | No undeclared files, reserved device names, or case-insensitive path collisions |
|
|
129
|
-
| TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt" |
|
|
129
|
+
| TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt". Trusted timestamps (TEEF-SIG-09, 10) are withdrawn from the spec, so a `manifest.tst` is rejected as an undeclared file |
|
|
130
130
|
|
|
131
131
|
`write_dir` and `write_zip` raise `PackageValidationError` with the findings when any rule is broken, and write nothing. `teef.check_package(manifest_dict, files)` runs the same checks on any manifest.
|
|
132
132
|
|
|
@@ -204,9 +204,9 @@ Besides every check above, reading adds:
|
|
|
204
204
|
| TEEF-EV-10 | Evidence without a stated scope |
|
|
205
205
|
| TEEF-ANS-12 | A questionnaire or version you did not list as known |
|
|
206
206
|
| TEEF-URI-06 | An external link that appears to carry credentials |
|
|
207
|
-
| TEEF-SIG-12 | An invalid signature is an error. A signature
|
|
207
|
+
| TEEF-SIG-12 | An invalid signature is an error. A signature that teef could not verify because no trusted keys were given is a warning |
|
|
208
208
|
|
|
209
|
-
Not covered yet:
|
|
209
|
+
Not covered yet: keys held in a KMS or HSM, and checks against questionnaire definitions (TEEF-ANS-11, 14).
|
|
210
210
|
|
|
211
211
|
## Sign and encrypt
|
|
212
212
|
|
|
@@ -98,7 +98,7 @@ Mistakes in a single object, such as an `answered` response without an answer or
|
|
|
98
98
|
| TEEF-AR-02, 03 | Type 1 reports cover one date, type 2 reports cover more than one |
|
|
99
99
|
| TEEF-EV-11 | Every declared file is present and matches its digest |
|
|
100
100
|
| TEEF-ARC-01, 03, 06 | No undeclared files, reserved device names, or case-insensitive path collisions |
|
|
101
|
-
| TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt" |
|
|
101
|
+
| TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt". Trusted timestamps (TEEF-SIG-09, 10) are withdrawn from the spec, so a `manifest.tst` is rejected as an undeclared file |
|
|
102
102
|
|
|
103
103
|
`write_dir` and `write_zip` raise `PackageValidationError` with the findings when any rule is broken, and write nothing. `teef.check_package(manifest_dict, files)` runs the same checks on any manifest.
|
|
104
104
|
|
|
@@ -176,9 +176,9 @@ Besides every check above, reading adds:
|
|
|
176
176
|
| TEEF-EV-10 | Evidence without a stated scope |
|
|
177
177
|
| TEEF-ANS-12 | A questionnaire or version you did not list as known |
|
|
178
178
|
| TEEF-URI-06 | An external link that appears to carry credentials |
|
|
179
|
-
| TEEF-SIG-12 | An invalid signature is an error. A signature
|
|
179
|
+
| TEEF-SIG-12 | An invalid signature is an error. A signature that teef could not verify because no trusted keys were given is a warning |
|
|
180
180
|
|
|
181
|
-
Not covered yet:
|
|
181
|
+
Not covered yet: keys held in a KMS or HSM, and checks against questionnaire definitions (TEEF-ANS-11, 14).
|
|
182
182
|
|
|
183
183
|
## Sign and encrypt
|
|
184
184
|
|
|
@@ -114,8 +114,8 @@ RULES: dict[str, str] = {
|
|
|
114
114
|
"TEEF-SIG-06": "Detached JWS over the exact manifest bytes",
|
|
115
115
|
"TEEF-SIG-07": "JWS header values",
|
|
116
116
|
"TEEF-SIG-08": "Resolve the signing key through trusted configuration",
|
|
117
|
-
"TEEF-SIG-09": "
|
|
118
|
-
"TEEF-SIG-10": "
|
|
117
|
+
"TEEF-SIG-09": "Withdrawn: trusted timestamp token",
|
|
118
|
+
"TEEF-SIG-10": "Withdrawn: verify the timestamp token",
|
|
119
119
|
"TEEF-SIG-11": "Separate signing and encryption keys",
|
|
120
120
|
"TEEF-SIG-12": "Reject invalid proofs",
|
|
121
121
|
"TEEF-SIG-13": "Reject a package missing a required proof",
|
|
@@ -12,7 +12,7 @@ from urllib.parse import parse_qsl, urlsplit
|
|
|
12
12
|
|
|
13
13
|
from .context import Context
|
|
14
14
|
from .findings import Finding
|
|
15
|
-
from .rules import
|
|
15
|
+
from .rules import _date, _dicts, _evidence
|
|
16
16
|
|
|
17
17
|
RecipientCheck = Callable[[dict[str, Any], Mapping[str, bytes], Context], list[Finding]]
|
|
18
18
|
|
|
@@ -192,16 +192,11 @@ def check_missing_scope(
|
|
|
192
192
|
def check_unverified_proofs(
|
|
193
193
|
manifest: dict[str, Any], files: Mapping[str, bytes], context: Context
|
|
194
194
|
) -> list[Finding]:
|
|
195
|
-
"""TEEF-SIG-12: a
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"manifest.jws": "manifest.jws was not verified: no trusted keys were given"
|
|
201
|
-
" (use --trusted-keys)",
|
|
202
|
-
"manifest.tst": "manifest.tst is present but teef does not verify timestamps",
|
|
203
|
-
}
|
|
204
|
-
return [_warning("TEEF-SIG-12", messages[name], None) for name in sorted(unverified)]
|
|
195
|
+
"""TEEF-SIG-12: a signature that teef cannot verify because no trusted keys were given."""
|
|
196
|
+
if "manifest.jws" not in files or context.trusted_keys is not None:
|
|
197
|
+
return []
|
|
198
|
+
message = "manifest.jws was not verified: no trusted keys were given (use --trusted-keys)"
|
|
199
|
+
return [_warning("TEEF-SIG-12", message, None)]
|
|
205
200
|
|
|
206
201
|
|
|
207
202
|
# --- assurance reports and certificates ------------------------------------------
|
|
@@ -18,7 +18,7 @@ from .schema import check_schema
|
|
|
18
18
|
Check = Callable[[dict[str, Any], Mapping[str, bytes]], list[Finding]]
|
|
19
19
|
|
|
20
20
|
SUPPORTED_SCHEMA_VERSION = "0.1.0"
|
|
21
|
-
SIGNATURE_FILES = frozenset({"manifest.jws"
|
|
21
|
+
SIGNATURE_FILES = frozenset({"manifest.jws"})
|
|
22
22
|
RESERVED_NAMES = frozenset(
|
|
23
23
|
{"CON", "PRN", "AUX", "NUL"}
|
|
24
24
|
| {f"COM{i}" for i in range(1, 10)}
|
|
@@ -129,13 +129,14 @@ def test_evidence_without_scope() -> None:
|
|
|
129
129
|
assert "Policy (policy)" in result[0].message
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
result = findings(manifest(), files={name: b"x"})
|
|
132
|
+
def test_unverified_signature() -> None:
|
|
133
|
+
result = findings(manifest(), files={"manifest.jws": b"x"})
|
|
135
134
|
assert [(f.rule_id, f.severity) for f in result] == [("TEEF-SIG-12", "warning")]
|
|
136
|
-
assert "not
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
assert "was not verified" in result[0].message
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def test_manifest_tst_gets_no_proof_warning() -> None:
|
|
139
|
+
assert findings(manifest(), files={"manifest.tst": b"x"}) == []
|
|
139
140
|
|
|
140
141
|
|
|
141
142
|
def test_same_organization() -> None:
|
|
@@ -210,7 +210,12 @@ def test_undeclared_file() -> None:
|
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
def test_manifest_jws_allowed() -> None:
|
|
213
|
-
assert rule_ids(manifest(), {"manifest.jws": b"x"
|
|
213
|
+
assert rule_ids(manifest(), {"manifest.jws": b"x"}) == set()
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def test_manifest_tst_is_undeclared() -> None:
|
|
217
|
+
# Timestamps (TEEF-SIG-09, 10) are withdrawn, so manifest.tst is an undeclared file.
|
|
218
|
+
assert rule_ids(manifest(), {"manifest.tst": b"y"}) == {"TEEF-ARC-01"}
|
|
214
219
|
|
|
215
220
|
|
|
216
221
|
@pytest.mark.parametrize("name", ["con", "nul.txt", "com1.json", "lpt9"])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|