Documentation
¶
Index ¶
- Constants
- Variables
- func ExecuteAuthorizationCmd(cmd string) string
- func GenerateTempFile(sessionId, filename string) (*os.File, error)
- func GetAliases() ([]string, error)
- func GetAliasesDir() string
- func GetConfigDir() string
- func GetConfigs() ([]string, error)
- func GetExtensions() ([]string, error)
- func GetExtensionsDir() string
- func GetInstalledAliasManifests() []string
- func GetInstalledExtensionManifests() []string
- func GetInstalledMalManifests() []string
- func GetLogDir() string
- func GetMals() ([]string, error)
- func GetMalsConfig() []*m.MalConfig
- func GetMalsDir() string
- func GetResourceDir() string
- func GetRootAppDir() string
- func GetTempDir() string
- func InitLogDir()
- func LoadConfig(filename string) (*mtls.ClientConfig, error)
- func MvConfig(oldPath string) error
- func PrintProfileSettings()
- func RefreshProfile() error
- func SaveSettings(settings *Settings) error
- type AISettings
- type ArmoryConfig
- type GithubSetting
- type Profile
- func (profile *Profile) AddAlias(alias string) bool
- func (profile *Profile) AddExtension(extension string) bool
- func (profile *Profile) AddMal(manifestName string) bool
- func (profile *Profile) RemoveAlias(alias string) bool
- func (profile *Profile) RemoveExtension(extension string) bool
- func (profile *Profile) RemoveMal(manifestName string) bool
- type Settings
Constants ¶
View Source
const ( AliasesDirName = "aliases" ExtensionsDirName = "extensions" MalsDirName = "mals" )
View Source
const (
DefaultArmoryName = "Default"
)
Variables ¶
View Source
var ( MaliceDirName = ".config/malice" ConfigDirName = "configs" ResourcesDirName = "resources" TempDirName = "temp" LogDirName = "log" )
View Source
var ( // DefaultArmoryPublicKey - The default public key for the armory DefaultArmoryPublicKey = "RWSBpxpRWDrD7Fe+VvRE3c2VEDC2NK80rlNCj+BX0gz44Xw07r6KQD9L" // DefaultArmoryRepoURL - The default repo url for the armory DefaultArmoryRepoURL = "https://api.github.com/repos/sliverarmory/armory/releases" DefaultArmoryConfig = &ArmoryConfig{ PublicKey: DefaultArmoryPublicKey, RepoURL: DefaultArmoryRepoURL, Name: DefaultArmoryName, Enabled: true, } )
View Source
var AuditHtml []byte
View Source
var HookFn = func(event string, c *config.Config) { if strings.HasPrefix(event, "set.") { rootDir, _ := filepath.Abs(GetRootAppDir()) var buf bytes.Buffer _, err := config.DumpTo(&buf, config.Yaml) if err != nil { logs.Log.Errorf("cannot dump config , %s ", err.Error()) return } if err := fileutils.AtomicWriteFile(filepath.Join(rootDir, maliceProfile), buf.Bytes(), assetsFilePerm); err != nil { logs.Log.Errorf("cannot write config , %s ", err.Error()) } } }
Functions ¶
func ExecuteAuthorizationCmd ¶ added in v0.0.2
func GenerateTempFile ¶ added in v0.0.3
func GetAliases ¶ added in v0.1.0
func GetConfigDir ¶
func GetConfigDir() string
func GetConfigs ¶
func GetExtensions ¶ added in v0.1.0
func GetInstalledAliasManifests ¶
func GetInstalledAliasManifests() []string
GetInstalledAliasManifests - Returns a list of installed alias manifests
func GetInstalledExtensionManifests ¶
func GetInstalledExtensionManifests() []string
GetInstalledExtensionManifests - Returns a list of installed extension manifests
func GetInstalledMalManifests ¶ added in v0.0.2
func GetInstalledMalManifests() []string
func GetMalsConfig ¶ added in v0.0.2
func GetMalsDir ¶ added in v0.0.2
func GetMalsDir() string
func GetResourceDir ¶ added in v0.0.3
func GetResourceDir() string
func GetRootAppDir ¶
func GetRootAppDir() string
func GetTempDir ¶ added in v0.0.3
func GetTempDir() string
func InitLogDir ¶ added in v0.3.0
func InitLogDir()
InitLogDir initializes the log directory for core.Session
func LoadConfig ¶ added in v0.1.0
func LoadConfig(filename string) (*mtls.ClientConfig, error)
func RefreshProfile ¶ added in v0.1.0
func RefreshProfile() error
func SaveSettings ¶
SaveSettings - Save the current settings to disk
Types ¶
type AISettings ¶ added in v0.3.0
type AISettings struct {
Enable bool `yaml:"enable" config:"enable" default:"false"`
Provider string `yaml:"provider" config:"provider" default:"openai"` // Preferred provider for agent chat/skill.
APIKey string `yaml:"api_key" config:"api_key" default:""` // Legacy local ask/analyze only.
Endpoint string `yaml:"endpoint" config:"endpoint" default:"https://api.openai.com/v1"` // Legacy local ask/analyze only.
Model string `yaml:"model" config:"model" default:"gpt-4"`
MaxTokens int `yaml:"max_tokens" config:"max_tokens" default:"1024"`
Timeout int `yaml:"timeout" config:"timeout" default:"30"`
HistorySize int `yaml:"history_size" config:"history_size" default:"20"`
OpsecCheck bool `yaml:"opsec_check" config:"opsec_check" default:"false"` // Enable AI OPSEC risk assessment
}
AISettings holds configuration for AI assistant integration
func GetValidAISettings ¶ added in v0.3.0
func GetValidAISettings() (*AISettings, error)
GetValidAISettings validates and returns AI settings, or an error if not properly configured.
type ArmoryConfig ¶
type ArmoryConfig struct {
PublicKey string `json:"public_key"`
RepoURL string `json:"repo_url"`
Authorization string `json:"authorization"`
AuthorizationCmd string `json:"authorization_cmd"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
}
ArmoryConfig - The armory config file
func GetArmoriesConfig ¶
func GetArmoriesConfig() []*ArmoryConfig
GetArmoriesConfig - The parsed armory config file
type GithubSetting ¶ added in v0.1.1
type GithubSetting struct {
Repo string `yaml:"repo" config:"repo" default:""`
Owner string `yaml:"owner" config:"owner" default:""`
Token string `yaml:"token" config:"token" default:""`
Workflow string `yaml:"workflow" config:"workflow" default:"generate.yaml"`
}
func (*GithubSetting) ToProtobuf ¶ added in v0.1.1
func (github *GithubSetting) ToProtobuf() *clientpb.GithubActionBuildConfig
type Profile ¶
type Profile struct {
ResourceDir string `yaml:"resources" config:"resources" default:""`
TempDir string `yaml:"tmp" config:"tmp" default:""`
Aliases []string `yaml:"aliases" config:"aliases" default:""`
Extensions []string `yaml:"extensions" config:"extensions" default:""`
Mals []string `yaml:"mals" config:"mals" default:""`
Settings *Settings `yaml:"settings" config:"settings"`
}
func GetProfile ¶ added in v0.0.3
func LoadProfile ¶ added in v0.1.0
func (*Profile) AddExtension ¶ added in v0.0.3
func (*Profile) RemoveAlias ¶ added in v0.1.1
func (*Profile) RemoveExtension ¶ added in v0.1.1
type Settings ¶
type Settings struct {
MaxServerLogSize int `yaml:"max_server_log_size" config:"max_server_log_size" default:"10"`
OpsecThreshold float64 `yaml:"opsec_threshold" config:"opsec_threshold" default:"6.0"`
McpEnable bool `yaml:"mcp_enable" config:"mcp_enable" default:"false"`
McpAddr string `yaml:"mcp_addr" config:"mcp_addr" default:"127.0.0.1:5005"`
LocalRPCEnable bool `yaml:"localrpc_enable" config:"localrpc_enable" default:"false"`
LocalRPCAddr string `yaml:"localrpc_addr" config:"localrpc_addr" default:"127.0.0.1:15004"`
Github *GithubSetting `yaml:"github" config:"github"`
AI *AISettings `yaml:"ai" config:"ai"`
}
func GetSetting ¶ added in v0.1.0
func LoadSettings ¶
Click to show internal directories.
Click to hide internal directories.