Skip to content

Commit

Permalink
add steps component to guides
Browse files Browse the repository at this point in the history
  • Loading branch information
markusleh committed Mar 8, 2024
1 parent 06f15e6 commit 6707aa0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
18 changes: 11 additions & 7 deletions pages/docs/deployment.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tab, Tabs } from "nextra-theme-docs"
import { Card, Cards, FileTree } from 'nextra/components'
import { Card, Cards, FileTree, Steps } from 'nextra/components'
import {Cog, Lock, RefreshCcw} from 'lucide-react'
import { Callout } from 'nextra/components'

Expand All @@ -18,23 +18,25 @@ import { Callout } from 'nextra/components'

## Deployment

1. Clone the deployment repo
<Steps>

### Clone the deployment repo
This git repo contains the `docker-compose.yml` file as well as other deployment-only related files.

```shell copy
git clone https://github.com/webhood-io/webhood.git --depth=1 --branch=main
cd webhood
```

2. Copy the example `.env` file in the root directory of the project:
### Copy the example `.env` file in the root directory of the project:

```shell copy
cp .env.example .env
```

Next, we configure the only required variable `SCANNER_TOKEN`. Other variables are optional and can be set later as documented [here](reference/configuration).

3. Create a service token for the scanner
### Create a authentication token for the scanner

<Tabs items={["docker", "docker-compose"]}>
<Tab>
Expand All @@ -57,7 +59,7 @@ Next, we configure the only required variable `SCANNER_TOKEN`. Other variables a

Save this into your `.env` as `SCANNER_TOKEN`

4. Run `docker compose up -d` to start the application
### Run `docker compose up -d` to start the application

<Tabs items={["docker", "docker-compose"]}>
<Tab>
Expand All @@ -72,7 +74,7 @@ Save this into your `.env` as `SCANNER_TOKEN`
</Tab>
</Tabs>

5. Create a user
### Create a user

<Tabs items={["docker", "docker-compose"]}>
<Tab>
Expand All @@ -89,10 +91,12 @@ Save this into your `.env` as `SCANNER_TOKEN`
</Tab>
</Tabs>

7. Start using it
### Start using it

Navigate to [`https://localhost:8443`](https://localhost:8443) and login with the account you created in step `6`

</Steps>

## Known issues

### Invalid interpolation format for "environment" option...
Expand Down
33 changes: 19 additions & 14 deletions pages/docs/guides/add_scanner.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tab, Tabs } from "nextra-theme-docs"
import { Callout } from 'nextra/components'
import { Callout, Steps } from 'nextra/components'

# Add a scanner

Expand All @@ -17,11 +17,12 @@ This guide will show you how to add a scanner to connect to your console. Scanne
- docker-compose
- Connectivity from the scanner to the console. If you are running the scanner on a different network, you will need to open the console port to the scanner network. Default port for the console is `8000` if using the deployment guide.

## Steps
# Steps

### In the console
## In the console

1. Run command to create the scanner
<Steps>
### Run command to create the scanner

These commands assume you have deployed the console using the [docker-compose.yml](https://github.com/webhood-io/webhood/blob/main/docker-compose.yml).

Expand All @@ -47,10 +48,12 @@ This returns
```shell
SCANNER_TOKEN=ey....
```
</Steps>

### In the scanner host
## In the scanner host

1. Create a `.env` file with the scanner token
<Steps>
### Create a `.env` file with the scanner token

```shell copy
SCANNER_TOKEN=ey....
Expand All @@ -59,15 +62,15 @@ ENDPOINT=http://console-address:8000

Where `http://console-address:8000` is the address of the console. If you are running the console on a different port or network, you will need to change the `ENDPOINT` variable.

2. Download the [seccomp](https://en.wikipedia.org/wiki/Seccomp) profile for the scanner
### Download the [seccomp](https://en.wikipedia.org/wiki/Seccomp) profile for the scanner

```shell copy
curl -o chrome.json https://raw.githubusercontent.com/webhood-io/webhood/main/files/chrome.json
```

<Tabs items={["docker compose", "docker-compose", "docker"]}>
<Tab>
3. Create a `docker-compose.yml` file with the scanner configuration
### Create a `docker-compose.yml` file with the scanner configuration

```yaml copy
services:
Expand All @@ -83,22 +86,22 @@ services:
# This allows us to run chrome with sandboxing enabled without having to run the whole container as root
- seccomp=./chrome.json
```
4. Run the scanner and check for any errors
### Run the scanner and check for any errors
```shell copy
docker compose up
```

It is a good idea to now initiate some scans in the console to see if the scanner is working correctly.

5. If no errors, you can start the scanner as a daemon
### If no errors, you can start the scanner as a daemon

```shell copy
docker compose up -d
```
</Tab>
<Tab>
3. Create a `docker-compose.yml` file with the scanner configuration
### Create a `docker-compose.yml` file with the scanner configuration

```yaml copy
services:
Expand All @@ -114,22 +117,22 @@ services:
# This allows us to run chrome with sandboxing enabled without having to run the whole container as root
- seccomp=./chrome.json
```
4. Run the scanner and check for any errors
### Run the scanner and check for any errors
```shell copy
docker-compose up
```

It is a good idea to now initiate some scans in the console to see if the scanner is working correctly.

5. If no errors, you can start the scanner as a daemon
### If no errors, you can start the scanner as a daemon

```shell copy
docker-compose up -d
```
</Tab>
<Tab>
3. Start the scanner
### Start the scanner

```shell copy
# docker run equivalent of the docker-compose.yml
Expand All @@ -143,6 +146,8 @@ It is a good idea to now initiate some scans in the console to see if the scanne
</Tab>
</Tabs>

</Steps>

## Additional configuration

### Additional scanners
Expand Down

0 comments on commit 6707aa0

Please sign in to comment.