faithful-core 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.
- faithful_core-0.1.0/.gitignore +34 -0
- faithful_core-0.1.0/CHANGELOG.md +27 -0
- faithful_core-0.1.0/LICENSE +202 -0
- faithful_core-0.1.0/NOTICE +5 -0
- faithful_core-0.1.0/PKG-INFO +139 -0
- faithful_core-0.1.0/README.md +107 -0
- faithful_core-0.1.0/docs/adr/0001-record-architecture-decisions.md +16 -0
- faithful_core-0.1.0/docs/adr/0002-python-core.md +19 -0
- faithful_core-0.1.0/docs/adr/0003-documentation-site.md +25 -0
- faithful_core-0.1.0/docs/adr/0004-shared-foundation-library.md +20 -0
- faithful_core-0.1.0/docs/adr/index.md +8 -0
- faithful_core-0.1.0/docs/api.md +189 -0
- faithful_core-0.1.0/docs/architecture.md +34 -0
- faithful_core-0.1.0/docs/conf.py +81 -0
- faithful_core-0.1.0/docs/index.md +15 -0
- faithful_core-0.1.0/docs/limitations.md +22 -0
- faithful_core-0.1.0/docs/releasing.md +79 -0
- faithful_core-0.1.0/docs/threat-model.md +44 -0
- faithful_core-0.1.0/pyproject.toml +159 -0
- faithful_core-0.1.0/scripts/check.sh +157 -0
- faithful_core-0.1.0/scripts/check_audit_inventory.py +419 -0
- faithful_core-0.1.0/scripts/check_dco.sh +52 -0
- faithful_core-0.1.0/scripts/check_licenses.py +429 -0
- faithful_core-0.1.0/scripts/check_needs.py +88 -0
- faithful_core-0.1.0/scripts/check_visibility.sh +46 -0
- faithful_core-0.1.0/scripts/install_gitleaks.sh +25 -0
- faithful_core-0.1.0/scripts/install_vale_styles.sh +53 -0
- faithful_core-0.1.0/scripts/license_exceptions.toml +8 -0
- faithful_core-0.1.0/scripts/publish_release.py +318 -0
- faithful_core-0.1.0/scripts/release_evidence.sh +75 -0
- faithful_core-0.1.0/scripts/release_preflight.py +78 -0
- faithful_core-0.1.0/scripts/smoke_test.sh +63 -0
- faithful_core-0.1.0/scripts/vale-styles.lock +14 -0
- faithful_core-0.1.0/scripts/verify_artifacts.sh +36 -0
- faithful_core-0.1.0/src/faithful_core/__init__.py +12 -0
- faithful_core-0.1.0/src/faithful_core/clock.py +41 -0
- faithful_core-0.1.0/src/faithful_core/collect/__init__.py +3 -0
- faithful_core-0.1.0/src/faithful_core/collect/names.py +108 -0
- faithful_core-0.1.0/src/faithful_core/collect/script.py +52 -0
- faithful_core-0.1.0/src/faithful_core/collect/secrets.py +255 -0
- faithful_core-0.1.0/src/faithful_core/collect/winrm.py +329 -0
- faithful_core-0.1.0/src/faithful_core/console.py +94 -0
- faithful_core-0.1.0/src/faithful_core/errors.py +35 -0
- faithful_core-0.1.0/src/faithful_core/exitcodes.py +19 -0
- faithful_core-0.1.0/src/faithful_core/files.py +344 -0
- faithful_core-0.1.0/src/faithful_core/py.typed +0 -0
- faithful_core-0.1.0/src/faithful_core/render.py +71 -0
- faithful_core-0.1.0/src/faithful_core/safety.py +168 -0
- faithful_core-0.1.0/src/faithful_core/xmlsafe.py +225 -0
- faithful_core-0.1.0/tests/__init__.py +3 -0
- faithful_core-0.1.0/tests/conftest.py +15 -0
- faithful_core-0.1.0/tests/test_check_audit_inventory.py +466 -0
- faithful_core-0.1.0/tests/test_check_licenses.py +442 -0
- faithful_core-0.1.0/tests/test_check_needs.py +140 -0
- faithful_core-0.1.0/tests/test_clock.py +59 -0
- faithful_core-0.1.0/tests/test_collect_names.py +102 -0
- faithful_core-0.1.0/tests/test_collect_script.py +84 -0
- faithful_core-0.1.0/tests/test_collect_secrets.py +388 -0
- faithful_core-0.1.0/tests/test_collect_winrm.py +800 -0
- faithful_core-0.1.0/tests/test_console.py +235 -0
- faithful_core-0.1.0/tests/test_errors.py +33 -0
- faithful_core-0.1.0/tests/test_exitcodes.py +29 -0
- faithful_core-0.1.0/tests/test_files.py +719 -0
- faithful_core-0.1.0/tests/test_public_api.py +96 -0
- faithful_core-0.1.0/tests/test_publish_release.py +364 -0
- faithful_core-0.1.0/tests/test_render.py +85 -0
- faithful_core-0.1.0/tests/test_safety.py +239 -0
- faithful_core-0.1.0/tests/test_scripts.py +911 -0
- faithful_core-0.1.0/tests/test_windows_pipe.py +60 -0
- faithful_core-0.1.0/tests/test_xmlsafe.py +176 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.venv/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
|
|
9
|
+
# Tool caches
|
|
10
|
+
.coverage
|
|
11
|
+
.coverage.*
|
|
12
|
+
coverage.xml
|
|
13
|
+
htmlcov/
|
|
14
|
+
.hypothesis/
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.vale/styles/*
|
|
19
|
+
!.vale/styles/config/
|
|
20
|
+
|
|
21
|
+
# Editors and operating systems
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
.DS_Store
|
|
25
|
+
Thumbs.db
|
|
26
|
+
|
|
27
|
+
# Never commit real data or credentials
|
|
28
|
+
*.env
|
|
29
|
+
.env*
|
|
30
|
+
*.pem
|
|
31
|
+
*.key
|
|
32
|
+
*.pfx
|
|
33
|
+
*.evtx
|
|
34
|
+
real-data/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are recorded in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-11-21
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Project foundation: license, documentation, contribution and security policies, continuous integration, and release pipeline.
|
|
14
|
+
- `faithful_core.errors`: `FaithfulError` and the four errors a tool reports, `InputError`, `CollectionError`, `UsageError`, and `OutputError`.
|
|
15
|
+
- `faithful_core.exitcodes`: `ExitCode`, with the exit codes every tool uses.
|
|
16
|
+
- `faithful_core.safety`: `visible`, `csv_cell`, `neutralize_formula`, `escape_markdown`, `terminal`, `terminal_line`, and `command_line`, which make untrusted text safe for each output.
|
|
17
|
+
- `faithful_core.clock`: `date_and_time` and `now`, which honors `SOURCE_DATE_EPOCH`.
|
|
18
|
+
- `faithful_core.console`: `prepare`, `say`, `finish`, and `stdout_closed`, which keep a closed pipe or an unencodable character from changing an exit code.
|
|
19
|
+
- `faithful_core.xmlsafe`: `parse` and its limits, which refuse a `DOCTYPE` and bound size, depth, and element count.
|
|
20
|
+
- `faithful_core.files`: `write_files`, `refuse_aliases`, and `copy_new`, which publish files atomically and refuse to replace a file the tool reads or write inside a folder it reads.
|
|
21
|
+
- `faithful_core.render`: `CSP`, `html_text`, `plural`, `md_text`, `md_table`, and `json_dump`.
|
|
22
|
+
- `faithful_core.collect.names`: `server_name`, `account_name`, and `install_hint`.
|
|
23
|
+
- `faithful_core.collect.secrets`: `resolve`, `redact`, `remember`, `REDACTED`, and `PROVIDERS`.
|
|
24
|
+
- `faithful_core.collect.script`: `ScriptResource`, which loads a packaged PowerShell script.
|
|
25
|
+
- `faithful_core.collect.winrm`: `Target`, `settings`, `client`, `drain`, `collect`, `publish_file`, and the `Sink` protocol.
|
|
26
|
+
- The optional extra `winrm`, which installs `pypsrp`.
|
|
27
|
+
- A test that checks the public names against the documented list, and that no message names a product.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: faithful-core
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Shared foundation library: The shared, tested foundation of the Faithful Oversight tools: safe output, atomic file publishing, console handling, and the WinRM collection plumbing.
|
|
5
|
+
Project-URL: Homepage, https://github.com/faithful-oversight/faithful-core
|
|
6
|
+
Project-URL: Documentation, https://github.com/faithful-oversight/faithful-core/tree/main/docs
|
|
7
|
+
Project-URL: Issues, https://github.com/faithful-oversight/faithful-core/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/faithful-oversight/faithful-core/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Security, https://github.com/faithful-oversight/faithful-core/blob/main/SECURITY.md
|
|
10
|
+
Author: Faithful Oversight, LLC
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
License-File: NOTICE
|
|
14
|
+
Keywords: audit,library,security,windows,winrm
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
|
17
|
+
Classifier: Intended Audience :: System Administrators
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
|
+
Classifier: Topic :: Security
|
|
26
|
+
Classifier: Topic :: System :: Systems Administration
|
|
27
|
+
Classifier: Typing :: Typed
|
|
28
|
+
Requires-Python: >=3.11
|
|
29
|
+
Provides-Extra: winrm
|
|
30
|
+
Requires-Dist: pypsrp>=0.8; extra == 'winrm'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# faithful-core
|
|
34
|
+
|
|
35
|
+
**Shared foundation library.** The shared, tested foundation of the Faithful Oversight tools: safe output, atomic file publishing, console handling, and the WinRM collection plumbing.
|
|
36
|
+
|
|
37
|
+
[](https://github.com/faithful-oversight/faithful-core/actions/workflows/ci.yml)
|
|
38
|
+
[](LICENSE)
|
|
39
|
+
|
|
40
|
+
> **Status: pre-release.** The first release is 0.1.0. Read the stability promise below before you depend on it.
|
|
41
|
+
|
|
42
|
+
## What it is
|
|
43
|
+
|
|
44
|
+
*faithful-core* is the common base every Faithful Oversight tool builds on. It holds the code that must behave the same in every tool, so that each fix and each test lives in one place.
|
|
45
|
+
|
|
46
|
+
It has no command-line tool of its own, and it has no runtime dependencies. It uses the network only for the WinRM transport that a tool asks for.
|
|
47
|
+
|
|
48
|
+
## Who uses it
|
|
49
|
+
|
|
50
|
+
The Faithful Oversight tools: pakad, toledot, mishpat, shaar, merilo, and gvul. You can use it in your own tools too. The license allows it.
|
|
51
|
+
|
|
52
|
+
## What is in it
|
|
53
|
+
|
|
54
|
+
| Module | What it does |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `faithful_core.errors` | One base error, `FaithfulError`, and the four errors a tool reports to its user. |
|
|
57
|
+
| `faithful_core.exitcodes` | The exit codes every tool uses. |
|
|
58
|
+
| `faithful_core.safety` | Makes untrusted text safe for a terminal, a CSV file, and Markdown. |
|
|
59
|
+
| `faithful_core.clock` | Writes times the same way on every platform, and gives a repeatable report time. |
|
|
60
|
+
| `faithful_core.console` | Prints without letting a closed pipe or a narrow terminal change an exit code. |
|
|
61
|
+
| `faithful_core.xmlsafe` | Parses untrusted XML with limits on size, depth, and element count. |
|
|
62
|
+
| `faithful_core.files` | Publishes a set of files atomically, and refuses to replace a file the tool reads. |
|
|
63
|
+
| `faithful_core.render` | Small helpers for HTML, Markdown, and JSON reports. |
|
|
64
|
+
| `faithful_core.collect.names` | Checks server and account names. Writes install hints. |
|
|
65
|
+
| `faithful_core.collect.secrets` | Fetches a secret from a variable, a file, a keyring, Vault, AWS, or Azure. Removes it from text. |
|
|
66
|
+
| `faithful_core.collect.script` | Loads a PowerShell script that a tool ships as package data. |
|
|
67
|
+
| `faithful_core.collect.winrm` | The WinRM transport settings and the collection loop. |
|
|
68
|
+
|
|
69
|
+
[docs/api.md](docs/api.md) describes every name.
|
|
70
|
+
|
|
71
|
+
## Stability promise
|
|
72
|
+
|
|
73
|
+
- The project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
74
|
+
- The names listed in [docs/api.md](docs/api.md) are the public interface. A breaking change to one of them needs a new major version. While the version is below 1.0.0, a minor version can break them, and the changelog says so.
|
|
75
|
+
- Anything that starts with an underscore is private. It can change in any release.
|
|
76
|
+
- Messages are for people. Their wording can change in any release, so do not match on it.
|
|
77
|
+
- Exit code values and the `FaithfulError` hierarchy are part of the public interface.
|
|
78
|
+
|
|
79
|
+
## Installation
|
|
80
|
+
|
|
81
|
+
```shell
|
|
82
|
+
pip install faithful-core
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The WinRM transport needs `pypsrp`. It is an optional extra:
|
|
86
|
+
|
|
87
|
+
```shell
|
|
88
|
+
pip install "faithful-core[winrm]"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Until the first release, install the development version from GitHub:
|
|
92
|
+
|
|
93
|
+
```shell
|
|
94
|
+
pip install git+https://github.com/faithful-oversight/faithful-core
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
To work from source, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
98
|
+
|
|
99
|
+
## Usage
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from pathlib import Path
|
|
103
|
+
|
|
104
|
+
from faithful_core.files import write_files
|
|
105
|
+
from faithful_core.render import md_table
|
|
106
|
+
from faithful_core.safety import terminal_line
|
|
107
|
+
|
|
108
|
+
rows = [["alice", "=1+1"], ["bob", "line one\nline two"]]
|
|
109
|
+
report = "\n".join(md_table(("Name", "Note"), rows)) + "\n"
|
|
110
|
+
|
|
111
|
+
written = write_files(
|
|
112
|
+
Path("report"),
|
|
113
|
+
{"report.md": report},
|
|
114
|
+
force=False,
|
|
115
|
+
slug="example",
|
|
116
|
+
)
|
|
117
|
+
print(terminal_line(str(written[0])))
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Documentation
|
|
121
|
+
|
|
122
|
+
- [API](docs/api.md)
|
|
123
|
+
- [Architecture](docs/architecture.md)
|
|
124
|
+
- [Threat model](docs/threat-model.md)
|
|
125
|
+
- [Limitations](docs/limitations.md)
|
|
126
|
+
- [Releasing](docs/releasing.md)
|
|
127
|
+
- [Architecture decision records](docs/adr/)
|
|
128
|
+
|
|
129
|
+
## Security
|
|
130
|
+
|
|
131
|
+
Please do not report security problems in public issues. See [SECURITY.md](SECURITY.md).
|
|
132
|
+
|
|
133
|
+
## Contributing
|
|
134
|
+
|
|
135
|
+
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md) first.
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
Copyright 2026 Faithful Oversight, LLC. Licensed under the [Apache License, Version 2.0](LICENSE).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# faithful-core
|
|
2
|
+
|
|
3
|
+
**Shared foundation library.** The shared, tested foundation of the Faithful Oversight tools: safe output, atomic file publishing, console handling, and the WinRM collection plumbing.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/faithful-oversight/faithful-core/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
> **Status: pre-release.** The first release is 0.1.0. Read the stability promise below before you depend on it.
|
|
9
|
+
|
|
10
|
+
## What it is
|
|
11
|
+
|
|
12
|
+
*faithful-core* is the common base every Faithful Oversight tool builds on. It holds the code that must behave the same in every tool, so that each fix and each test lives in one place.
|
|
13
|
+
|
|
14
|
+
It has no command-line tool of its own, and it has no runtime dependencies. It uses the network only for the WinRM transport that a tool asks for.
|
|
15
|
+
|
|
16
|
+
## Who uses it
|
|
17
|
+
|
|
18
|
+
The Faithful Oversight tools: pakad, toledot, mishpat, shaar, merilo, and gvul. You can use it in your own tools too. The license allows it.
|
|
19
|
+
|
|
20
|
+
## What is in it
|
|
21
|
+
|
|
22
|
+
| Module | What it does |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `faithful_core.errors` | One base error, `FaithfulError`, and the four errors a tool reports to its user. |
|
|
25
|
+
| `faithful_core.exitcodes` | The exit codes every tool uses. |
|
|
26
|
+
| `faithful_core.safety` | Makes untrusted text safe for a terminal, a CSV file, and Markdown. |
|
|
27
|
+
| `faithful_core.clock` | Writes times the same way on every platform, and gives a repeatable report time. |
|
|
28
|
+
| `faithful_core.console` | Prints without letting a closed pipe or a narrow terminal change an exit code. |
|
|
29
|
+
| `faithful_core.xmlsafe` | Parses untrusted XML with limits on size, depth, and element count. |
|
|
30
|
+
| `faithful_core.files` | Publishes a set of files atomically, and refuses to replace a file the tool reads. |
|
|
31
|
+
| `faithful_core.render` | Small helpers for HTML, Markdown, and JSON reports. |
|
|
32
|
+
| `faithful_core.collect.names` | Checks server and account names. Writes install hints. |
|
|
33
|
+
| `faithful_core.collect.secrets` | Fetches a secret from a variable, a file, a keyring, Vault, AWS, or Azure. Removes it from text. |
|
|
34
|
+
| `faithful_core.collect.script` | Loads a PowerShell script that a tool ships as package data. |
|
|
35
|
+
| `faithful_core.collect.winrm` | The WinRM transport settings and the collection loop. |
|
|
36
|
+
|
|
37
|
+
[docs/api.md](docs/api.md) describes every name.
|
|
38
|
+
|
|
39
|
+
## Stability promise
|
|
40
|
+
|
|
41
|
+
- The project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
42
|
+
- The names listed in [docs/api.md](docs/api.md) are the public interface. A breaking change to one of them needs a new major version. While the version is below 1.0.0, a minor version can break them, and the changelog says so.
|
|
43
|
+
- Anything that starts with an underscore is private. It can change in any release.
|
|
44
|
+
- Messages are for people. Their wording can change in any release, so do not match on it.
|
|
45
|
+
- Exit code values and the `FaithfulError` hierarchy are part of the public interface.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```shell
|
|
50
|
+
pip install faithful-core
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The WinRM transport needs `pypsrp`. It is an optional extra:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
pip install "faithful-core[winrm]"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Until the first release, install the development version from GitHub:
|
|
60
|
+
|
|
61
|
+
```shell
|
|
62
|
+
pip install git+https://github.com/faithful-oversight/faithful-core
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
To work from source, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
66
|
+
|
|
67
|
+
## Usage
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from pathlib import Path
|
|
71
|
+
|
|
72
|
+
from faithful_core.files import write_files
|
|
73
|
+
from faithful_core.render import md_table
|
|
74
|
+
from faithful_core.safety import terminal_line
|
|
75
|
+
|
|
76
|
+
rows = [["alice", "=1+1"], ["bob", "line one\nline two"]]
|
|
77
|
+
report = "\n".join(md_table(("Name", "Note"), rows)) + "\n"
|
|
78
|
+
|
|
79
|
+
written = write_files(
|
|
80
|
+
Path("report"),
|
|
81
|
+
{"report.md": report},
|
|
82
|
+
force=False,
|
|
83
|
+
slug="example",
|
|
84
|
+
)
|
|
85
|
+
print(terminal_line(str(written[0])))
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
- [API](docs/api.md)
|
|
91
|
+
- [Architecture](docs/architecture.md)
|
|
92
|
+
- [Threat model](docs/threat-model.md)
|
|
93
|
+
- [Limitations](docs/limitations.md)
|
|
94
|
+
- [Releasing](docs/releasing.md)
|
|
95
|
+
- [Architecture decision records](docs/adr/)
|
|
96
|
+
|
|
97
|
+
## Security
|
|
98
|
+
|
|
99
|
+
Please do not report security problems in public issues. See [SECURITY.md](SECURITY.md).
|
|
100
|
+
|
|
101
|
+
## Contributing
|
|
102
|
+
|
|
103
|
+
Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md) first.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
Copyright 2026 Faithful Oversight, LLC. Licensed under the [Apache License, Version 2.0](LICENSE).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# 1. Record architecture decisions
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-11-21
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Design choices made today need to stay understandable to future contributors, including AI agents that start each session without history.
|
|
9
|
+
|
|
10
|
+
## Decision
|
|
11
|
+
|
|
12
|
+
Record each significant decision as a numbered file in `docs/adr/`, using the format of this file: context, decision, and consequences. Decisions are never edited after acceptance. A new record replaces an old one and links back to it.
|
|
13
|
+
|
|
14
|
+
## Consequences
|
|
15
|
+
|
|
16
|
+
Contributors can see why the project is shaped the way it is. Reversing a decision takes a new record, which makes changes deliberate.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 2. Python library with no runtime dependencies
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-11-21
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
The library is the base of six tools that administrators and assessors install. Every dependency of the library becomes a dependency of every tool, and a flaw in the supply chain would reach all of them.
|
|
9
|
+
|
|
10
|
+
## Decision
|
|
11
|
+
|
|
12
|
+
- Write the library in Python 3.11 or newer, fully typed and checked with mypy in strict mode.
|
|
13
|
+
- Use the standard library only. A feature that needs another package gets an optional extra, and the package is imported when the feature is first used. The `winrm` extra and the secret providers work this way.
|
|
14
|
+
- Keep the public interface small, documented, and covered by semantic versioning. Private names start with an underscore.
|
|
15
|
+
- Manage the environment and lock file with uv.
|
|
16
|
+
|
|
17
|
+
## Consequences
|
|
18
|
+
|
|
19
|
+
A tool that does not collect remotely installs nothing but this library. The WinRM transport can change its package without changing the public interface. A new runtime dependency needs a new decision record.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 3. Documentation as code, published with Sphinx
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-11-07
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Users need searchable, navigable documentation. Reviewers need documentation changes to go through the same review and checks as code. Options considered: a GitHub wiki, Material for MkDocs, Zensical, and Sphinx.
|
|
9
|
+
|
|
10
|
+
- A GitHub wiki keeps its own Git history, but it is a separate repository edited outside pull request review, so wiki changes skip the checks that code and docs changes pass.
|
|
11
|
+
- Material for MkDocs is in maintenance mode, with critical fixes and security updates only until its end of life on 2027-05-05, as the 9.8.0 release notes state (checked 2026-11-07). An earlier announcement gave 2026-11-05.
|
|
12
|
+
- MkDocs itself has had no release since 2024.
|
|
13
|
+
- Zensical, the successor to Material for MkDocs, was at version 0.1 when this decision was made.
|
|
14
|
+
- Sphinx is mature and actively released, and is the generator behind the Python documentation.
|
|
15
|
+
|
|
16
|
+
## Decision
|
|
17
|
+
|
|
18
|
+
- `docs/` is the single source of truth, written in Markdown that also reads well on GitHub.
|
|
19
|
+
- Sphinx with the MyST Markdown parser and the Furo theme builds a documentation site.
|
|
20
|
+
- Every change builds the site with warnings treated as errors.
|
|
21
|
+
- The site is published to GitHub Pages only when the repository is public, because a Pages site from a private repository would be public.
|
|
22
|
+
|
|
23
|
+
## Consequences
|
|
24
|
+
|
|
25
|
+
Documentation is reviewed, tested, and versioned with the code. Because the source is plain Markdown, moving to another generator later means changing configuration, not content.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 4. One shared foundation library for the tools
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-11-21
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Six tools carried copies of the same modules: output safety, console handling, atomic file publishing, secret handling, and the WinRM transport. The copies had drifted apart. A fix in one copy did not reach the others, and the tests for the same code differed from tool to tool.
|
|
9
|
+
|
|
10
|
+
## Decision
|
|
11
|
+
|
|
12
|
+
- Move the modules that must behave the same in every tool into this library. One release holds the whole scope.
|
|
13
|
+
- Each tool keeps its product logic: report content, input formats, manifests, command-line options, and PowerShell scripts.
|
|
14
|
+
- Each tool pins an exact version of this library in its lock file.
|
|
15
|
+
- Differences between the old copies become parameters, such as a temporary-file slug, a noun for messages, and an install hint. No message names a product.
|
|
16
|
+
- Where the copies disagreed, the library takes the safer behavior. For example, the alias guard refuses when the file system cannot answer.
|
|
17
|
+
|
|
18
|
+
## Consequences
|
|
19
|
+
|
|
20
|
+
A fix and its tests live in one place. A change to this library reaches every tool, so its public interface follows semantic versioning and its tests run against the tools before a release. The library becomes a runtime dependency of every tool, which makes its own supply chain more important.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Architecture decision records
|
|
2
|
+
|
|
3
|
+
Each record explains one significant decision: its context, the decision, and its consequences. Records are never edited after acceptance. A new record replaces an old one.
|
|
4
|
+
|
|
5
|
+
- [1. Record architecture decisions](0001-record-architecture-decisions.md)
|
|
6
|
+
- [2. Python library with no runtime dependencies](0002-python-core.md)
|
|
7
|
+
- [3. Documentation as code, published with Sphinx](0003-documentation-site.md)
|
|
8
|
+
- [4. One shared foundation library for the tools](0004-shared-foundation-library.md)
|