Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func DeletePlugin(name string) error
- func GetCategories() []string
- func InstallPlugin(plugin *Plugin) (err error)
- func InstalledPluginsCheck(docker *client.Docker) bool
- func ListAllPlugins(detail bool)
- func ListEnabledPlugins(detail bool)
- func Load()
- func MustAsset(name string) []byte
- func PostResults(url string, resultJSON []byte, taskID string)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RunIntelPlugins(docker *client.Docker, hash string, scanID string, ...)
- func ToMarkDownTable(plugins []Plugin)
- func UpdateAllPlugins(docker *client.Docker)
- func UpdateAllPluginsFromSource(docker *client.Docker)
- func UpdateEnabledPlugins(docker *client.Docker)
- type Configuration
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func InstallPlugin ¶
InstallPlugin installs a new malice plugin
func InstalledPluginsCheck ¶
InstalledPluginsCheck checks that all enabled plugins are installed
func ListEnabledPlugins ¶
func ListEnabledPlugins(detail bool)
ListEnabledPlugins lists enabled plugins
func Load ¶
func Load()
Load plugins.toml into Plug var Try to load plugins from - .malice folder : $HOME/.malice/plugins.toml - binary embedded file : bindata
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PostResults ¶
PostResults post plugin results to Malice Webhook
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func RunIntelPlugins ¶
func RunIntelPlugins(docker *client.Docker, hash string, scanID string, logs, elasticsearchInDocker bool)
RunIntelPlugins run all Intel plugins
func ToMarkDownTable ¶
func ToMarkDownTable(plugins []Plugin)
ToMarkDownTable prints plugins out as Markdown table
func UpdateAllPlugins ¶
UpdateAllPlugins performs a docker pull on all registered plugins checking for updates
func UpdateAllPluginsFromSource ¶
UpdateAllPluginsFromSource performs a docker build on a plugins remote repository on all registered plugins
func UpdateEnabledPlugins ¶
UpdateEnabledPlugins performs a docker pull on all enabled plugins checking for updates
Types ¶
type Configuration ¶
type Configuration struct {
Plugins []Plugin `toml:"plugin"`
}
Configuration represents the malice runtime plugins.
var Plugs Configuration
Plugs represents the Malice runtime configuration
type Plugin ¶
type Plugin struct { Name string `toml:"name"` Enabled bool `toml:"enabled"` Category string `toml:"category"` Description string `toml:"description"` Image string `toml:"image"` Repository string `toml:"repository"` Build bool `toml:"build"` APIKey string `toml:"apikey"` Mime string `toml:"mime"` HashTypes []string `toml:"hashtypes"` Cmd string `toml:"cmd"` Env []string `toml:"env"` Installed bool }
Plugin represents a single plugin setting.
func GetAllPluginsInCategory ¶
GetAllPluginsInCategory returns all plugins in a give category
func GetEnabledPlugins ¶
func GetEnabledPlugins() []Plugin
GetEnabledPlugins will return all enabled plugins
func GetIntelPlugins ¶
GetIntelPlugins will return all Intel plugins
func GetPluginByName ¶
GetPluginByName will return plugin for the given name
func GetPluginsForMime ¶
GetPluginsForMime will return all plugins that can consume the mime type file
func (Plugin) StartPlugin ¶
func (plugin Plugin) StartPlugin(docker *client.Docker, arg string, scanID string, logs, elasticsearchInDocker bool, wg *sync.WaitGroup)
StartPlugin starts plugin
func (Plugin) UpdatePlugin ¶
UpdatePlugin performs a docker pull on all registered plugins checking for updates
func (Plugin) UpdatePluginFromRepository ¶
UpdatePluginFromRepository performs a docker build on a plugins remote repository