forked from GoogleCloudPlatform/cloud-builders-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Prabhu Subramanian
committed
Jan 7, 2020
1 parent
03dc3c0
commit 5ace009
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
] |