api

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assets

func Assets(ctx *context.Context)

func Commands

func Commands(ctx *context.Context)

func Dashboard

func Dashboard(ctx *context.Context)

func DeleteAsset

func DeleteAsset(ctx *context.Context)

func DeleteRule

func DeleteRule(ctx *context.Context)

func DeleteTask

func DeleteTask(ctx *context.Context)

func EditAsset

func EditAsset(ctx *context.Context, newAsset EditAssetForm)

func EditRule

func EditRule(ctx *context.Context, newRule EditRuleForm)

func ErrorDelete

func ErrorDelete(ctx *context.Context)

func Index

func Index(ctx *context.Context)

func NewAsset

func NewAsset(ctx *context.Context, newAsset NewAssetForm)

func NewRule

func NewRule(ctx *context.Context, newRule NewRuleForm)

func NewTask

func NewTask(ctx *context.Context, newTask NewTaskForm)

func Rules

func Rules(ctx *context.Context)

func ShowErrors

func ShowErrors(ctx *context.Context)

func Tasks

func Tasks(ctx *context.Context)

func TasksReport

func TasksReport(ctx *context.Context)

func TasksResult

func TasksResult(ctx *context.Context)

func TasksResults

func TasksResults(ctx *context.Context)

Types

type EditAssetForm

type EditAssetForm struct {
	Hostname      string   `json:"hostname"       binding:"Required"`
	ClientVersion string   `json:"client_version" binding:"Required"`
	Tags          []string `json:"tags"           binding:"Required"`
}

type EditRuleForm

type EditRuleForm struct {
	Name string   `json:"name" binding:"Required"`
	Data string   `json:"data" binding:"Required"`
	Tags []string `json:"tags" binding:"Required"`
}

type Error

type Error struct {
	Error    bool   `json:"error"`
	ErrorID  int    `json:"error_id"`
	ErrorMsg string `json:"error_msg"`
}

type NewAssetForm

type NewAssetForm struct {
	Hostname      string   `json:"hostname".      binding:"Required"`
	ClientVersion string   `json:"client_version" binding:"Required"`
	Tags          []string `json:"tags"           binding:"Required"`
}

type NewRuleForm

type NewRuleForm struct {
	Name string   `json:"name" binding:"Required"`
	Data string   `json:"data" binding:"Required"`
	Tags []string `json:"tags"`
}

type NewTaskForm

type NewTaskForm struct {
	Assets  []string `json:"assets"  binding:"Required"`
	Rules   []string `json:"rules"   binding:"Required"`
	Command string   `json:"command" binding:"Required"`
	Target  string   `json:"target"  binding:"Required"`
	When    string   `json:"when"    binding:"Required"`
}

type PublicDashboard

type PublicDashboard struct {
	Asset []models.Endpoint `json:"assets"`
	Rules []models.Rule     `json:"rules"`
}

type PublicReports

type PublicReports struct {
	ULID     string    `json:"ulid"`
	Hostname string    `json:"hostname"`
	Reports  []Report  `json:"reports"`
	CreateAt time.Time `json:"created_at"`
	UpdateAt time.Time `json:"updated_at"`
}

Report collection

type PublicTasks

type PublicTasks struct {
	ULID     string `json:"ulid"`
	Hostname string `json:"hostname"`
	Task     Task   `json:"task"`
}

type Report

type Report struct {
	ReportID string    `json:"report_id"`
	Task     Task      `json:"task"`
	Result   []Result  `json:"results"`
	CreateAt time.Time `json:"created_at"`
	UpdateAt time.Time `json:"updated_at"`
}

type Result

type Result struct {
	File      string                 `json:"file"`
	RuleName  string                 `json:"rule_name"`
	Namespace string                 `json:"namespace"`
	Tags      []string               `json:"tags"`
	Meta      map[string]interface{} `json:"meta"`
	Strings   []YString              `json:"strings"`
}

type Task

type Task struct {
	TaskID   string          `json:"task_id"`
	Command  command.Command `json:"command"`
	Rules    []string        `json:"rules"`
	Params   string          `json:"params"`
	When     time.Time       `json:"when"`
	Status   models.State    `json:"status"`
	CreateAt time.Time       `json:"created_at"`
	UpdateAt time.Time       `json:"updated_at"`
}

type YString

type YString struct {
	Name   string `json:"name"`
	Offset uint64 `json:"offset"`
}

Jump to

Keyboard shortcuts

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