state

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const StratusStateDirectoryName = ".stratus-red-team"
View Source
const StratusStateTechniqueStateFileName = ".state"
View Source
const StratusStateTerraformFileName = "main.tf"
View Source
const StratusStateTerraformOutputsFileName = ".terraform-outputs"

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystem

type FileSystem interface {
	FileExists(string) bool
	CreateDirectory(string, os.FileMode) error
	RemoveDirectory(string) error
	WriteFile(string, []byte, os.FileMode) error
	ReadFile(string) ([]byte, error)
}

type FileSystemStateManager

type FileSystemStateManager struct {
	RootDirectory string
	Technique     *stratus.AttackTechnique
	FileSystem    FileSystem
}

func NewFileSystemStateManager

func NewFileSystemStateManager(technique *stratus.AttackTechnique) *FileSystemStateManager

func (*FileSystemStateManager) CleanupTechnique

func (m *FileSystemStateManager) CleanupTechnique() error

func (*FileSystemStateManager) ExtractTechnique

func (m *FileSystemStateManager) ExtractTechnique() error

func (*FileSystemStateManager) GetRootDirectory

func (m *FileSystemStateManager) GetRootDirectory() string

func (*FileSystemStateManager) GetTechniqueState

func (m *FileSystemStateManager) GetTechniqueState() stratus.AttackTechniqueState

func (*FileSystemStateManager) GetTerraformOutputs

func (m *FileSystemStateManager) GetTerraformOutputs() (map[string]string, error)

func (*FileSystemStateManager) Initialize

func (m *FileSystemStateManager) Initialize()

func (*FileSystemStateManager) SetTechniqueState

func (m *FileSystemStateManager) SetTechniqueState(state stratus.AttackTechniqueState) error

func (*FileSystemStateManager) WriteTerraformOutputs

func (m *FileSystemStateManager) WriteTerraformOutputs(outputs map[string]string) error

type LocalFileSystem

type LocalFileSystem struct{}

func (*LocalFileSystem) CreateDirectory

func (m *LocalFileSystem) CreateDirectory(dir string, mode os.FileMode) error

func (*LocalFileSystem) FileExists

func (m *LocalFileSystem) FileExists(fileName string) bool

func (*LocalFileSystem) ReadFile

func (m *LocalFileSystem) ReadFile(file string) ([]byte, error)

func (*LocalFileSystem) RemoveDirectory

func (m *LocalFileSystem) RemoveDirectory(dir string) error

func (*LocalFileSystem) WriteFile

func (m *LocalFileSystem) WriteFile(file string, content []byte, mode os.FileMode) error

type StateManager

type StateManager interface {
	Initialize()
	GetRootDirectory() string
	ExtractTechnique() error
	CleanupTechnique() error
	GetTerraformOutputs() (map[string]string, error)
	WriteTerraformOutputs(outputs map[string]string) error
	GetTechniqueState() stratus.AttackTechniqueState
	SetTechniqueState(state stratus.AttackTechniqueState) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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