Skip to content

Commit

Permalink
Added cdxgen with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Prabhu Subramanian committed Jan 7, 2020
1 parent 03dc3c0 commit 5ace009
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cdxgen/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM gcr.io/cloud-builders/npm
RUN npm install -g @appthreat/cdxgen

ENTRYPOINT ["cdxgen"]
33 changes: 33 additions & 0 deletions cdxgen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# cdxgen

[cdxgen](https://github.com/AppThreat/cdxgen) creates a valid CycloneDX Software Bill-of-Materials (SBOM) containing an aggregate of all project dependencies for node.js, python, java and golang projects. Optionally, it can submit the generated BOM to [dependency track](https://github.com/DependencyTrack/dependency-track/) or AppThreat server for analysis

## Usage:

Minimal configuration example to generate bom

```yaml
steps:
- name: "gcr.io/$PROJECT_ID/cdxgen"
args: ["--output", "bom.xml", "src"]
```
To generate bom and submit to the server
```yaml
steps:
- name: "gcr.io/$PROJECT_ID/cdxgen"
id: "Generate bom.xml and submit to dependency track/AppThreat server"
args:
[
"--output",
"bom.xml",
"--serverUrl",
"https://deptrack.appthreat.io",
"--apiKey",
"CHANGEME",
"src",
]
```
Follow the [encrypted secrets](https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials) guide to securely store and retrieve the `apiKey` for the server.
8 changes: 8 additions & 0 deletions cdxgen/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
steps:
- name: "gcr.io/cloud-builders/docker"
args: ["build", "--tag=gcr.io/$PROJECT_ID/cdxgen", "."]
- name: "gcr.io/${PROJECT_ID}/cdxgen"
args: ["-h"]

images: ["gcr.io/$PROJECT_ID/cdxgen"]
tags: ["cloud-builders-community"]
17 changes: 17 additions & 0 deletions cdxgen/examples/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
steps:
- name: "gcr.io/$PROJECT_ID/cdxgen"
id: "Generate bom.xml"
args: ["--output", "bom.xml", "src"]

- name: "gcr.io/$PROJECT_ID/cdxgen"
id: "Generate bom.xml and submit to dependency track/AppThreat server"
args:
[
"--output",
"bom.xml",
"--serverUrl",
"https://deptrack.appthreat.io",
"--apiKey",
"CHANGEME",
"src",
]

0 comments on commit 5ace009

Please sign in to comment.