Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CycloneDX SBOMs #1200

Merged
merged 8 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Added
- Support for ingesting CycloneDX `bom.json` and `bom.xml` files
- `phylum auth list-tokens` subcommand to list API tokens
- `phylum auth revoke-token` subcommand to revoke API tokens

Expand Down
12 changes: 1 addition & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cli/src/commands/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ mod tests {
("../tests/fixtures/spdx-2.2.spdx.json", LockfileFormat::Spdx),
("../tests/fixtures/spdx-2.3.spdx.json", LockfileFormat::Spdx),
("../tests/fixtures/spdx-2.3.spdx.yaml", LockfileFormat::Spdx),
("../tests/fixtures/bom.1.3.json", LockfileFormat::CycloneDX),
("../tests/fixtures/bom.1.3.xml", LockfileFormat::CycloneDX),
("../tests/fixtures/bom.json", LockfileFormat::CycloneDX),
("../tests/fixtures/bom.xml", LockfileFormat::CycloneDX),
];

for (file, expected_format) in test_cases {
Expand Down
2 changes: 1 addition & 1 deletion docs/command_line_tool/phylum_analyze.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Usage: phylum analyze [OPTIONS] [LOCKFILE]...

-t, --lockfile-type <type>
&emsp; Lock file type used for all lock files (default: auto)
&emsp; Accepted values: `npm`, `yarn`, `pnpm`, `gem`, `pip`, `poetry`, `pipenv`, `mvn`, `gradle`, `nugetlock`, `msbuild`, `go`, `cargo`, `spdx`, `auto`
&emsp; Accepted values: `npm`, `yarn`, `pnpm`, `gem`, `pip`, `poetry`, `pipenv`, `mvn`, `gradle`, `nugetlock`, `msbuild`, `go`, `cargo`, `spdx`, `cyclonedx`, `auto`

-v, --verbose...
&emsp; Increase the level of verbosity (the maximum is -vvv)
Expand Down
2 changes: 1 addition & 1 deletion docs/command_line_tool/phylum_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Usage: phylum init [OPTIONS] [PROJECT_NAME]

-t, --lockfile-type <type>
&emsp; Lock file type used for all lock files (default: auto)
&emsp; Accepted values: `npm`, `yarn`, `pnpm`, `gem`, `pip`, `poetry`, `pipenv`, `mvn`, `gradle`, `nugetlock`, `msbuild`, `go`, `cargo`, `spdx`, `auto`
&emsp; Accepted values: `npm`, `yarn`, `pnpm`, `gem`, `pip`, `poetry`, `pipenv`, `mvn`, `gradle`, `nugetlock`, `msbuild`, `go`, `cargo`, `spdx`, `cyclonedx`, `auto`

-f, --force
&emsp; Overwrite existing configurations without confirmation
Expand Down
2 changes: 1 addition & 1 deletion docs/command_line_tool/phylum_parse.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Usage: phylum parse [OPTIONS] [LOCKFILE]...

-t, --lockfile-type <type>
&emsp; Lock file type used for all lock files (default: auto)
&emsp; Accepted values: `npm`, `yarn`, `pnpm`, `gem`, `pip`, `poetry`, `pipenv`, `mvn`, `gradle`, `nugetlock`, `msbuild`, `go`, `cargo`, `spdx`, `auto`
&emsp; Accepted values: `npm`, `yarn`, `pnpm`, `gem`, `pip`, `poetry`, `pipenv`, `mvn`, `gradle`, `nugetlock`, `msbuild`, `go`, `cargo`, `spdx`, `cyclonedx`, `auto`

-v, --verbose...
&emsp; Increase the level of verbosity (the maximum is -vvv)
Expand Down
1 change: 1 addition & 0 deletions docs/knowledge_base/analyzing-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The Phylum CLI supports processing many different lockfiles:
| `go` | `go.sum` |
| `cargo` | `Cargo.lock` |
| `spdx` | `*.spdx.json` <br /> `*.spdx.yaml` <br /> `*.spdx.yml` <br /> `*.spdx` |
| `cyclonedx` | `bom.json` <br /> `bom.xml` |

The lockfile type will be automatically detected based on the filename. If needed, this can be overridden with the
`--lockfile-type` (`-t`) option.
Expand Down
2 changes: 1 addition & 1 deletion lockfile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ignore = "0.4.20"
lockfile_generator = { path = "../lockfile_generator", optional = true }
log = "0.4.6"
nom = "7.1.1"
packageurl = "0.3.0"
phylum_types = { git = "https://github.com/phylum-dev/phylum-types", branch = "development" }
purl = "0.1.1"
serde = { version = "1.0.144", features = ["derive"] }
serde_json = "1.0.85"
serde_yaml = "0.9.2"
Expand Down
Loading