Skip to content

Commit 233bf40

Browse files
author
andream16
committed
Documentation for SDK and Smithyctl.
1 parent a7e3946 commit 233bf40

File tree

8 files changed

+122
-88
lines changed

8 files changed

+122
-88
lines changed

README.md

Lines changed: 22 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -12,84 +12,37 @@
1212
<img alt="smithy-logo-light-mode" src="assets/smithy-logo-dark.svg#gh-light-mode-only"/>
1313
</p>
1414

15-
By [Smithy](https://smithy.security/)
16-
Security scanning,results unification and enrichment tool
17-
([ASOC](https://www.gartner.com/reviews/market/application-security-orchestration-and-correlation-asoc-tools))
15+
Smithy is a workflow engine for security tooling powered by [smithy.security](https://smithy.security/)
16+
that automates security teams' frameworks built on top of [Open Cybersecurity Schema Framework](https://github.com/ocsf).
1817

19-
Security pipelines on Kubernetes. The purpose of this project is to provide a
20-
scalable and flexible framework to execute arbitrary security scanning
21-
tools on code and infrastructure while processing the results in a versatile
22-
way.
18+
## Links
2319

24-
```mermaid
25-
flowchart LR
26-
S["Code Setup & Build"]
27-
28-
P_GoSec["Producer - GoSec (Golang)"]
29-
P_SecBugs["Producer - SpotBugs (Java)"]
30-
P_Bandit["Producer - Bandit (Python)"]
31-
P_TFSec["Producer - TFSec (Terraform)"]
32-
33-
P_Aggregator["Producer - Results Aggregation"]
34-
35-
E_Deduplication["Enricher - Deduplication"]
36-
E_Policy["Enricher - Policy"]
37-
E_Aggregator["Enricher - Enriched Results Aggregator"]
38-
39-
C_Slack["Consumer - Slack"]
40-
C_Elasticsearch["Consumer - Elasticsearch"]
41-
C_Jira["Consumer - Jira"]
42-
43-
S-->P_TFSec
44-
S-->P_GoSec
45-
S-->P_SecBugs
46-
S-->P_Bandit
47-
48-
P_TFSec-->P_Aggregator
49-
P_GoSec-->P_Aggregator
50-
P_SecBugs-->P_Aggregator
51-
P_Bandit-->P_Aggregator
52-
53-
P_Aggregator-->E_Deduplication
54-
P_Aggregator-->E_Policy
55-
56-
E_Policy-->E_Aggregator
57-
E_Deduplication-->E_Aggregator
58-
59-
E_Aggregator-->C_Slack
60-
E_Aggregator-->C_Elasticsearch
61-
E_Aggregator-->C_Jira
62-
63-
64-
```
20+
* [Architecture](./docs/architecture/README.md): understand how Smithy works
21+
* [SDK](./sdk): build your custom security tooling on top of Smithy. [Example](https://github.com/smithy-security/smithy/pull/749).
22+
* [Smithyctl](./smithyctl): CLI to build and execute workflows
23+
* [Blog](https://smithy.security/blog/)
24+
* Smithy at AppSecDublin: [slides](docs/presentations/Global_AppSecDublin_Presentation.pdf) and [video](https://www.youtube.com/watch?app=desktop\&list=PLpr-xdpM8wG8479ud_l4W93WU5MP2bg78\&v=i9j7n0WDBO0\&feature=youtu.be)
25+
* Smithy at State Of Open Conf UK 2025: [slides](docs/presentations/SOOCon25.pdf) and [video](https://www.youtube.com/watch?v=SZR_Ll9dYWA)
6526

6627
## Getting Started
6728

68-
The [Getting Started](docs/getting-started.md) tutorial explains
69-
how to get started with Smithy.
70-
You can also access our community contributed pipelines
71-
[here](https://github.com/smithy-security/smithy-community-pipelines).
29+
### Prerequisites
7230

73-
## Announcements
31+
* [Go](https://go.dev/doc/install)
32+
* [Docker](https://docs.docker.com/engine/install/)
33+
* Install Smithy with `go install github.com/smithy-security/smithy/smithyctl@latest`
7434

75-
This version of Smithy was announced at OWASP Appsec Dublin in 2023. Check out
76-
[the slides](docs/presentations/Global_AppSecDublin_Presentation.pdf) and
77-
[the video](https://www.youtube.com/watch?app=desktop\&list=PLpr-xdpM8wG8479ud_l4W93WU5MP2bg78\&v=i9j7n0WDBO0\&feature=youtu.be)
78-
of the presentation.
35+
### Execute a workflow
7936

80-
## Support
37+
Clone this repository `git clone https://github.com/smithy-security/smithy.git` and run the
38+
following command from within it:
8139

82-
If you have questions, reach out to us by opening a new
83-
[issue](https://github.com/smithy-security/smithy/issues/new) on GitHub.
84-
85-
You can also get support on our [Discord server](https://discord.gg/xzsHxUxK).
86-
87-
## Development & Contributing
40+
```shell
41+
smithyctl workflow run --spec-path=examples/golang/workflow.yaml --build-component-images=true
42+
```
8843

89-
Contributions are welcome, see the [developing](docs/contributers/DEVELOPING.md)
90-
and [releasing](docs/contributers/RELEASES.md) guides on how to get started.
44+
Check the findings in the logs.
9145

92-
## License
46+
## Contacts
9347

94-
Smithy is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for
95-
details.
48+
Join our [Discord server](https://discord.gg/xzsHxUxK) to get support and ask questions.

assets/example-workflow.png

382 KB
Loading

docs/architecture/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Architecture
2+
3+
Smithy is a workflow engine for security tooling powered by [smithy.security](https://smithy.security/)
4+
that automates security teams' frameworks built on top of [Open Cybersecurity Schema Framework](https://github.com/ocsf).
5+
6+
Smithy organises workflows in components.
7+
8+
## Workflows and Components
9+
10+
Workflows are a set of two or more components. Each component wraps a different security tool or
11+
contains some business logic, for example parsing a scanner's output.
12+
13+
Components can be of different types:
14+
15+
* `targets`: prepare a target to be scanner - for example cloning a repository
16+
* `scanners`: scan a target with a specific tool - for example [gosec](https://github.com/securego/gosec) and produce
17+
findings in [OCSF](https://github.com/ocsf) format.
18+
* `enrichers`: enrich findings with extra information - for example reachability tags.
19+
* `filters`: filter out findings based on some criteria - for example exclude unreachable findings
20+
from being reported.
21+
* `reporters`: report the findings into some destination - for example [JIRA](https://www.atlassian.com/software/jira).
22+
23+
A workflow can contain one or many different components of the same type.
24+
25+
## Execution
26+
27+
Workflows are executed in instances in the following order: *targets > scanners > enrichers > filters > reporters*.
28+
29+
Here you can see an example workflow:
30+
31+
![example-workflow](../../assets/example-workflow.png)
32+
33+
Findings are persisted in an underlying database (locally [SQLite](https://www.sqlite.org/)) in OCSF JSON format. This format is used by each
34+
Smithy's component to do their job.
35+
36+
The components are containerised and can be orchestrated on any platform.
37+
Locally we use [Docker](https://www.docker.com/).

smithyctl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ smithyctl version
3333
### Component
3434

3535
* [packaging](./docs/component/PACKAGING.md): distributes a component specified in a [component.yaml](./docs/component/SPEC.md)
36-
* `build`: allows to build component images. Not yet implemented.
36+
* [build](./docs/component/BUILD.md): allows to build component images.
3737

3838
### Workflow
3939

smithyctl/docs/component/BUILD.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build
2+
3+
Packaging allows the components' images to be built and pushed to a container registry.
4+
5+
```shell
6+
smithyctl component build
7+
```
8+
9+
## Flags
10+
11+
| Flag | Description | Default |
12+
|------------------------|---------------------------------------------------------------------------------|---------------------------|
13+
| `registry` | registry to use for the images | ghcr.io |
14+
| `namespace` | namespace that will be added to all the images built by the system | smithy-security/smithy |
15+
| `base-component-dockerfile` | base Dockerfile to use to build all the images | new-components/Dockerfile |
16+
| `registry-auth-username` | username to authenticate with for the image registry | - |
17+
| `registry-auth-password` | password to authenticate with for the image registry | - |
18+
| `label` | labels to be added to the image | - |
19+
| `push` | push images once they are built | false |
20+
| `platform` | build an image for a platform other than one where the Docker server is running | |
21+
| `tag` | tags to use for images, can be multiple | latest |
22+
23+
## Example
24+
25+
### Local registry - docker
26+
27+
```shell
28+
smithyctl \
29+
component \
30+
build \
31+
path/to/component.yaml
32+
```

smithyctl/docs/component/SPEC.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,12 @@ Steps allow to define what the component has to execute. At least one step has t
5959
| `name` | is the name of the step | `yes` |
6060
| `image` | is the image of the step to be executed | `yes` |
6161
| `env_vars` | defines optional environment variables of the step | `no` |
62+
63+
### Extra Template Functions
64+
65+
We have registered some custom go-template functions so that we can extend components with more out-of-the-box capabilities.
66+
67+
| Function | Description |
68+
|-----------------------|--------------------------------------------------------------------------------|
69+
| `scratchWorkspace` | directory that can be used by components to share resources between each other |
70+
| `sourceCodeWorkspace` | directory which contains the source code, if that was the target type |

smithyctl/docs/workflow/RUN.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,20 @@ smithyctl workflow run
2020

2121
## Flags
2222

23-
| Flag | Description | Default |
24-
|----------------------------|-------------------------------------------------------------|--------------------------------------------|
25-
| `spec-path` | is the path to the component's `workflow.yaml` file. | - |
26-
| `registry-url` | the base URL of the OCI registry | `localhost:5000` |
27-
| `registry-auth-enabled` | enables authentication to push artifact to an OCI registry. | `false` |
28-
| `registry-auth-username` | the username for authenticating to the OCI registry. | `""` |
29-
| `registry-auth-password` | the password for authenticating to the OCI registry. | `""` |
30-
| `registry-base-repository` | where to upload packaged manifests to | `smithy-security/manifests/components` |
23+
| Flag | Description | Default |
24+
|----------------------------|----------------------------------------------------------------|----------------------------------------|
25+
| `spec-path` | is the path to the component's `workflow.yaml` file. | - |
26+
| `overrides-path` | is the path to workflow overrides. | - |
27+
| `registry-url` | the base URL of the OCI registry | `localhost:5000` |
28+
| `registry-auth-enabled` | enables authentication to push artifact to an OCI registry. | `false` |
29+
| `registry-auth-username` | the username for authenticating to the OCI registry. | `""` |
30+
| `registry-auth-password` | the password for authenticating to the OCI registry. | `""` |
31+
| `registry-base-repository` | where to upload packaged manifests to | `smithy-security/manifests/components` |
32+
| `clean-run` | if 'true' the findings db will be emptied out | `false` |
33+
| `build-component-images` | if 'true' components' images will be automatically built on run | `true` |
34+
| `image-registry` | registry to use for the images | local |
35+
| `image-namespace` | namespace that will be added to all the images built by the system | smithy-security/smithy |
36+
| `base-component-dockerfile` | base Dockerfile to use to build all the images | new-components/Dockerfile |
3137

3238
## Example
3339

@@ -51,5 +57,5 @@ smithyctl \
5157
workflow \
5258
run \
5359
--spec-path=path/to/workflow.yaml \
54-
--registry-url=127.0.0.1
60+
--build-component-images=true
5561
```

smithyctl/docs/workflow/SPEC.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ A workflow specification allows to configure a workflow.
77
An example `workflow.yaml` looks like:
88

99
```yaml
10-
description: "Example pipeline"
11-
name: "example-pipeline"
10+
description: GoSec based workflow
11+
name: gosec
1212
components:
13-
- component: "ghcr.io/smithy-security/manifests/components/target/git-clone:v1.0.0"
14-
- component: "ghcr.io/smithy-security/manifests/components/scanner/gosec-parser:v1.0.0"
15-
- component: "file://new-components/enrichers/custom-annotation/component.yaml"
16-
- component: "ghcr.io/smithy-security/manifests/components/reporter/json-logger:v1.0.0"
13+
- component: file://new-components/targets/git-clone/component.yaml
14+
- component: file://new-components/scanners/gosec/component.yaml
15+
- component: file://new-components/enrichers/custom-annotation/component.yaml
16+
- component: file://new-components/reporters/json-logger/component.yaml
1717
```
1818
1919
Component references can be:
@@ -32,9 +32,6 @@ git-clone:
3232
- name: "repo_url"
3333
type: "string"
3434
value: "https://github.com/0c34/govwa.git"
35-
- name: "repo_name"
36-
type: "string"
37-
value: "govwa"
3835
gosec-parser:
3936
- name: "repo_name"
4037
type: "string"

0 commit comments

Comments
 (0)