medsbom 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 (51) hide show
  1. medsbom-0.1.0/.github/FUNDING.yml +6 -0
  2. medsbom-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  3. medsbom-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  4. medsbom-0.1.0/.github/workflows/ci.yml +42 -0
  5. medsbom-0.1.0/.gitignore +0 -0
  6. medsbom-0.1.0/ADOPTERS.md +27 -0
  7. medsbom-0.1.0/CODE_OF_CONDUCT.md +31 -0
  8. medsbom-0.1.0/CONTRIBUTING.md +77 -0
  9. medsbom-0.1.0/LICENSE +190 -0
  10. medsbom-0.1.0/PKG-INFO +240 -0
  11. medsbom-0.1.0/README.md +199 -0
  12. medsbom-0.1.0/SECURITY.md +45 -0
  13. medsbom-0.1.0/docker/Dockerfile +35 -0
  14. medsbom-0.1.0/docker/docker-compose.yml +16 -0
  15. medsbom-0.1.0/examples/README.md +189 -0
  16. medsbom-0.1.0/examples/sample_cyclonedx.json +123 -0
  17. medsbom-0.1.0/examples/sample_spdx.json +91 -0
  18. medsbom-0.1.0/medsbom/__init__.py +6 -0
  19. medsbom-0.1.0/medsbom/api/__init__.py +2 -0
  20. medsbom-0.1.0/medsbom/api/main.py +193 -0
  21. medsbom-0.1.0/medsbom/api/models.py +64 -0
  22. medsbom-0.1.0/medsbom/cli/__init__.py +2 -0
  23. medsbom-0.1.0/medsbom/cli/main.py +406 -0
  24. medsbom-0.1.0/medsbom/core/__init__.py +2 -0
  25. medsbom-0.1.0/medsbom/core/audit.py +160 -0
  26. medsbom-0.1.0/medsbom/core/cve_match.py +242 -0
  27. medsbom-0.1.0/medsbom/core/doc_generator.py +86 -0
  28. medsbom-0.1.0/medsbom/core/eol_check.py +229 -0
  29. medsbom-0.1.0/medsbom/core/ingest.py +277 -0
  30. medsbom-0.1.0/medsbom/core/models.py +113 -0
  31. medsbom-0.1.0/medsbom/core/risk_score.py +137 -0
  32. medsbom-0.1.0/medsbom/templates/fda_premarket_summary.md.j2 +106 -0
  33. medsbom-0.1.0/medsbom/templates/soup_risk_assessment.md.j2 +59 -0
  34. medsbom-0.1.0/medsbom/templates/vulnerability_review_log.md.j2 +77 -0
  35. medsbom-0.1.0/medsbom-project-spec.md +179 -0
  36. medsbom-0.1.0/pyproject.toml +84 -0
  37. medsbom-0.1.0/tests/__init__.py +2 -0
  38. medsbom-0.1.0/tests/conftest.py +296 -0
  39. medsbom-0.1.0/tests/sample_data/sample_cyclonedx.json +123 -0
  40. medsbom-0.1.0/tests/sample_data/sample_spdx.json +91 -0
  41. medsbom-0.1.0/tests/test_api.py +202 -0
  42. medsbom-0.1.0/tests/test_audit.py +175 -0
  43. medsbom-0.1.0/tests/test_cli.py +131 -0
  44. medsbom-0.1.0/tests/test_cli_extended.py +358 -0
  45. medsbom-0.1.0/tests/test_coverage_extras.py +295 -0
  46. medsbom-0.1.0/tests/test_cve_match.py +341 -0
  47. medsbom-0.1.0/tests/test_doc_generator.py +256 -0
  48. medsbom-0.1.0/tests/test_eol_check.py +219 -0
  49. medsbom-0.1.0/tests/test_final_coverage.py +276 -0
  50. medsbom-0.1.0/tests/test_ingest.py +273 -0
  51. medsbom-0.1.0/tests/test_risk_score.py +227 -0
@@ -0,0 +1,6 @@
1
+ # Funding — support MedSBOM development
2
+ # See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
3
+
4
+ github: [karthikraja14]
5
+ open_collective: medsbom
6
+ custom: ["https://www.buymeacoffee.com/medsbom"]
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug in MedSBOM
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ **Describe the bug**
10
+ A clear description of what the bug is.
11
+
12
+ **To Reproduce**
13
+ Steps to reproduce:
14
+ 1. Run `medsbom ...`
15
+ 2. With SBOM file: (attach or describe)
16
+ 3. Error output:
17
+
18
+ **Expected behavior**
19
+ What you expected to happen.
20
+
21
+ **Environment:**
22
+ - OS: [e.g., Ubuntu 24.04]
23
+ - Python version: [e.g., 3.12.4]
24
+ - MedSBOM version: [e.g., 0.1.0]
25
+ - SBOM format: [CycloneDX / SPDX]
26
+ - Source tool: [Syft / Trivy / other]
27
+
28
+ **Additional context**
29
+ Any other context. **Do NOT paste your actual SBOM contents** if they contain proprietary information.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest a feature for MedSBOM
4
+ title: "[FEATURE] "
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ **Is your feature request related to a problem?**
10
+ A clear description of the problem. Ex. "I need to generate IEC 80001 reports but..."
11
+
12
+ **Describe the solution you'd like**
13
+ What you want to happen.
14
+
15
+ **Regulatory context (if applicable)**
16
+ Which regulation or standard does this relate to? (FDA guidance, IEC 62304, ISO 14971, etc.)
17
+
18
+ **Additional context**
19
+ Any other context, screenshots, or examples.
@@ -0,0 +1,42 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.12"]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install -e ".[dev]"
31
+ pip list
32
+
33
+ - name: Lint with ruff
34
+ run: python -m ruff check medsbom/ tests/
35
+ continue-on-error: true
36
+
37
+ - name: Type check with mypy
38
+ run: python -m mypy medsbom/ --ignore-missing-imports
39
+ continue-on-error: true
40
+
41
+ - name: Run tests
42
+ run: python -m pytest tests/ -v
Binary file
@@ -0,0 +1,27 @@
1
+ # MedSBOM Adopters
2
+
3
+ Organizations and projects using MedSBOM. Add yourself via PR!
4
+
5
+ ## Companies
6
+
7
+ <!-- Add your organization:
8
+ | [Your Company](https://example.com) | Brief description of use case |
9
+ -->
10
+
11
+ | Organization | Use Case |
12
+ |---|---|
13
+ | *Your company here* | *Open a PR to add yourself!* |
14
+
15
+ ## Open Source Projects
16
+
17
+ | Project | Description |
18
+ |---|---|
19
+ | *Your project here* | *Open a PR to add yourself!* |
20
+
21
+ ## How to Add Yourself
22
+
23
+ 1. Fork this repo
24
+ 2. Add your org/project to the appropriate table above
25
+ 3. Open a PR
26
+
27
+ We appreciate you sharing! It helps the community understand adoption and prioritize features.
@@ -0,0 +1,31 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to a positive environment:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior:
18
+
19
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
20
+ * Trolling, insulting or derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Enforcement
26
+
27
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers. All complaints will be reviewed and investigated promptly and fairly.
28
+
29
+ ## Attribution
30
+
31
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,77 @@
1
+ # Contributing to MedSBOM
2
+
3
+ Thank you for your interest in contributing to MedSBOM! This project helps medical device teams achieve FDA/IEC-62304 compliance with free, open-source tooling.
4
+
5
+ ## Getting Started
6
+
7
+ ### Prerequisites
8
+ - Python 3.12+
9
+ - Git
10
+
11
+ ### Setup
12
+
13
+ ```bash
14
+ git clone https://github.com/medsbom/medsbom.git
15
+ cd medsbom
16
+ python -m venv .venv
17
+ source .venv/bin/activate # or .venv\Scripts\activate on Windows
18
+ pip install -e ".[dev]"
19
+ ```
20
+
21
+ ### Running Tests
22
+
23
+ ```bash
24
+ pytest tests/ -v --cov=medsbom
25
+ ```
26
+
27
+ ### Linting
28
+
29
+ ```bash
30
+ ruff check medsbom/ tests/
31
+ mypy medsbom/ --ignore-missing-imports
32
+ ```
33
+
34
+ ## How to Contribute
35
+
36
+ ### Reporting Bugs
37
+ Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md). **Never include actual SBOM contents** from production devices — use the sample data in `tests/sample_data/` to reproduce issues.
38
+
39
+ ### Suggesting Features
40
+ Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md). Regulatory context is especially helpful — tell us which standard section your request relates to.
41
+
42
+ ### Submitting Code
43
+
44
+ 1. Fork the repo and create a feature branch from `main`
45
+ 2. Write tests for any new functionality (aim for positive, negative, and edge cases)
46
+ 3. Ensure all tests pass: `pytest tests/ -v`
47
+ 4. Ensure linting passes: `ruff check medsbom/ tests/`
48
+ 5. Add Apache-2.0 license header to new files
49
+ 6. Submit a pull request with a clear description
50
+
51
+ ### Regulatory Template Contributions
52
+
53
+ Contributions to the Jinja2 templates in `medsbom/templates/` are especially welcome! If you have domain expertise in:
54
+ - FDA premarket cybersecurity guidance
55
+ - IEC 62304 software lifecycle processes
56
+ - ISO 14971 risk management
57
+ - EU MDR / IVDR requirements
58
+
59
+ Please help us improve the accuracy and completeness of generated documents.
60
+
61
+ **Important:** Template contributions should reference specific guidance sections (e.g., "FDA 2023 Premarket Guidance §V.B") so the community can verify accuracy.
62
+
63
+ ## Code Standards
64
+
65
+ - **Type hints** on all public functions
66
+ - **Docstrings** for modules and public classes/functions
67
+ - **Tests** for every new feature (positive, negative, edge cases)
68
+ - **No secrets** in code — API keys via environment variables only
69
+ - **Apache-2.0 header** on every source file
70
+
71
+ ## Code of Conduct
72
+
73
+ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold this code.
74
+
75
+ ## License
76
+
77
+ By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
medsbom-0.1.0/LICENSE ADDED
@@ -0,0 +1,190 @@
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 the 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 the 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 any 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
+ Copyright 2024 MedSBOM Contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
medsbom-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,240 @@
1
+ Metadata-Version: 2.4
2
+ Name: medsbom
3
+ Version: 0.1.0
4
+ Summary: Open-source FDA/IEC-62304 compliance layer for medical device SBOMs
5
+ Project-URL: Homepage, https://github.com/medsbom/medsbom
6
+ Project-URL: Documentation, https://github.com/medsbom/medsbom/tree/main/docs
7
+ Project-URL: Repository, https://github.com/medsbom/medsbom
8
+ Project-URL: Issues, https://github.com/medsbom/medsbom/issues
9
+ Author: MedSBOM Contributors
10
+ License: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: compliance,cve,cybersecurity,fda,iec-62304,medical-device,sbom,vulnerability
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Healthcare Industry
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
19
+ Classifier: Topic :: Security
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: fastapi<1.0,>=0.111
22
+ Requires-Dist: httpx<1.0,>=0.27
23
+ Requires-Dist: jinja2<4.0,>=3.1
24
+ Requires-Dist: pydantic<3.0,>=2.7
25
+ Requires-Dist: rich<14.0,>=13.0
26
+ Requires-Dist: typer<1.0,>=0.12
27
+ Requires-Dist: uvicorn[standard]<1.0,>=0.30
28
+ Provides-Extra: dev
29
+ Requires-Dist: httpx; extra == 'dev'
30
+ Requires-Dist: mypy<2.0,>=1.10; extra == 'dev'
31
+ Requires-Dist: pytest-asyncio<1.0,>=0.23; extra == 'dev'
32
+ Requires-Dist: pytest-cov<6.0,>=5.0; extra == 'dev'
33
+ Requires-Dist: pytest<9.0,>=8.0; extra == 'dev'
34
+ Requires-Dist: respx<1.0,>=0.21; extra == 'dev'
35
+ Requires-Dist: ruff<1.0,>=0.5; extra == 'dev'
36
+ Provides-Extra: pdf
37
+ Requires-Dist: weasyprint<70,>=62; extra == 'pdf'
38
+ Provides-Extra: postgres
39
+ Requires-Dist: psycopg[binary]<4.0,>=3.1; extra == 'postgres'
40
+ Description-Content-Type: text/markdown
41
+
42
+ <div align="center">
43
+
44
+ # 🏥 MedSBOM
45
+
46
+ **Open-source FDA/IEC-62304 compliance layer for medical device SBOMs**
47
+
48
+ [![CI](https://github.com/medsbom/medsbom/actions/workflows/ci.yml/badge.svg)](https://github.com/medsbom/medsbom/actions/workflows/ci.yml)
49
+ [![PyPI](https://img.shields.io/pypi/v/medsbom)](https://pypi.org/project/medsbom/)
50
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
51
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
52
+
53
+ *Turn raw SBOM scans into FDA-submission-ready documentation in seconds, not weeks.*
54
+
55
+ [Quick Start](#quick-start) • [Examples](examples/) • [API Docs](#api) • [Contributing](CONTRIBUTING.md) • [Sponsor](#sponsor)
56
+
57
+ </div>
58
+
59
+ ---
60
+
61
+ ## The Problem
62
+
63
+ Medical device manufacturers must (FDA 2023 guidance, PATCH Act, 2026 QMSR):
64
+ - Maintain Software Bills of Materials for every device
65
+ - Continuously monitor SOUP components for vulnerabilities
66
+ - Document a Secure Product Development Framework
67
+ - Produce audit-ready evidence of regular vulnerability review (IEC 62304 §7.1.3)
68
+
69
+ **Today:** Teams spend 40–80 hours per device manually translating Syft/Grype/Trivy output into regulatory documents. Paid platforms charge $50K–$200K/year.
70
+
71
+ **With MedSBOM:** One command. Audit-ready docs in seconds. Free forever.
72
+
73
+ ## What MedSBOM Does
74
+
75
+ ```
76
+ ┌─────────────┐ ┌──────────────┐ ┌───────────────────────────┐
77
+ │ SBOM Input │ ──▶ │ MedSBOM │ ──▶ │ FDA Premarket Summary │
78
+ │ (SPDX/CDX) │ │ Engine │ │ SOUP Risk Assessment │
79
+ └─────────────┘ │ │ │ Vulnerability Review Log │
80
+ │ • CVE match │ │ Audit Trail │
81
+ ┌─────────────┐ │ • KEV check │ └───────────────────────────┘
82
+ │ NVD + KEV │ ──▶ │ • EOL check │
83
+ │ feeds │ │ • Risk score│
84
+ └─────────────┘ └──────────────┘
85
+ ```
86
+
87
+ ## Quick Start
88
+
89
+ ### Install
90
+
91
+ ```bash
92
+ pip install medsbom
93
+ ```
94
+
95
+ ### Generate your SBOM (if you don't have one)
96
+
97
+ ```bash
98
+ # Using Syft
99
+ syft dir:./my-firmware -o cyclonedx-json > my-device.sbom.json
100
+
101
+ # Using Trivy
102
+ trivy fs --format cyclonedx --output my-device.sbom.json ./my-project/
103
+ ```
104
+
105
+ ### Run MedSBOM
106
+
107
+ ```bash
108
+ # Check for vulnerabilities and EOL status
109
+ medsbom check my-device.sbom.json --device "Insulin Pump" --device-version "2.3.1"
110
+
111
+ # Generate FDA compliance documents
112
+ medsbom report my-device.sbom.json --format all --output ./compliance-docs/
113
+ ```
114
+
115
+ **That's it.** You now have:
116
+ - `fda_premarket_summary.md` — Maps to FDA 2023 Cybersecurity Guidance structure
117
+ - `soup_risk_assessment.md` — IEC 62304 §7.1.3 SOUP register with risk levels
118
+ - `vulnerability_review_log.md` — Timestamped audit evidence
119
+
120
+ ## Features
121
+
122
+ | Feature | Description |
123
+ |---|---|
124
+ | **SBOM Ingestion** | CycloneDX and SPDX JSON (from Syft, Trivy, or any scanner) |
125
+ | **CVE Matching** | Cross-reference against NVD with local caching |
126
+ | **CISA KEV** | Flag actively exploited vulnerabilities |
127
+ | **EOL Detection** | Check end-of-life status via endoflife.date |
128
+ | **Risk Scoring** | Composite score: CVSS + KEV + EOL proximity |
129
+ | **FDA Docs** | Premarket Cybersecurity Summary template |
130
+ | **IEC 62304** | SOUP Risk Assessment table |
131
+ | **Audit Trail** | Immutable, append-only log for regulatory evidence |
132
+ | **REST API** | FastAPI server for integration and dashboards |
133
+ | **Docker** | Single container, no external dependencies |
134
+
135
+ ## CLI Commands
136
+
137
+ ```bash
138
+ medsbom ingest <sbom-file> # Parse and validate an SBOM
139
+ medsbom check <sbom-file> # Vulnerability + EOL check
140
+ medsbom report <sbom-file> # Generate compliance documents
141
+ medsbom audit # View audit trail
142
+ medsbom version # Show version
143
+ ```
144
+
145
+ ## API
146
+
147
+ Start the API server:
148
+
149
+ ```bash
150
+ uvicorn medsbom.api.main:app --host 0.0.0.0 --port 8000
151
+ ```
152
+
153
+ Endpoints:
154
+ - `GET /health` — Health check
155
+ - `POST /api/v1/scans` — Upload SBOM and run analysis
156
+ - `GET /api/v1/scans/{id}` — Get scan results
157
+ - `GET /api/v1/scans/{id}/report/{format}` — Generate report (fda/soup/vuln)
158
+ - `GET /api/v1/audit` — Audit trail
159
+
160
+ Interactive docs at: `http://localhost:8000/docs`
161
+
162
+ ## Docker
163
+
164
+ ```bash
165
+ # CLI mode
166
+ docker run --rm -v $(pwd):/data medsbom check /data/my-sbom.json
167
+
168
+ # API mode
169
+ docker compose -f docker/docker-compose.yml up
170
+ ```
171
+
172
+ ## Configuration
173
+
174
+ | Environment Variable | Description | Default |
175
+ |---|---|---|
176
+ | `NVD_API_KEY` | NVD API key (recommended — 10x faster) | None |
177
+ | `MEDSBOM_CACHE_DIR` | Local cache directory | `~/.medsbom/cache` |
178
+ | `MEDSBOM_AUDIT_DB` | Audit database path | `~/.medsbom/audit.db` |
179
+
180
+ Get a free NVD API key: https://nvd.nist.gov/developers/request-an-api-key
181
+
182
+ ## Important Disclaimer
183
+
184
+ > **⚠️ REGULATORY NOTICE:** MedSBOM generates DRAFT compliance documentation to assist with FDA/IEC-62304 workflows. This tool does NOT constitute legal or regulatory advice. All generated output must be reviewed and approved by a qualified regulatory professional before submission to any regulatory body. MedSBOM contributors accept no liability for regulatory decisions made based on this output.
185
+
186
+ ## Project Structure
187
+
188
+ ```
189
+ medsbom/
190
+ ├── cli/ # Typer CLI
191
+ ├── core/
192
+ │ ├── ingest.py # SBOM parsing (CycloneDX + SPDX)
193
+ │ ├── cve_match.py # NVD + KEV vulnerability matching
194
+ │ ├── eol_check.py # End-of-life checking
195
+ │ ├── risk_score.py # Composite risk scoring
196
+ │ ├── doc_generator.py # Jinja2 → Markdown/PDF
197
+ │ ├── audit.py # Append-only audit trail
198
+ │ └── models.py # Pydantic data models
199
+ ├── api/ # FastAPI REST API
200
+ ├── templates/ # Jinja2 regulatory doc templates
201
+ ├── tests/ # Comprehensive test suite
202
+ ├── examples/ # Sample SBOMs and usage guides
203
+ └── docker/ # Container deployment
204
+ ```
205
+
206
+ ## Contributing
207
+
208
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
209
+
210
+ Especially welcome:
211
+ - Regulatory template improvements (FDA, IEC 62304, ISO 14971, EU MDR)
212
+ - Additional SBOM format support
213
+ - Integration with more scanners
214
+ - Translations of templates
215
+
216
+ ## Sponsor
217
+
218
+ MedSBOM is free and open source. If it saves your team time and money, consider supporting development:
219
+
220
+ - **[GitHub Sponsors](https://github.com/sponsors/medsbom)** — Monthly or one-time support
221
+ - **[Open Collective](https://opencollective.com/medsbom)** — Transparent community funding
222
+ - **[Buy Me a Coffee](https://www.buymeacoffee.com/medsbom)** — Quick one-time tips
223
+
224
+ For enterprise support contracts or custom template development, open an issue or email the maintainers.
225
+
226
+ ## License
227
+
228
+ Apache License 2.0 — see [LICENSE](LICENSE).
229
+
230
+ Chosen specifically for medical device companies: permissive, includes patent grant, no copyleft concerns for proprietary firmware integration.
231
+
232
+ ---
233
+
234
+ <div align="center">
235
+
236
+ **Built for the medical device community. Free forever.**
237
+
238
+ *If MedSBOM helps your team, [star the repo](https://github.com/medsbom/medsbom) and tell your colleagues.*
239
+
240
+ </div>