Documentation ¶
Index ¶
- Constants
- func DecryptCbc(aes cipher.Block, encrypted []byte, iv []byte) (string, error)
- func DecryptGcm(aes cipher.Block, encrypted []byte, nonce []byte, tagSize int) (string, error)
- func KeyFilePath(keyType string) (string, error)
- func ToJson(object interface{}) ([]byte, error)
- type Admission
- type AesCrypto
- func (c AesCrypto) Decrypt(cipherText string, key []byte) (string, error)
- func (c AesCrypto) Encrypt(plainText string, key []byte) (string, error)
- func (c AesCrypto) EncryptCbc(aes cipher.Block, plainText string) (string, error)
- func (c AesCrypto) EncryptGcm(aes cipher.Block, plainText string) (string, error)
- func (c AesCrypto) PackCipherData(cipherText []byte, iv []byte, tagSize int) string
- func (c AesCrypto) UnpackCipherData(data []byte) ([]byte, []byte, int)
- type Area
- type CipherMode
- type Cmd
- type CmdInfo
- type Cve
- type CvePackage
- type CveReport
- type CveRequest
- type Dictionary
- type Event
- type EventReceiver
- type EventReceivers
- type Events
- type Host
- type HostInfo
- type Job
- type JobBatch
- type JobBatchInfo
- type JobResult
- type Location
- type Org
- type PGP
- type PackageInfo
- type Padding
- type PingRequest
- type PingResponse
- type PingResponseEnvelope
- type Registration
- type RegistrationRequest
- type RegistrationResponse
- type TagInfo
Constants ¶
const AesIvSize = 16
Variables ¶
This section is empty.
Functions ¶
func DecryptGcm ¶
func KeyFilePath ¶
KeyFilePath return the path to the file where the relevant PGP key is keyType is either verify (public) or sign (private) PGP key
Types ¶
type Admission ¶
type Admission struct { HostUUID string `json:"host_uuid"` OrgGroup string `json:"org_group"` Org string `json:"org"` Area string `json:"area"` Location string `json:"location"` Label []string `json:"label"` }
Admission an admission request
type AesCrypto ¶
type AesCrypto struct { CipherMode CipherMode Padding Padding }
func (AesCrypto) EncryptCbc ¶
func (AesCrypto) EncryptGcm ¶
func (AesCrypto) PackCipherData ¶
type Area ¶
type Area struct { Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` }
Area host area within a Location
type Cmd ¶
type Cmd struct { // the natural key uniquely identifying the command Key string `json:"key"` // description of the command Description string `json:"description"` // the package to use Package string `json:"package"` // the function in the package to call Function string `json:"function"` // the function input information Input *data.Input `json:"input"` // the package registry user User string `json:"user"` // the package registry password Pwd string `json:"pwd"` // enables verbose output Verbose bool `json:"verbose"` // run command in runtime Containerised bool `json:"containerised"` }
Cmd command information for remote host execution
type CmdInfo ¶
type CmdInfo struct { JobId int64 `json:"job_id"` Package string `json:"package"` Function string `json:"function"` User string `json:"user"` Pwd string `json:"pwd"` Verbose bool `json:"verbose"` Containerised bool `json:"containerised"` Input *data.Input `json:"input,omitempty"` }
CmdInfo all the information required by pilot to execute a command
type Cve ¶
type Cve struct { Id string Family string Platform string Summary string AffectedPackages []models.PackageFixStatus CVSSScore float64 CVSSType string CVSSVector string CVSSSeverity string Mitigations []string PrimarySrc []string PatchURLs []string CPE []string Confidence []string References []models.References }
type CvePackage ¶
type CveRequest ¶
func (*CveRequest) Bytes ¶
func (r *CveRequest) Bytes() (*[]byte, error)
type Dictionary ¶
type Dictionary struct { // Key a natural key used to uniquely identify this dictionary for the purpose of idempotent opeartions Key string `json:"key" yaml:"key"` // Name a friendly name for the dictionary Name string `json:"name" yaml:"name"` // Description describe the purpose / content of the dictionary Description string `json:"description,omitempty" yaml:"description,omitempty"` // Values a map containing key/value pairs that are the content held by the dictionary Values map[string]interface{} `json:"values,omitempty" yaml:"values,omitempty"` // Tags a list of string based tags used for categorising the dictionary Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Dictionary a key value pair list with name and description
type Event ¶
type Event struct { EventID string `json:"event_id,omitempty" yaml:"event_id,omitempty" bson:"event_id,omitempty"` Client string `json:"client,omitempty" yaml:"client,omitempty" bson:"client,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty" bson:"hostname,omitempty"` HostUUID string `json:"host_uuid,omitempty" yaml:"host_uuid,omitempty" bson:"host_uuid,omitempty"` MachineId string `json:"machine_id" yaml:"machine_id" bson:"machine_id"` HostAddress string `json:"host_address,omitempty" yaml:"host_address,omitempty" bson:"host_address,omitempty"` Organisation string `json:"org,omitempty" yaml:"org,omitempty" bson:"org,omitempty"` OrganisationGroup string `json:"org_group,omitempty" yaml:"org_group,omitempty" bson:"org_group,omitempty"` Area string `json:"area,omitempty" yaml:"area,omitempty" bson:"area,omitempty"` Location string `json:"location,omitempty" yaml:"location,omitempty" bson:"location,omitempty"` Facility int `json:"facility,omitempty" yaml:"facility,omitempty" bson:"facility,omitempty"` Priority int `json:"priority,omitempty" yaml:"priority,omitempty" bson:"priority,omitempty"` Severity int `json:"severity,omitempty" yaml:"severity,omitempty" bson:"severity,omitempty"` Time time.Time `json:"time,omitempty" yaml:"time,omitempty" bson:"time,omitempty"` TLSPeer string `json:"tls_peer,omitempty" yaml:"tls_peer,omitempty" bson:"tls_peer,omitempty"` BootTime time.Time `json:"boot_time,omitempty" yaml:"boot_time,omitempty" bson:"boot_time,omitempty"` Content string `json:"content,omitempty" yaml:"content,omitempty" bson:"content,omitempty"` Tag string `json:"tag,omitempty" yaml:"tag,omitempty" bson:"tag,omitempty"` MacAddress []string `json:"mac_address,omitempty" yaml:"mac_address,omitempty" bson:"mac_address,omitempty"` HostLabel []string `json:"host_label,omitempty" yaml:"host_label,omitempty" bson:"host_label,omitempty"` // contains filtered or unexported fields }
Event a pilot event to be sent to piloctl service
type EventReceiver ¶
type EventReceivers ¶
type EventReceivers struct {
EventReceivers []EventReceiver `json:"event_receivers"`
}
func NewEventPubConf ¶
func NewEventPubConf() *EventReceivers
type Host ¶
type Host struct { Id int64 `json:"id"` HostUUID string `json:"host_uuid"` HostMacAddress string `json:"host_mac_address"` OrgGroup string `json:"org_group"` Org string `json:"org"` Area string `json:"area"` Location string `json:"location"` Connected bool `json:"connected"` LastSeen int64 `json:"last_seen"` Since int `json:"since"` SinceType string `json:"since_type"` Label []string `json:"label"` Critical int `json:"critical"` High int `json:"high"` Medium int `json:"medium"` Low int `json:"low"` }
Host monitoring information
type HostInfo ¶
type HostInfo struct { HostUUID string MachineId string HostName string OS string Platform string PlatformFamily string PlatformVersion string Virtual bool TotalMemory float64 CPUs int HostIP string BootTime time.Time MacAddress []string PrimaryMAC string HardwareId string }
HostInfo abstracts host information
func NewHostInfo ¶
type Job ¶
type Job struct { Id int64 `json:"id"` HostUUID string `json:"host_uuid"` JobBatchId int64 `json:"job_batch_id"` FxKey string `json:"fx_key"` FxVersion int64 `json:"fx_version"` Created string `json:"created"` Started string `json:"started"` Completed string `json:"completed"` Log string `json:"log"` Error bool `json:"error"` OrgGroup string `json:"org_group"` Org string `json:"org"` Area string `json:"area"` Location string `json:"location"` Tag []string `json:"tag"` }
Job a representation of a job in the database
type JobBatch ¶
type JobBatch struct { // the id of the job batch BatchId int64 `json:"batch_id"` // the name of the batch (not unique, a user-friendly name) Name string `json:"name"` // any relevant notes for the batch (not mandatory) Notes string `json:"notes,omitempty"` // creation time Created time.Time `json:"created"` // one or more search labels Label []string `json:"label,omitempty"` // owner Owner string `json:"owner"` // jobs Jobs int `json:"jobs"` }
JobBatch a representation of a batch in the database
type JobBatchInfo ¶
type JobBatchInfo struct { // the name of the batch (not unique, a user-friendly name) Name string `json:"name"` // any relevant notes for the batch (not mandatory) Notes string `json:"notes,omitempty"` // one or more search labels Label []string `json:"label,omitempty"` // the universally unique host identifier created by pilot HostUUID []string `json:"host_uuid"` // the unique key of the function to run FxKey string `json:"fx_key"` // the version of the function to run FxVersion int64 `json:"fx_version"` }
JobBatchInfo information required to create a new job batch
type JobResult ¶
type JobResult struct { // the unique job id JobId int64 // indicates of the job was successful Success bool // the execution log for the job Log string // the error if any Err string // the completion time Time time.Time }
JobResult the result of the execution of a job note: ensure it is aligned with the same struct in piloth
type Org ¶
type Org struct { Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` }
Org host organisation
type PGP ¶
type PGP struct {
// contains filtered or unexported fields
}
PGP entity for signing, verification, encryption and decryption
func LoadPGPBytes ¶
func (*PGP) HasPrivate ¶
HasPrivate check if the PGP entity has a private key, if not an error is returned
type PackageInfo ¶
PackageInfo describes a package and all its tags
type PingRequest ¶
type PingRequest struct {
Result *JobResult `json:"result,omitempty"`
}
func (*PingRequest) Bytes ¶
func (r *PingRequest) Bytes() (*[]byte, error)
type PingResponse ¶
type PingResponse struct { // the envelope signature Signature string `json:"signature"` // the signed content sent to pilot Envelope PingResponseEnvelope `json:"envelope"` }
PingResponse a command for execution with a job reference
func NewPingResponse ¶
func NewPingResponse(cmdInfo CmdInfo, pingInterval time.Duration) (*PingResponse, error)
NewPingResponse creates a new ping response
type PingResponseEnvelope ¶
type PingResponseEnvelope struct { // the information about the command to execute Command CmdInfo `json:"value"` // the ping interval Interval time.Duration `json:"interval"` }
PingResponseEnvelope contains the signed content sent to pilot
type Registration ¶
type RegistrationRequest ¶
type RegistrationRequest struct { Hostname string `json:"hostname"` HostIP string `json:"host_ip"` MachineId string `json:"machine_id"` OS string `json:"os"` Platform string `json:"platform"` Virtual bool `json:"virtual"` TotalMemory float64 `json:"total_memory"` CPUs int `json:"cpus"` MacAddress []string `json:"mac_address"` }
RegistrationRequest information sent by pilot upon host registration
func (*RegistrationRequest) Bytes ¶
func (r *RegistrationRequest) Bytes() (*[]byte, error)
Bytes Get a []byte representing the Serializable
type RegistrationResponse ¶
type RegistrationResponse struct { // the status of the registration - I: created, U: updated, N: already exist Operation string `json:"operation"` }
RegistrationResponse data returned to pilot upon registration