Skip to content

Commit f8a6c7b

Browse files
authored
Merge pull request #276 from sdslabs/docs-update-backup
Docs update
2 parents acba143 + ea95ffb commit f8a6c7b

File tree

671 files changed

+119306
-102093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

671 files changed

+119306
-102093
lines changed

README.md

Lines changed: 69 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,54 @@
11
# Beast
22

3-
> Beast is an automatic deployment and management tool for CTF challenges hosted on backdoor.sdslabs.co
3+
![Beast Logo](./docs/res/beast-logo.png)
44

5-
[![Netlify Status](https://api.netlify.com/api/v1/badges/bea0e0b4-30e1-4830-ba98-e484b51e4036/deploy-status)](https://app.netlify.com/sites/beast-docs-sdslabs/deploys) [![Build Status](https://dev.azure.com/deepshpathak/deepshpathak/_apis/build/status/sdslabs.beastv4?branchName=master)](https://dev.azure.com/deepshpathak/deepshpathak/_build/latest?definitionId=1&branchName=master) [![Apache License](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/sdslabs/beastv4/blob/master/LICENSE.md)
5+
> Jeopardy-style CTF challenge deployment and management tool.
6+
7+
[![Netlify Status](https://api.netlify.com/api/v1/badges/bea0e0b4-30e1-4830-ba98-e484b51e4036/deploy-status)](https://app.netlify.com/sites/beast-docs-sdslabs/deploys) [![Build Status](https://dev.azure.com/deepshpathak/deepshpathak/_apis/build/status/sdslabs.beastv4?branchName=master)](https://dev.azure.com/deepshpathak/deepshpathak/_build/latest?definitionId=1&branchName=master) [![Apache License](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/sdslabs/beastv4/blob/master/LICENSE.md)
8+
9+
## Overview
10+
11+
Beast is a service that runs on your host(maybe a bare metal server or a cloud instance) and helps manage deployment, lifecycle, and health check of CTF challenges. It can also be used to host Jeopardy-style CTF competition.
12+
13+
## Features
14+
15+
- Git based source of truth.
16+
- Container based isolation
17+
- Easy configuration
18+
- SSH support for challenge instances
19+
- Command line interface to perform actions and host competitions
20+
- REST API interface for the entire ecosystem
21+
- An optional automated health check service to periodically check the status of challenges and report if there is some sort of problem with one.
22+
- Single source of truth for all the static content related to all the challenges making it easy to debug, monitor and manage
23+
static content through a single interface.
24+
- Use of sidecar mechanism for stateful workloads which can be shared by multiple challenges at once, MySQL for example.
25+
- Support for various notification channels like slack, discord.
26+
- Everything embedded to a single go binary which can be easily used anywhere.
27+
28+
For more details on the features, refer to [Features](./docs/Features.md)
29+
30+
## Supported Challenge's Types
31+
32+
As of now beast support the following type of challenges:
33+
34+
- Service - A service hosted on beast container instance
35+
- Web - Web based challenges for various languages including PHP, Python, Node.js etc.
36+
- Static - Challenges with static files, this may include forensics challenges.
37+
- Bare - Highly customisable challenges.
38+
- Docker - Challenges which are provided with their own docker file.
639

740
## Development
841

9-
Beast go version is under development, follow the below instructions to get started.
42+
Beast go version is under development; follow the below instructions to get started.
1043

11-
* Install go 1.11.x
12-
* Make sure that `GO111MODULES` environment variable should be set to `on`, or do `export GO111MODULES=on`
13-
* Clone the repository.
14-
* Jump to `$GOPATH/src/github.com/sdslabs/beastv4/` and start hacking.
44+
- Install go 1.13 or above
45+
- Make sure that `GO111MODULES` environment variable should be set to `on`, or do `export GO111MODULES=on`
46+
- Clone the repository.
47+
- Jump to `$GOPATH/src/github.com/sdslabs/beastv4/` and start hacking.
1548

1649
```bash
1750
$ go version
18-
go version go1.11 linux/amd64
51+
go version go1.13 linux/amd64
1952

2053
$ export GO111MODULES=on
2154

@@ -24,76 +57,29 @@ $ git clone [email protected]:sdslabs/beastv4.git
2457
$ cd beastv4 && make help
2558
BEAST: An automated challenge deployment tool for backdoor
2659

27-
* build: Build beast and copy binary to PATH set for go build binaries.
60+
* build: Build Beast and copy binary to PATH set for go build binaries.
2861
* check_format: Check for formatting errors using gofmt
2962
* format: format the go files using go_fmt in the project directory.
3063
* test: Run tests for beast
31-
* tools: Set up required tools for beast which includes - docker-enter, importenv
64+
* tools: Set up required tools for Beast which includes - docker-enter, importenv
3265
```
3366

34-
**All the dependencies are already vendored with the project so no need to install any dependencies**. The projcet uses go modules from
35-
go 1.11.X fo dependency management. Make sure you vendor any library used using `go mod vendor`
67+
**All the dependencies are already vendored with the project, so no need to install any dependencies**. The project uses go modules from go 1.13.X of dependency management. Make sure you vendor any library used using `go mod vendor`
3668

3769
### Building
3870

39-
To build beast from Source use the Makefile provided.
40-
41-
* `make build`
42-
43-
This will build beast and will place the binary in `$GOPATH/bin/` will also copy the necessery tools to desired place. To build this in production make sure you also have built the static-content docker image in `/extras/static-content`
44-
45-
To run the API server for beast use command `beast run -v`
46-
47-
### Directory Structure
71+
To build Beast from Source use the Makefile provided.
4872

49-
* **api**
50-
* API exposed by beast
51-
* This uses `gin` as rest API framework and routes are grouped under `/api`
52-
* API Docs are served using swagger API specs.
73+
- `make build`
5374

54-
* **scripts**
55-
* Build scripts for beast.
56-
* Other relevent scripts for beast including docker-enter.
75+
This will build Beast and place the binary in `$GOPATH/bin/` and copy the necessery tools to the desired place. To build this in production make sure you also have built the static-content docker image in `/extras/static-content`
5776

58-
* **cmd**
59-
* Package containing command line functionality of beast.
60-
* `commands.go` is the main entrypoint for the package
61-
* This makes use of spf13/cobra for command line flag parsing.
62-
63-
* **core**
64-
* Core functionalities of beast
65-
* It includes package managing challenges.
66-
* Inside package `manager` lives the code relating to all the core functionality that beast provides.
67-
* It also contains database wrapper using gorm for beast.
68-
69-
* **pkg**
70-
* Contains library code which can be used by external applications also.
71-
* **cr**
72-
* **notify**
73-
* **git**
74-
* **scheduler**
75-
* **probes**
76-
* **workerpool**
77-
78-
* **templates**
79-
* Tempaltes used by beast.
80-
* For example - Beast dockerfile template, beast challenge config template etc.
81-
82-
* **utils**
83-
* Beast utility functions package.
84-
85-
* **version**
86-
* Version package for beast.
87-
* Use `beast version`
88-
89-
* **_examples**
90-
* This directory contains example challenges for beast.
91-
* An example beast global root config to be placed in `$HOME/.beast/config.toml`
77+
To run the API server for Beast, use the command `beast run -v`
9278

9379
### Testing
9480

9581
To test use the sample challenges in the `_examples` directory. Use the challenge simple and try to deploy it using
96-
beast. Follow the below instructions.
82+
Beast. Follow the below instructions.
9783

9884
You can find swagger API documentation here: http://localhost:5005/api/docs/index.html
9985

@@ -111,7 +97,7 @@ $ curl -X POST localhost:5005/api/manage/deploy/local/ --data "challenge_dir=<ab
11197
# Or you can directly deploy the challenge using name in the remote
11298
$ curl -X POST --data "action=deploy&name=<challenge_name>" localhost:5005/api/manage/challenge/
11399

114-
# Wait for beast to finish the image build and deployment of the challenge
100+
# Wait for Beast to finish the image build and deployment of the challenge
115101
# This might take some time. Have some snacks ready!
116102
# Try connecting to the deployed service
117103
$ nc localhost 10001
@@ -126,7 +112,7 @@ choice > 4
126112

127113
### Documentation
128114

129-
The documentation for the project lies in [/docs](/docs). We use `mkdocs` to automatically generate documentation from markdown. The configuration file for the same can be found at [mkdocs.yml](/mkdocs.yml). To view the documentation locally create a virtual environment locally and install [requirements](/requirements-dev.txt).
115+
The documentation for the project lies in [/docs](/docs). We use `mkdocs` to automatically generate documentation from markdown. The configuration file for the same can be found at [mkdocs.yml](/mkdocs.yml). To view the documentation locally, create a virtual environment locally and install [requirements](/requirements-dev.txt).
130116

131117
```bash
132118
$ virtualenv venv && source venv/bin/activate
@@ -140,10 +126,25 @@ Serving on http://127.0.0.1:8000
140126

141127
### Development notes
142128

143-
Beast uses `logrus` for logging purposes and follow standard effective go guidelines, so anytime you are writing a code keep in mind to
144-
add necessery logs and documentation. Also format the code before commiting using `gofmt`. Or simply run the make command `make test`
129+
Beast uses `logrus` for logging purposes and follows standard effective go guidelines, so anytime you are writing a code, keep in mind to add necessary logs and documentation. Also, format the code before committing using `gofmt`. Or simply run the make command `make test`
145130

146-
For any API routes you add to the beast API do write Swagger API documentation.
131+
For any API routes, you add to the beast API, do write Swagger API documentation.
147132

148133
The design documentation for the new Beast can be found [here](https://docs.google.com/document/d/1BlRes900aFS2s8jicrSx2W7b1t1FnYZhx70jGQu__HE/edit)
149134

135+
## Contributing
136+
137+
We are always open for contributions. If you find any feature missing, or just want to report a bug, feel free to open an issue and/or submit a pull request regarding the same.
138+
139+
For more information on contribution, check out our
140+
[docs](./docs/contribution.md).
141+
142+
## Contact
143+
144+
If you have a query regarding the product or just want to say hello then feel
145+
free to visit [chat.sdslabs.co](https://chat.sdslabs.co) or drop a mail at
146+
147+
148+
---
149+
150+
Made by [SDSLabs](https://sdslabs.co)

_examples/example.config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# Make sure key.pub is added to the deployed keys of the beast remote repo
1919

2020
# scripts_dir = "/home/vsts/.beast/scripts"
21-
# slack_webhook = ""
2221
available_sidecars = ["mysql"]
2322
jwt_secret = "beast"
2423
allowed_base_images = ["ubuntu:16.04", "php:7.1-cli"]

api/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
// @Tags status
1717
// @Accept json
1818
// @Produce json
19-
// @Param action param "Action to perform (ban/unban)"
20-
// @Param id param "Id of user"
19+
// @Param action query string true "Action to perform ban/unban"
20+
// @Param id query string true "Id of user"
2121
// @Success 200 {object} api.ChallengeStatusResp
2222
// @Failure 400 {object} api.HTTPPlainResp
2323
// @Failure 500 {object} api.HTTPPlainResp

0 commit comments

Comments
 (0)