Skip to content

Commit

Permalink
Added diagrams to docs
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Oct 10, 2023
1 parent 35223f5 commit 71edd05
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
18 changes: 18 additions & 0 deletions docs/CLI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# CLI Usage

## Overview

In CLI mode, you can invoke cdxgen with Source Code, Container Image, or Binary Artifact as input to generate a Software Bill-of-Materials document. This can be subsequently used for a range of use cases as shown.

```mermaid
flowchart LR
A[Source Code] --> B([fa:fa-terminal cdxgen])
A1[Container Image] --> B([fa:fa-terminal cdxgen])
A2[Binary Artifact] --> B([fa:fa-terminal cdxgen])
B --> C(fa:fa-file SBOM)---|fa:fa-hashtag Sign| C
C --> D{Use Cases}
subgraph BOM Use Cases
D -->|Break build| E[fa:fa-shield Invoke depscan]
D -->|Vulnerability Management| F[fa:fa-shield-halved Dependency Track]
D -->|License Compliance| G[fa:fa-rectangle-list Dependency Track]
end
```

## Installing

```shell
Expand Down
19 changes: 19 additions & 0 deletions docs/SERVER.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Server Usage

## Overview

```mermaid
sequenceDiagram
actor User
User->>+cdxgen server: Invoke /sbom
cdxgen server-->>-User: SBOM Response
```

## Running as a server

Invoke cdxgen with `--server` argument to run it in server mode. By default, it listens to port `9090`, which can be customized with the arguments `--server-host` and `--server-port`.
Expand Down Expand Up @@ -52,8 +61,18 @@ You can POST the arguments.
curl -H "Content-Type: application/json" http://localhost:9090/sbom -XPOST -d $'{"url": "https://github.com/HooliCorp/vulnerable-aws-koa-app.git", "type": "nodejs", "multiProject": "true"}'
```

### Health endpoint

Use the /health endpoint to check if the SBOM server is up and running.

```shell
curl "http://127.0.0.1:9090/health"
```

### Docker compose

Use the provided docker-compose file to quickly launch a cdxgen server instance.

```shell
git clone https://github.com/cyclonedx/cdxgen.git
docker compose up
Expand Down
23 changes: 21 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css">
<link rel="stylesheet" media="(prefers-color-scheme: light)" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
<!-- Custom Styles -->
<style>
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;700&display=swap');
Expand Down Expand Up @@ -77,17 +78,35 @@
placeholder: {
'/': 'Search'
}
}
},
plugins: [
function (hook) {
hook.doneEach(function () {
let mermaidConfig = {
querySelector: ".mermaid",
};
mermaid.run(mermaidConfig);
});
},
]
}
</script>
<!-- Docsify v4 -->
<!-- Required -->
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script>

<!-- Recommended -->
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
<script src="//unpkg.com/mermaid/dist/mermaid.js"></script>
<script src="//unpkg.com/docsify-mermaid@2.0.0/dist/docsify-mermaid.js"></script>
<script>
mermaid.initialize({
startOnLoad: true,
suppressErrors: true,
theme: 'dark'
});
</script>
</body>
</html>

0 comments on commit 71edd05

Please sign in to comment.