common

package
v0.0.0-...-3934c66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForCloakCert

func CheckForCloakCert() (string, string, error)

CheckForCloakCert is a function to check if certificate file is present if not create one

func DecodeCert

func DecodeCert() string

DecodeCert idk why it is needed will be removed

Types

type Config

type Config struct {
	Cloakboard bool        `json:"cloakboard"`
	Executors  []Executor  `json:"executors"`
	Connector  DBConnector `json:"connector"`
	PickTime   string      `json:"pick_time"`
}

Config is the global configuration struct for configuring the cloak server

func (*Config) Groom

func (c *Config) Groom()

Groom does some checks for the values which are not mandatory like port of executors or db connector user and passwords reason is because they can be replaced by their default values

func (*Config) Validate

func (c *Config) Validate() bool

Validate checks if all the options are correctly configured and this can also be done by doing

cloak test

type DBConnector

type DBConnector struct {
	Stratergy Stratergy `json:"stratergy"`
	DBName    string    `json:"db"`
	Address   string    `json:"addr"`
	Username  string    `json:"user"`
	Password  string    `json:"pwd"`
}

DBConnector is a connector definition

type Executor

type Executor struct {
	Name    string `json:"name"`
	Address string `json:"addr"`
}

Executor is the executor child running on node

type ExecutorFile

type ExecutorFile struct {
	Tasks []Task `json:"tasks"`
}

ExecutorFile is executor file that has the tasks and it's CTF

type Stratergy

type Stratergy string

Stratergy that mentiones the type of connector that you want cloak to use

const (
	// Local stratergy just saves every tasks inside BoltDB
	Local Stratergy = "local"
	// PSQL saves tasks into postgreSQL database
	PSQL Stratergy = "plsql"
)

type Task

type Task struct {
	ExecutorName string `json:"executorName"`
	Context      string `json:"context"`
	Ctf          string `json:"ctf"`
	Command      string `json:"cmd"`
}

Task defines a basic contruct for a cloak task

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL