system

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MPL-2.0, MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HoldDecryptShard [][]byte

HoldDecryptShard hods state of encryption key retreival during shamir deduce function

View Source
var Store adapter

Store is the package state variable which contains database connections

Functions

func DecryptKey

func DecryptKey(w http.ResponseWriter, r *http.Request)

DecryptKey retrieves token from vaultDecrypt function and store it in vaultEncryption Token. This is only available option for tsxtsxvault. TODO @sshahcodes compose this handler to smaller functions

func EncryptAndStoreKeyOrToken

func EncryptAndStoreKeyOrToken(req models.KeysHolder) ([]byte, error)

EncryptAndStoreKeyOrToken is helper function which encrypts key or token and store it in database.

func Getkey

func Getkey(w http.ResponseWriter, r *http.Request)

Getkey retrieves key or token from database. should fetch and return key tag rather than key value.

func GlobalSettings

func GlobalSettings(w http.ResponseWriter, r *http.Request)

GlobalSettings returns all global settings

func InitStore

func InitStore(state *global.State)

InitStore initialises package state

func InitStoreMock

func InitStoreMock() *systemMock

InitStoreMock will init mock state of this package

func ReInit

func ReInit(w http.ResponseWriter, r *http.Request)

ReInit purpose is to delete exisiting vault configs and instances from database. Clients should immediately send another request to vault init when this handler returns success response.

func SecurityRules

func SecurityRules(w http.ResponseWriter, r *http.Request)

SecurityRules retrieves orgWide security rules

func Status

func Status(w http.ResponseWriter, r *http.Request)

Status returns vault's current status.

func StoreCloudProxyKey

func StoreCloudProxyKey(w http.ResponseWriter, r *http.Request)

StoreCloudProxyKey handles signed TRASA cloud proxy access key storage.

func StoreKey

func StoreKey(w http.ResponseWriter, r *http.Request)

StoreKey stores keys in database. Keys should be encrypted and tag value must be generated. Before storing key, check if the key is valid and working.

func SystemStatus

func SystemStatus(w http.ResponseWriter, r *http.Request)

SystemStatus returns information about system TRASA is running on.

func TsxvaultInit

func TsxvaultInit(w http.ResponseWriter, r *http.Request)

TsxvaultInit initializes TRASA built in secure storage. master key for encryption is Shamir'ed into 5 keys with minimum 3 keys threshold and responded back to administrator.

func UpdateDeviceHygieneSetting

func UpdateDeviceHygieneSetting(w http.ResponseWriter, r *http.Request)

UpdateDeviceHygieneSetting updates device hygiene enforce settings

func UpdateDynamicAccessSetting

func UpdateDynamicAccessSetting(w http.ResponseWriter, r *http.Request)

UpdateDynamicAccessSetting updates dynamic access settings

func UpdateEmailSetting

func UpdateEmailSetting(w http.ResponseWriter, r *http.Request)

UpdateEmailSetting updates email settings

func UpdatePasswordPolicy

func UpdatePasswordPolicy(w http.ResponseWriter, r *http.Request)

UpdatePasswordPolicy updates password policy in global settings

func UpdateSecurityRule

func UpdateSecurityRule(w http.ResponseWriter, r *http.Request)

UpdateSecurityRule updates system security rules

Types

type GlobalSettingsResp

type GlobalSettingsResp struct {
	DynamicAccess  models.GlobalSettings `json:"dynamicAccess"`
	PasswordPolicy models.GlobalSettings `json:"passPolicy"`
	EmailSettings  models.GlobalSettings `json:"emailSettings"`
	DeviceHygiene  models.GlobalSettings `json:"deviceHygiene"`
}

type SysStatus

type SysStatus struct {
	HostStat *host.InfoStat         `json:"hostStatus"`
	MemStat  *mem.VirtualMemoryStat `json:"memStatus"`
	DiskStat *disk.UsageStat        `json:"diskStatus"`
	CPUStat  cpustat                `json:"cpuStat"`
}

type UpdateSecurityRulesReq

type UpdateSecurityRulesReq struct {
	Status string `json:"status"`
	RuleID string `json:"ruleID"`
}

type VaultInit

type VaultInit struct {
	SecretShares    int `json:"secretShares"`
	SecretThreshold int `json:"secretThreshold"`
}

type VaultInitResp

type VaultInitResp struct {
	UnsealKeys   []string `json:"unsealKeys"`
	DecryptKeys  []string `json:"decryptKeys"`
	EncRootToken string   `json:"encRootToken"`
	Tsxvault     bool     `json:"tsxvault"`
}

type VaultStatus

type VaultStatus struct {
	InitStatus  models.GlobalSettings              `json:"initStatus"`
	SealStatus  *hashicorpVault.SealStatusResponse `json:"sealStatus"`
	TokenStatus hashicorpVault.SealStatusResponse  `json:"tokenStatus"`
	// TsxVault is TRASA's built in tsxvault. if false, caller should assume hashicorp vault is used instead.
	Tsxvault bool   `json:"tsxvault"`
	Setting  string `json:"setting"`
}

Jump to

Keyboard shortcuts

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