Documentation ¶
Index ¶
- Variables
- func ShellExec(cmd string, args ...string) ([]byte, error)
- type Action
- type Category
- type Chain
- type CreateRDPConnOpts
- type EnvConfig
- type EnvPool
- func (ep *EnvPool) AddClosingEnv(eventTag string)
- func (ep *EnvPool) AddEnv(env *Environment)
- func (ep *EnvPool) AddStartingEnv(eventTag string)
- func (ep *EnvPool) DoesEnvExist(tag string) bool
- func (ep *EnvPool) GetClosingEnvs() map[string]bool
- func (ep *EnvPool) GetEnv(tag string) (*Environment, error)
- func (ep *EnvPool) GetEnvList() (envList map[string]bool)
- func (ep *EnvPool) GetFullLabCount() uint32
- func (ep *EnvPool) GetLabByTag(tag string) (*lab.Lab, error)
- func (ep *EnvPool) GetStartingEnvs() map[string]bool
- func (ep *EnvPool) LockForFunc(function func())
- func (ep *EnvPool) RemoveClosingEnv(eventTag string)
- func (ep *EnvPool) RemoveEnv(tag string) error
- func (ep *EnvPool) RemoveStartingEnv(eventTag string)
- type Environment
- type Errori
- type ExecFunc
- type GuacError
- type GuacUser
- type GuacUserStore
- type Guacamole
- func (guac *Guacamole) Close() error
- func (guac *Guacamole) CreateRDPConn(opts CreateRDPConnOpts) error
- func (guac *Guacamole) CreateUser(username, password string) error
- func (guac *Guacamole) GetPortFromConnectionIdentifier(connectionIdentifier string) (string, error)
- func (guac *Guacamole) RawLogin(username, password string) ([]byte, error)
- type IPTables
- func (ipTab *IPTables) CreateAcceptRule(labSubnet string, vpnIPs string) error
- func (ipTab *IPTables) CreateRejectRule(labSubnet string) error
- func (ipTab *IPTables) CreateStateRule(labSubnet string) error
- func (ipTab *IPTables) RemoveAcceptRule(labSubnet string, vpnIps string) error
- func (ipTab *IPTables) RemoveRejectRule(labSubnet string) error
- func (ipTab *IPTables) RemoveStateRule(labSubnet string) error
- type IpRules
- type PChallenge
- type PipeFunc
- type Policy
- type Profile
- type Status
Constants ¶
This section is empty.
Variables ¶
var ( VPNPortmin = 5000 VPNPortmax = 6000 )
var ( DefaultAdminUser = "guacadmin" DefaultAdminPass = "guacadmin" )
Functions ¶
Types ¶
type CreateRDPConnOpts ¶
type EnvConfig ¶
type EnvPool ¶
type EnvPool struct { M *sync.RWMutex // Map of environments with eventTag as key Envs map[string]*Environment StartingEnvs map[string]bool ClosingEnvs map[string]bool }
General environment types
func (*EnvPool) AddClosingEnv ¶ added in v1.0.0
func (*EnvPool) AddEnv ¶
func (ep *EnvPool) AddEnv(env *Environment)
func (*EnvPool) AddStartingEnv ¶ added in v1.0.0
func (*EnvPool) DoesEnvExist ¶
func (*EnvPool) GetClosingEnvs ¶ added in v1.0.0
func (*EnvPool) GetEnvList ¶ added in v1.0.0
func (*EnvPool) GetFullLabCount ¶
func (*EnvPool) GetLabByTag ¶
Returns a lab from the env pool if the lab tag exists in any of the environments
func (*EnvPool) GetStartingEnvs ¶ added in v1.0.0
func (*EnvPool) LockForFunc ¶ added in v1.0.0
func (ep *EnvPool) LockForFunc(function func())
func (*EnvPool) RemoveClosingEnv ¶ added in v1.0.0
func (*EnvPool) RemoveStartingEnv ¶ added in v1.0.0
type Environment ¶
type Environment struct { M *sync.RWMutex EnvConfig *EnvConfig Guac Guacamole IpT IPTables IpRules map[string]IpRules IpAddrs [][]int Wg wgproto.WireguardClient GuacUserStore *GuacUserStore Dockerhost virtual.Host Labs map[string]*lab.Lab }
func (*Environment) Close ¶
func (env *Environment) Close() error
Closes environment including removing all related containers, and vpn configs
func (*Environment) CreateGuacConn ¶
func (env *Environment) CreateGuacConn(lab lab.Lab) error
Connects VMs in a lab to the corresponding guacamole instance for the environment.
func (*Environment) RemoveVpnLabPeers ¶
func (env *Environment) RemoveVpnLabPeers(ctx context.Context, labTag string) error
type GuacError ¶
type GuacError struct {
// contains filtered or unexported fields
}
TODO Go through all the code, make sure it makes sense, comment the code
type GuacUserStore ¶
type GuacUserStore struct {
// contains filtered or unexported fields
}
func NewGuacUserStore ¶
func NewGuacUserStore() *GuacUserStore
type Guacamole ¶
type Guacamole struct { Client *http.Client Token string Port uint AdminPass string Containers map[string]*virtual.Container }
Guac types
func (*Guacamole) CreateRDPConn ¶
func (guac *Guacamole) CreateRDPConn(opts CreateRDPConnOpts) error
Creates the Apache Guacamole RDP connection to a specific vm
func (*Guacamole) CreateUser ¶
Creates a new user in Apache guacamole which can access a specific set of VMs
func (*Guacamole) GetPortFromConnectionIdentifier ¶
type IPTables ¶
type IPTables struct { Sudo bool // Flags to service Flags []string // enable Debug or not Debug bool // Implementation of ExecFunc. ExecFunc ExecFunc // Implementation of PipeFunc. PipeFunc PipeFunc }
func (*IPTables) CreateAcceptRule ¶
iptables --insert DOCKER-USER -s 77.179.248.0/24 -d 25.136.240.250/32,25.136.241.249/32,25.136.242.248/32,25.136.243.247/32,77.179.248.0/24 -j ACCEPT
func (*IPTables) CreateRejectRule ¶
iptables --insert DOCKER-USER -s 77.179.248.0/24 -j REJECT --reject-with icmp-port-unreachable
func (*IPTables) CreateStateRule ¶
sudo iptables --insert DOCKER-USER -s 77.218.127.0/24 -m state --state RELATED,ESTABLISHED -j RETURN
func (*IPTables) RemoveAcceptRule ¶
func (*IPTables) RemoveRejectRule ¶
func (*IPTables) RemoveStateRule ¶
type PChallenge ¶
type Profile ¶
type Profile struct { Name string `json:"name,omitempty"` Secret bool `json:"secret,omitempty"` Challenges []PChallenge `json:"challenges,omitempty"` }