Skip to content

Commit

Permalink
Merge pull request #4 from yeti-platform/minikube
Browse files Browse the repository at this point in the history
Tweaks
  • Loading branch information
tomchop authored Jul 1, 2024
2 parents 318e680 + 2addb73 commit cbe1f73
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 28 deletions.
2 changes: 1 addition & 1 deletion content/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ docker compose run --rm api create-user USERNAME PASSWORD --admin

### 3. Open the Yeti web UI

Head to http://localhost:80/ and log in with the credentials you just created.
Head to [http://localhost:80/](http://localhost:80/) and log in with the credentials you just created.

{{% /steps %}}
93 changes: 67 additions & 26 deletions content/guides/indicators-timesketch/infrastructure-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,61 @@ Yeti offers two installation methods: [Kubernetes](#k8s-installation) (K8s) or
[Docker](#docker-installation) (through `docker-compose`). Choose your preferred
method and follow the instructions in this guide.

## K8s Installation
## Using Kubernetes / minikube

Kubernetes (k8s) / minikube will get you started in no time, thanks to the OSDFIR
Helm chart (you can read more about it
[here](https://osdfir.blogspot.com/2024/04/welcoming-yeti-to-osdfir-infrastructure.html)).
If you are new to Kubernetes, consider reviewing the OSDFIR Infrastructure
[getting started guide](https://github.com/google/osdfir-infrastructure/blob/main/docs/getting-started.md).



### Prerequisites

{{< tabs items="macOS,Windows" >}}

{{< tab >}}

Use Homebrew:

```bash
brew install helm minikube kubectl
```

{{< /tab >}}

{{< tab >}}

Use Chocolatey:

```bash
choco install minikube
```

{{< /tab >}}

{{< /tabs >}}



To get started, ensure you have [Helm](https://helm.sh/docs/intro/install/) and
[Kubectl](https://kubernetes.io/docs/tasks/tools/) installed and are
authenticated to your Kubernetes cluster.

{{< callout type="info" >}}

**Note**: If you don't have a remote k8s setup, you can still use this

**Note**: If you don't have a remote k8s setup, you can still use
[Minikube](https://minikube.sigs.k8s.io/docs/start/) or
[KIND](https://kind.sigs.k8s.io/docs/user/quick-start/) to install Yeti and
Timesketch locally.
For minikube, you might need to run:
```bash
kubectl config use-context minikube
```
{{< /callout >}}
### Pull chart and install release
Expand All @@ -44,7 +81,7 @@ If you had already added this repo earlier, run `helm repo update` to retrieve
the latest versions of the packages. You can then run
`helm search repo osdfir-charts` to see the available charts.
To install the Yeti and Timesketch chart, pick a release name of your chose, for
To install the Yeti and Timesketch chart, pick a release name of your choice, for
example, using a release name of `my-release`, run the following:
```console
Expand Down Expand Up @@ -79,8 +116,7 @@ You're now ready to start your investigation with Timesketch and Yeti. Head to
[the investigation steps](/guides/indicators-timesketch/investigation) to follow
the rest of the guide.
## Docker Installation

## Using Docker and `docker compose`
- You'll be running two set of docker compose "projects". One for Yeti, and one
for Timesketch;
- You'll connect the Timesketch and Yeti containers to the same network;
Expand Down Expand Up @@ -176,28 +212,31 @@ timesketch-dev | Timesketch development server is ready!
Then open two terminals (it's a good idea to use tmux or something similar), and
run the following commands:

Shell 1:

*Shell 1:*
```console
cd timesketch/docker/dev
docker compose -p timesketch exec timesketch gunicorn --reload -b 0.0.0.0:5000 --log-file - --timeout 120 timesketch.wsgi:application
```

Shell 2:
This will start the Timesketch web server.

*Shell 2:*

```console
cd timesketch/docker/dev
docker compose -p timesketch exec timesketch celery -A timesketch.lib.tasks.celery worker --loglevel=info
```

This will start the Timesketch Celery workers, which are used to import plaso files and run analyzers.

Open [http://localhost:5000](http://localhost:5000) or
[http://127.0.0.1:5000](http://127.0.0.1:5000) and login with dev / dev
[http://127.0.0.1:5000](http://127.0.0.1:5000) and login with `dev` / `dev`

### Connecting Yeti and Timesketch

#### Docker network connectivity

List networks
List networks in your Docker environment:

```console
$ docker network ls
Expand All @@ -213,7 +252,9 @@ d5c1f8727703 timesketch_default bridge local
project. The network name prefix was specified in the `-p` flag when running
the `docker compose up` command.
- `yeti_network` → Docker compose network for Yeti. The name of the network was
specified in the Yeti docker-compose.yaml file.
specified in the Yeti `docker-compose.yaml` file.

Inspect the Yeti network:

```console
docker network inspect yeti_network
Expand Down Expand Up @@ -241,21 +282,21 @@ This section should be somewhere in the output of the above command:
}
```

Connect the `yeti-tasks` and `yeti-frontend` to `timesketch_default` (the Timesketch
network). We need this so that:
Connect the `yeti-tasks` and `yeti-frontend` to `timesketch_default` (the
Timesketch network). We need this so that:

- The timesketch server can query the Yeti API server (running on
`yeti-frontend`)
- The Timesketch server can query the Yeti API server (running on
`yeti-frontend`);
- The Yeti task service (running on `yeti-tasks`) can feed off the Timesketch
API
API.

```console
docker network connect timesketch_default yeti-tasks
docker network connect timesketch_default yeti-frontend
```

You should see these two containers in the result of
`docker network inspect timesketch_default`
`docker network inspect timesketch_default`.

{{< callout type="info" >}}

Expand All @@ -277,12 +318,18 @@ name (e.g. `yeti-frontend`, what you see in the result of `docker ps -a`) or by

{{< /callout >}}

### Getting GRR set up (optional)
### That's it!

You're now ready to start your investigation with Timesketch and Yeti. Head to
[the investigation steps](/guides/indicators-timesketch/investigation) to follow
the rest of the guide.

## Getting GRR set up (optional)

Good docs at
[https://grr-doc.readthedocs.io/en/latest/installing-grr-server/via-docker.html](https://grr-doc.readthedocs.io/en/latest/installing-grr-server/via-docker.html)

#### Installing the GRR server
### Installing the GRR server

```console
docker run \
Expand All @@ -295,7 +342,7 @@ docker run \

Wait a few minutes, and you should be good to go (this takes a while)

#### Installing GRR clients
### Installing GRR clients

You can either install GRR clients on the docker container itself, or any host
you want, provided that they can reach the server through the
Expand Down Expand Up @@ -345,12 +392,6 @@ Then connect the `grr-server` to the rest of your network:
docker network connect dev_default grr-server
```

### That's it!

You're now ready to start your investigation with Timesketch and Yeti. Head to
[the investigation steps](/guides/indicators-timesketch/investigation) to follow
the rest of the guide.

## Troubleshooting

### `Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:5001 -> 0.0.0.0:0: listen tcp 127.0.0.1:5001: bind: address already in use`
Expand Down
2 changes: 1 addition & 1 deletion hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ menu:
- name: More
params:
type: separator
weight: 1x
weight: 1
- name: "Yeti on GitHub ↗"
url: "https://github.com/yeti-platform/yeti"
weight: 2
Expand Down

0 comments on commit cbe1f73

Please sign in to comment.