cbomly 0.2.0__tar.gz → 0.3.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 (53) hide show
  1. {cbomly-0.2.0/src/cbomly.egg-info → cbomly-0.3.0}/PKG-INFO +48 -36
  2. {cbomly-0.2.0 → cbomly-0.3.0}/README.md +45 -33
  3. {cbomly-0.2.0 → cbomly-0.3.0}/pyproject.toml +3 -3
  4. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/__init__.py +1 -1
  5. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/cli.py +56 -5
  6. cbomly-0.3.0/src/cbomly/importer.py +248 -0
  7. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/au.toml +8 -7
  8. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/baseline.toml +14 -4
  9. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/ca.toml +6 -3
  10. cbomly-0.3.0/src/cbomly/packs/eu.toml +96 -0
  11. cbomly-0.3.0/src/cbomly/packs/india.toml +96 -0
  12. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/jp.toml +11 -9
  13. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/pci-dss.toml +7 -6
  14. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/sg.toml +7 -5
  15. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/uk.toml +4 -3
  16. cbomly-0.3.0/src/cbomly/packs/us-cnsa2.toml +87 -0
  17. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/packs/us-fda.toml +22 -13
  18. cbomly-0.3.0/src/cbomly/packs/us.toml +113 -0
  19. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/report.py +3 -2
  20. cbomly-0.3.0/src/cbomly/sbom.py +83 -0
  21. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/upload.py +2 -2
  22. {cbomly-0.2.0 → cbomly-0.3.0/src/cbomly.egg-info}/PKG-INFO +48 -36
  23. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly.egg-info/SOURCES.txt +1 -0
  24. {cbomly-0.2.0 → cbomly-0.3.0}/tests/test_cli.py +18 -4
  25. {cbomly-0.2.0 → cbomly-0.3.0}/tests/test_keys.py +5 -5
  26. {cbomly-0.2.0 → cbomly-0.3.0}/tests/test_upload.py +1 -1
  27. cbomly-0.2.0/src/cbomly/packs/eu.toml +0 -117
  28. cbomly-0.2.0/src/cbomly/packs/india.toml +0 -102
  29. cbomly-0.2.0/src/cbomly/packs/us-cnsa2.toml +0 -97
  30. cbomly-0.2.0/src/cbomly/packs/us.toml +0 -145
  31. cbomly-0.2.0/src/cbomly/sbom.py +0 -54
  32. {cbomly-0.2.0 → cbomly-0.3.0}/LICENSE +0 -0
  33. {cbomly-0.2.0 → cbomly-0.3.0}/NOTICE +0 -0
  34. {cbomly-0.2.0 → cbomly-0.3.0}/setup.cfg +0 -0
  35. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/__main__.py +0 -0
  36. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/algorithms.py +0 -0
  37. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/cbom.py +0 -0
  38. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/cbom_names.py +0 -0
  39. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/detect/__init__.py +0 -0
  40. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/detect/deps.py +0 -0
  41. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/detect/keys.py +0 -0
  42. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/detect/services.py +0 -0
  43. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/detect/source.py +0 -0
  44. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/findings.py +0 -0
  45. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/inventory.py +0 -0
  46. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/rules.py +0 -0
  47. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly/scanner.py +0 -0
  48. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly.egg-info/dependency_links.txt +0 -0
  49. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly.egg-info/entry_points.txt +0 -0
  50. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly.egg-info/requires.txt +0 -0
  51. {cbomly-0.2.0 → cbomly-0.3.0}/src/cbomly.egg-info/top_level.txt +0 -0
  52. {cbomly-0.2.0 → cbomly-0.3.0}/tests/test_rules.py +0 -0
  53. {cbomly-0.2.0 → cbomly-0.3.0}/tests/test_source.py +0 -0
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cbomly
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Find the cryptography in your software, write a CycloneDX CBOM, and check it is quantum-safe.
5
5
  Author-email: Cbomly <team@cbomly.com>
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://cbomly.com
8
- Project-URL: Source, https://github.com/Cbomly/cbomly-scanner
9
- Project-URL: Issues, https://github.com/Cbomly/cbomly-scanner/issues
8
+ Project-URL: Documentation, https://cbomly.com/download/
10
9
  Keywords: cbom,sbom,cyclonedx,post-quantum,pqc,cryptography,cert-in,compliance
11
10
  Classifier: Programming Language :: Python :: 3
12
11
  Classifier: Operating System :: POSIX :: Linux
13
12
  Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: Microsoft :: Windows
14
14
  Classifier: Topic :: Security :: Cryptography
15
15
  Classifier: Environment :: Console
16
16
  Classifier: Intended Audience :: Developers
@@ -33,7 +33,7 @@ algorithm, key and certificate your product uses, with the file and line where i
33
33
  writes the normal software list (**SBOM**) and a plain-English report that says what a future quantum
34
34
  computer would break, and what to replace it with.
35
35
 
36
- It runs locally on Linux and macOS. Nothing is uploaded unless you run `cbomly upload` to keep your
36
+ It runs locally on Linux, macOS and Windows. Nothing is uploaded unless you run `cbomly upload` to keep your
37
37
  reports in a free dashboard at [app.cbomly.com](https://app.cbomly.com), and even then only findings are
38
38
  sent, never source code.
39
39
 
@@ -60,18 +60,20 @@ standards (ML-KEM, ML-DSA, SLH-DSA), and buyers are starting to ask their softwa
60
60
  CBOM and a migration plan:
61
61
 
62
62
  - **US:** NIST IR 8547 (Oct 2026) deprecates RSA and elliptic curves after 2030 and disallows them
63
- after 2035; EO 14412 sets federal PQC key exchange by end of 2030 and signatures by end of 2031;
64
- NSA's CNSA 2.0 sets 2030-2033 deadlines for national security systems; EO 14028 and FDA section
65
- 524B ask for SBOMs.
66
- - **EU:** the Cyber Resilience Act requires an SBOM from 11 December 2027 (reporting since
67
- 11 September 2026); the EU PQC roadmap says start by end of 2026 and finish high-risk uses by 2030.
63
+ after 2035. EO 14412 (June 2026) moves federal high-impact systems to PQC key exchange by the end
64
+ of 2030 and PQC signatures by the end of 2031, and OMB M-26-15 has agencies keep a CBOM. NSA's
65
+ CNSA 2.0 applies to new national security system purchases from 1 January 2027. FDA requires an
66
+ SBOM for cyber medical devices.
67
+ - **EU:** the Cyber Resilience Act's main obligations, including the SBOM, apply from 11 December
68
+ 2027 (reporting since 11 September 2026). The EU PQC roadmap says take the first steps, including
69
+ a crypto inventory, by the end of 2026, and finish high-risk uses by 2030 and medium-risk by 2035.
68
70
  - **UK, Canada, Australia, Singapore, Japan:** national PQC timelines between 2030 (Australia) and
69
71
  2035, each starting with a cryptographic inventory.
70
72
  - **India:** CERT-In's BOM guidelines v2.0 (July 2025) define SBOM and CBOM; SEBI's CSCRF (Aug 2024)
71
- requires regulated entities to obtain SBOMs; the DST post-quantum roadmap (Feb 2026) asks vendors
72
- for CBOMs from FY 2027-28.
73
- - **Payments:** PCI DSS v4.0.1 requires a yearly reviewed inventory of cipher suites, keys and
74
- certificates (since 31 March 2025).
73
+ requires an SBOM for new core and critical software; the DST post-quantum roadmap (Feb 2026) asks
74
+ buyers to require vendor CBOMs from FY 2027-28.
75
+ - **Payments:** PCI DSS v4.0.1 requires a yearly reviewed inventory of cipher suites and protocols
76
+ (since 31 March 2025) and an inventory of keys and certificates.
75
77
 
76
78
  ## Install
77
79
 
@@ -88,6 +90,12 @@ python3 -m pip install --user pipx
88
90
  pipx install cbomly
89
91
  curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b ~/.local/bin
90
92
 
93
+ # Windows (PowerShell)
94
+ py -m pip install --user pipx
95
+ py -m pipx ensurepath
96
+ pipx install cbomly
97
+ winget install Anchore.syft # or: scoop install main/syft; then open a new terminal
98
+
91
99
  cbomly doctor # checks everything is in place
92
100
  ```
93
101
 
@@ -100,8 +108,15 @@ cbomly scan . --fail-on high # exit code 1 if anything high or critical i
100
108
  cbomly scan . --exclude 'testdata' # skip folders or files by name pattern
101
109
  cbomly rules # list rule packs
102
110
  cbomly rules india # show the rules in a pack
111
+ cbomly import cbom.json -r india # use a CBOM from IBM CBOMkit, cdxgen or another tool instead of scanning
103
112
  ```
104
113
 
114
+ **Already have a CBOM?** `cbomly import` reads any CycloneDX 1.6+ CBOM, for example from IBM's
115
+ CBOMkit / Sonar Cryptography plugin or cdxgen. It maps each `cryptographic-asset` (algorithms, keys,
116
+ certificates, protocols) to Cbomly's catalog by OID or name, keeps the software components as the SBOM, and
117
+ writes the same three files as `cbomly scan`, so rule packs, `cbomly upload` and the dashboard all work.
118
+ Assets it doesn't recognise are listed in the report and left out.
119
+
105
120
  Output goes to `./cbomly-out/`:
106
121
 
107
122
  | File | What it is |
@@ -119,18 +134,15 @@ cbomly upload --dry-run # prints exactly what would be sent
119
134
  cbomly upload --gate # exit code 1 if the project's release gate fails (Pro)
120
135
  ```
121
136
 
122
- GitHub Actions:
137
+ In CI, run the same commands in any job with Python 3.11+ (store the key as a secret):
123
138
 
124
- ```yaml
125
- - uses: actions/checkout@v4
126
- - uses: Cbomly/cbomly-scanner@v0
127
- with:
128
- api-key: ${{ secrets.CBOMLY_API_KEY }}
129
- rules: india
130
- gate: true
139
+ ```bash
140
+ pipx install cbomly
141
+ cbomly scan . --rules india -o cbomly-out
142
+ cbomly upload cbomly-out --gate
131
143
  ```
132
144
 
133
- GitLab CI: include [`ci/gitlab/cbomly.yml`](ci/gitlab/cbomly.yml) and extend `.cbomly`.
145
+ Your project page in the dashboard has ready-to-paste GitHub Actions and GitLab CI jobs.
134
146
 
135
147
  Free accounts get a basic report for every scan. Pro adds the signed compliance pack, the upgrade plan,
136
148
  the trend view, alerts for new RSA/ECC and the release gate.
@@ -164,24 +176,25 @@ a new country or standard is a new file, not new code. Built-in packs:
164
176
  | Pack | Status | Covers |
165
177
  |---|---|---|
166
178
  | `baseline` | stable | Quantum-vulnerable crypto, broken and deprecated algorithms, short RSA keys, committed private keys, expired certificates |
167
- | `us` | draft | NIST IR 8547, EO 14412 / OMB M-26-15, CISA PQC product categories, EO 14028 and NTIA SBOM |
168
- | `us-cnsa2` | draft | NSA CNSA 2.0 and CNSSP 15 for national security systems (includes `us`) |
169
- | `us-fda` | draft | FD&C Act section 524B SBOM and FDA premarket cybersecurity guidance (medical devices) |
170
- | `eu` | draft | Cyber Resilience Act SBOM and crypto, EU PQC roadmap, NIS2, DORA |
171
- | `uk` | draft | NCSC PQC migration timelines (2028 / 2031 / 2035) |
172
- | `ca` | draft | Government of Canada PQC roadmap and TBS SPIN, OSFI quantum readiness |
173
- | `au` | draft | ASD ISM: stop traditional asymmetric crypto by end of 2030 |
174
- | `sg` | draft | MAS quantum advisory and proposed 2030 / 2034 migration timelines |
175
- | `jp` | draft | National Cybersecurity Office 2035 target, FSA guidance for banks |
176
- | `india` | draft | CERT-In BOM guidelines (SBOM + CBOM), SEBI CSCRF, DST post-quantum roadmap milestones |
179
+ | `us` | verified | NIST IR 8547, EO 14412, OMB M-26-15, CISA 2026 SBOM minimum elements |
180
+ | `us-cnsa2` | verified | NSA CNSA 2.0 (FAQ v2.1) for national security systems (includes `us`) |
181
+ | `us-fda` | verified | FD&C Act section 524B SBOM and FDA premarket cybersecurity guidance (medical devices) |
182
+ | `eu` | verified | Cyber Resilience Act SBOM, EU PQC roadmap, NIS2 cryptography rules, DORA key management |
183
+ | `uk` | verified | NCSC PQC migration timelines (2028 / 2031 / 2035) |
184
+ | `ca` | verified | Government of Canada PQC roadmap and TBS SPIN, OSFI quantum readiness |
185
+ | `au` | verified | ASD: stop traditional asymmetric crypto by end of 2030 |
186
+ | `sg` | verified | MAS quantum advisory and proposed 2030 / 2034 migration timelines |
187
+ | `jp` | verified | Government 2035 target, FSA guidance for banks |
188
+ | `india` | verified | CERT-In BOM guidelines (SBOM + CBOM), SEBI CSCRF, DST post-quantum roadmap milestones |
177
189
  | `pci-dss` | draft | PCI DSS v4.0.1 cipher suite, key and certificate inventory (12.3.3, 4.2.1.1, 6.3.2) |
178
190
 
179
191
  Combine packs for the markets you sell to, e.g. `--rules eu,us,india`.
180
192
 
181
193
  See [docs/rule-packs.md](docs/rule-packs.md) to write your own and load it with `--rules-dir`.
182
194
 
183
- The regional packs are marked **draft**: each reference says how far its summary was checked
184
- against the official documents, and anything not confirmed is labelled UNVERIFIED or NOT re-checked. The reports are informational, not legal advice.
195
+ Each reference in a pack links to the official document, with a short quote and the date it was
196
+ checked (`verified`). Claims we could not confirm were left out. `pci-dss` stays draft because the
197
+ PCI SSC PDF is licence-gated, so it was checked against a verbatim copy. The reports are informational, not legal advice.
185
198
 
186
199
  ## Development
187
200
 
@@ -194,8 +207,7 @@ ruff check src tests
194
207
 
195
208
  Every key and certificate under `tests/fixtures/` is a throwaway test fixture.
196
209
 
197
- Contributions are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md). To report a security problem,
198
- see [SECURITY.md](SECURITY.md).
210
+ To report a security problem, email team@cbomly.com.
199
211
 
200
212
  ## Licence
201
213
 
@@ -7,7 +7,7 @@ algorithm, key and certificate your product uses, with the file and line where i
7
7
  writes the normal software list (**SBOM**) and a plain-English report that says what a future quantum
8
8
  computer would break, and what to replace it with.
9
9
 
10
- It runs locally on Linux and macOS. Nothing is uploaded unless you run `cbomly upload` to keep your
10
+ It runs locally on Linux, macOS and Windows. Nothing is uploaded unless you run `cbomly upload` to keep your
11
11
  reports in a free dashboard at [app.cbomly.com](https://app.cbomly.com), and even then only findings are
12
12
  sent, never source code.
13
13
 
@@ -34,18 +34,20 @@ standards (ML-KEM, ML-DSA, SLH-DSA), and buyers are starting to ask their softwa
34
34
  CBOM and a migration plan:
35
35
 
36
36
  - **US:** NIST IR 8547 (Oct 2026) deprecates RSA and elliptic curves after 2030 and disallows them
37
- after 2035; EO 14412 sets federal PQC key exchange by end of 2030 and signatures by end of 2031;
38
- NSA's CNSA 2.0 sets 2030-2033 deadlines for national security systems; EO 14028 and FDA section
39
- 524B ask for SBOMs.
40
- - **EU:** the Cyber Resilience Act requires an SBOM from 11 December 2027 (reporting since
41
- 11 September 2026); the EU PQC roadmap says start by end of 2026 and finish high-risk uses by 2030.
37
+ after 2035. EO 14412 (June 2026) moves federal high-impact systems to PQC key exchange by the end
38
+ of 2030 and PQC signatures by the end of 2031, and OMB M-26-15 has agencies keep a CBOM. NSA's
39
+ CNSA 2.0 applies to new national security system purchases from 1 January 2027. FDA requires an
40
+ SBOM for cyber medical devices.
41
+ - **EU:** the Cyber Resilience Act's main obligations, including the SBOM, apply from 11 December
42
+ 2027 (reporting since 11 September 2026). The EU PQC roadmap says take the first steps, including
43
+ a crypto inventory, by the end of 2026, and finish high-risk uses by 2030 and medium-risk by 2035.
42
44
  - **UK, Canada, Australia, Singapore, Japan:** national PQC timelines between 2030 (Australia) and
43
45
  2035, each starting with a cryptographic inventory.
44
46
  - **India:** CERT-In's BOM guidelines v2.0 (July 2025) define SBOM and CBOM; SEBI's CSCRF (Aug 2024)
45
- requires regulated entities to obtain SBOMs; the DST post-quantum roadmap (Feb 2026) asks vendors
46
- for CBOMs from FY 2027-28.
47
- - **Payments:** PCI DSS v4.0.1 requires a yearly reviewed inventory of cipher suites, keys and
48
- certificates (since 31 March 2025).
47
+ requires an SBOM for new core and critical software; the DST post-quantum roadmap (Feb 2026) asks
48
+ buyers to require vendor CBOMs from FY 2027-28.
49
+ - **Payments:** PCI DSS v4.0.1 requires a yearly reviewed inventory of cipher suites and protocols
50
+ (since 31 March 2025) and an inventory of keys and certificates.
49
51
 
50
52
  ## Install
51
53
 
@@ -62,6 +64,12 @@ python3 -m pip install --user pipx
62
64
  pipx install cbomly
63
65
  curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b ~/.local/bin
64
66
 
67
+ # Windows (PowerShell)
68
+ py -m pip install --user pipx
69
+ py -m pipx ensurepath
70
+ pipx install cbomly
71
+ winget install Anchore.syft # or: scoop install main/syft; then open a new terminal
72
+
65
73
  cbomly doctor # checks everything is in place
66
74
  ```
67
75
 
@@ -74,8 +82,15 @@ cbomly scan . --fail-on high # exit code 1 if anything high or critical i
74
82
  cbomly scan . --exclude 'testdata' # skip folders or files by name pattern
75
83
  cbomly rules # list rule packs
76
84
  cbomly rules india # show the rules in a pack
85
+ cbomly import cbom.json -r india # use a CBOM from IBM CBOMkit, cdxgen or another tool instead of scanning
77
86
  ```
78
87
 
88
+ **Already have a CBOM?** `cbomly import` reads any CycloneDX 1.6+ CBOM, for example from IBM's
89
+ CBOMkit / Sonar Cryptography plugin or cdxgen. It maps each `cryptographic-asset` (algorithms, keys,
90
+ certificates, protocols) to Cbomly's catalog by OID or name, keeps the software components as the SBOM, and
91
+ writes the same three files as `cbomly scan`, so rule packs, `cbomly upload` and the dashboard all work.
92
+ Assets it doesn't recognise are listed in the report and left out.
93
+
79
94
  Output goes to `./cbomly-out/`:
80
95
 
81
96
  | File | What it is |
@@ -93,18 +108,15 @@ cbomly upload --dry-run # prints exactly what would be sent
93
108
  cbomly upload --gate # exit code 1 if the project's release gate fails (Pro)
94
109
  ```
95
110
 
96
- GitHub Actions:
111
+ In CI, run the same commands in any job with Python 3.11+ (store the key as a secret):
97
112
 
98
- ```yaml
99
- - uses: actions/checkout@v4
100
- - uses: Cbomly/cbomly-scanner@v0
101
- with:
102
- api-key: ${{ secrets.CBOMLY_API_KEY }}
103
- rules: india
104
- gate: true
113
+ ```bash
114
+ pipx install cbomly
115
+ cbomly scan . --rules india -o cbomly-out
116
+ cbomly upload cbomly-out --gate
105
117
  ```
106
118
 
107
- GitLab CI: include [`ci/gitlab/cbomly.yml`](ci/gitlab/cbomly.yml) and extend `.cbomly`.
119
+ Your project page in the dashboard has ready-to-paste GitHub Actions and GitLab CI jobs.
108
120
 
109
121
  Free accounts get a basic report for every scan. Pro adds the signed compliance pack, the upgrade plan,
110
122
  the trend view, alerts for new RSA/ECC and the release gate.
@@ -138,24 +150,25 @@ a new country or standard is a new file, not new code. Built-in packs:
138
150
  | Pack | Status | Covers |
139
151
  |---|---|---|
140
152
  | `baseline` | stable | Quantum-vulnerable crypto, broken and deprecated algorithms, short RSA keys, committed private keys, expired certificates |
141
- | `us` | draft | NIST IR 8547, EO 14412 / OMB M-26-15, CISA PQC product categories, EO 14028 and NTIA SBOM |
142
- | `us-cnsa2` | draft | NSA CNSA 2.0 and CNSSP 15 for national security systems (includes `us`) |
143
- | `us-fda` | draft | FD&C Act section 524B SBOM and FDA premarket cybersecurity guidance (medical devices) |
144
- | `eu` | draft | Cyber Resilience Act SBOM and crypto, EU PQC roadmap, NIS2, DORA |
145
- | `uk` | draft | NCSC PQC migration timelines (2028 / 2031 / 2035) |
146
- | `ca` | draft | Government of Canada PQC roadmap and TBS SPIN, OSFI quantum readiness |
147
- | `au` | draft | ASD ISM: stop traditional asymmetric crypto by end of 2030 |
148
- | `sg` | draft | MAS quantum advisory and proposed 2030 / 2034 migration timelines |
149
- | `jp` | draft | National Cybersecurity Office 2035 target, FSA guidance for banks |
150
- | `india` | draft | CERT-In BOM guidelines (SBOM + CBOM), SEBI CSCRF, DST post-quantum roadmap milestones |
153
+ | `us` | verified | NIST IR 8547, EO 14412, OMB M-26-15, CISA 2026 SBOM minimum elements |
154
+ | `us-cnsa2` | verified | NSA CNSA 2.0 (FAQ v2.1) for national security systems (includes `us`) |
155
+ | `us-fda` | verified | FD&C Act section 524B SBOM and FDA premarket cybersecurity guidance (medical devices) |
156
+ | `eu` | verified | Cyber Resilience Act SBOM, EU PQC roadmap, NIS2 cryptography rules, DORA key management |
157
+ | `uk` | verified | NCSC PQC migration timelines (2028 / 2031 / 2035) |
158
+ | `ca` | verified | Government of Canada PQC roadmap and TBS SPIN, OSFI quantum readiness |
159
+ | `au` | verified | ASD: stop traditional asymmetric crypto by end of 2030 |
160
+ | `sg` | verified | MAS quantum advisory and proposed 2030 / 2034 migration timelines |
161
+ | `jp` | verified | Government 2035 target, FSA guidance for banks |
162
+ | `india` | verified | CERT-In BOM guidelines (SBOM + CBOM), SEBI CSCRF, DST post-quantum roadmap milestones |
151
163
  | `pci-dss` | draft | PCI DSS v4.0.1 cipher suite, key and certificate inventory (12.3.3, 4.2.1.1, 6.3.2) |
152
164
 
153
165
  Combine packs for the markets you sell to, e.g. `--rules eu,us,india`.
154
166
 
155
167
  See [docs/rule-packs.md](docs/rule-packs.md) to write your own and load it with `--rules-dir`.
156
168
 
157
- The regional packs are marked **draft**: each reference says how far its summary was checked
158
- against the official documents, and anything not confirmed is labelled UNVERIFIED or NOT re-checked. The reports are informational, not legal advice.
169
+ Each reference in a pack links to the official document, with a short quote and the date it was
170
+ checked (`verified`). Claims we could not confirm were left out. `pci-dss` stays draft because the
171
+ PCI SSC PDF is licence-gated, so it was checked against a verbatim copy. The reports are informational, not legal advice.
159
172
 
160
173
  ## Development
161
174
 
@@ -168,8 +181,7 @@ ruff check src tests
168
181
 
169
182
  Every key and certificate under `tests/fixtures/` is a throwaway test fixture.
170
183
 
171
- Contributions are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md). To report a security problem,
172
- see [SECURITY.md](SECURITY.md).
184
+ To report a security problem, email team@cbomly.com.
173
185
 
174
186
  ## Licence
175
187
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cbomly"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Find the cryptography in your software, write a CycloneDX CBOM, and check it is quantum-safe."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -15,6 +15,7 @@ classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
16
  "Operating System :: POSIX :: Linux",
17
17
  "Operating System :: MacOS",
18
+ "Operating System :: Microsoft :: Windows",
18
19
  "Topic :: Security :: Cryptography",
19
20
  "Environment :: Console",
20
21
  "Intended Audience :: Developers",
@@ -29,8 +30,7 @@ cbomly = "cbomly.cli:main"
29
30
 
30
31
  [project.urls]
31
32
  Homepage = "https://cbomly.com"
32
- Source = "https://github.com/Cbomly/cbomly-scanner"
33
- Issues = "https://github.com/Cbomly/cbomly-scanner/issues"
33
+ Documentation = "https://cbomly.com/download/"
34
34
 
35
35
  [tool.setuptools.packages.find]
36
36
  where = ["src"]
@@ -1,3 +1,3 @@
1
1
  """Cbomly: find the cryptography in your software and check it is quantum-safe."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.3.0"
@@ -45,6 +45,16 @@ def _parser() -> argparse.ArgumentParser:
45
45
  help="exit with code 1 if your project's release gate fails (e.g. new RSA or ECC was added)")
46
46
  u.add_argument("--dry-run", action="store_true", help="print exactly what would be sent, and send nothing")
47
47
 
48
+ im = sub.add_parser("import", help="turn a CBOM from another tool (IBM CBOMkit, cdxgen…) into Cbomly reports")
49
+ im.add_argument("file", help="CycloneDX 1.6+ JSON file with cryptographic-asset components")
50
+ im.add_argument("-r", "--rules", default="baseline", help="rule pack(s), comma-separated (default: baseline)")
51
+ im.add_argument("--rules-dir", action="append", default=[], help="extra folder of .toml rule packs")
52
+ im.add_argument("-o", "--out", default="cbomly-out", help="output folder (default: ./cbomly-out)")
53
+ im.add_argument("--name", help="product name to put in the reports (default: from the CBOM)")
54
+ im.add_argument("--fail-on", choices=SEVERITIES[:-1], help="exit with code 1 if any issue is this severe or worse")
55
+ im.add_argument("-q", "--quiet", action="store_true")
56
+ im.add_argument("--no-color", action="store_true")
57
+
48
58
  sub.add_parser("doctor", help="check that helper tools are installed")
49
59
  return p
50
60
 
@@ -88,6 +98,11 @@ def cmd_scan(a) -> int:
88
98
  log(f" Syft failed: {e}")
89
99
  notes.append(f"Syft failed, so no software list (SBOM) was produced: {str(e)[:200]}")
90
100
 
101
+ return write_outputs(a, name, packs, findings, sb, stats, notes, tool_versions)
102
+
103
+
104
+ def write_outputs(a, name, packs, findings, sb, stats, notes, tool_versions, source=None) -> int:
105
+ """Shared by `scan` and `import`: evaluate rules, write the three output files, print the summary."""
91
106
  libs = deps.crypto_libraries(sb)
92
107
  ev = rules.evaluate(packs, findings, sb)
93
108
  bom = cbom.build(findings, sb, name, libs, tool_versions, stats.services)
@@ -95,13 +110,17 @@ def cmd_scan(a) -> int:
95
110
 
96
111
  out = Path(a.out)
97
112
  out.mkdir(parents=True, exist_ok=True)
98
- (out / "cbom.cdx.json").write_text(json.dumps(bom, indent=2) + "\n")
99
- (out / "summary.md").write_text(report.markdown(name, findings, ev, libs, n_sw, notes, stats.services))
100
- (out / "findings.json").write_text(json.dumps(results_doc(name, findings, ev, libs, n_sw, stats), indent=2) + "\n")
113
+ (out / "cbom.cdx.json").write_text(json.dumps(bom, indent=2) + "\n", encoding="utf-8")
114
+ summary = report.markdown(name, findings, ev, libs, n_sw, notes, stats.services)
115
+ (out / "summary.md").write_text(summary, encoding="utf-8")
116
+ doc = results_doc(name, findings, ev, libs, n_sw, stats)
117
+ doc["source"] = source or {"type": "scan"}
118
+ (out / "findings.json").write_text(json.dumps(doc, indent=2) + "\n", encoding="utf-8")
101
119
 
102
120
  if not a.quiet:
103
121
  color = sys.stdout.isatty() and not a.no_color and not os.environ.get("NO_COLOR")
104
- print(report.terminal(findings, ev, str(out), color))
122
+ title = "Cbomly import complete" if source and source.get("type") == "import" else "Cbomly scan complete"
123
+ print(report.terminal(findings, ev, str(out), color, title))
105
124
 
106
125
  if a.fail_on:
107
126
  worst = ev.worst_severity()
@@ -110,6 +129,33 @@ def cmd_scan(a) -> int:
110
129
  return 0
111
130
 
112
131
 
132
+ def cmd_import(a) -> int:
133
+ from . import importer
134
+
135
+ try:
136
+ packs = rules.resolve([x.strip() for x in a.rules.split(",") if x.strip()], a.rules_dir)
137
+ findings, sb, info = importer.load(a.file)
138
+ except ValueError as e:
139
+ print(f"cbomly: {e}", file=sys.stderr)
140
+ return 2
141
+ if not info["crypto_assets"]:
142
+ print(f"cbomly: {a.file} has no cryptographic-asset components, so it is an SBOM, not a CBOM.", file=sys.stderr)
143
+ return 2
144
+ log = (lambda *m: None) if a.quiet else (lambda *m: print(*m, file=sys.stderr))
145
+ made_by = ", ".join(info["tools"]) or "an unknown tool"
146
+ log(f"Imported {info['crypto_assets']} crypto assets from {a.file} (made by {made_by}).")
147
+ notes = [f"Imported from a CycloneDX {info['spec']} CBOM made by {made_by}; Cbomly did not scan the code itself."]
148
+ if info["unrecognised"]:
149
+ names = ", ".join(sorted(set(info["unrecognised"]))[:10])
150
+ notes.append(f"{len(info['unrecognised'])} crypto asset(s) were not recognised and are left out: {names}.")
151
+ log(f" Not recognised: {names}")
152
+ name = a.name or info["name"] or Path(a.file).stem
153
+ stats = scanner.ScanStats()
154
+ source = {"type": "import", "file": Path(a.file).name, "spec": info["spec"], "tools": info["tools"],
155
+ "unrecognised": len(info["unrecognised"])}
156
+ return write_outputs(a, name, packs, findings, sb, stats, notes, {}, source)
157
+
158
+
113
159
  def results_doc(name, findings, ev, libs, n_sw, stats) -> dict:
114
160
  """findings.json: everything the reports need, so `cbomly upload` never has to re-scan."""
115
161
  def fd(f):
@@ -183,8 +229,13 @@ def cmd_doctor(_a) -> int:
183
229
 
184
230
 
185
231
  def main(argv: list[str] | None = None) -> int:
232
+ # Windows consoles and redirects may use a legacy code page (cp1252): never crash on a symbol.
233
+ for stream in (sys.stdout, sys.stderr):
234
+ if hasattr(stream, "reconfigure"):
235
+ stream.reconfigure(errors="replace")
186
236
  a = _parser().parse_args(argv)
187
- return {"scan": cmd_scan, "rules": cmd_rules, "doctor": cmd_doctor, "upload": cmd_upload}[a.cmd](a)
237
+ return {"scan": cmd_scan, "import": cmd_import, "rules": cmd_rules, "doctor": cmd_doctor,
238
+ "upload": cmd_upload}[a.cmd](a)
188
239
 
189
240
 
190
241
  if __name__ == "__main__":