Documentation
¶
Index ¶
- Variables
- func Run(timPath string) error
- func RunEncrypted(stimPath, password string) error
- type Cache
- func (c *Cache) Delete(name string) error
- func (c *Cache) Exists(name string) bool
- func (c *Cache) List() ([]string, error)
- func (c *Cache) Load(name string) (*TerminalIsolationMatrix, error)
- func (c *Cache) Run(name string) error
- func (c *Cache) Size(name string) (int64, error)
- func (c *Cache) Store(name string, m *TerminalIsolationMatrix) error
- type TerminalIsolationMatrix
Constants ¶
This section is empty.
Variables ¶
var ( ErrDataNodeRequired = errors.New("datanode is required") ErrConfigIsNil = errors.New("config is nil") ErrPasswordRequired = errors.New("password is required for encryption") ErrInvalidStimPayload = errors.New("invalid stim payload") ErrDecryptionFailed = errors.New("decryption failed (wrong password?)") )
var (
ExecCommand = exec.Command
)
Functions ¶
func RunEncrypted ¶ added in v0.0.2
RunEncrypted runs an encrypted .stim file. It decrypts the file, extracts the contents to a temporary directory, and runs the container using runc.
Types ¶
type Cache ¶ added in v0.0.2
Cache provides encrypted storage for TIM containers. It stores TIMs as .stim files in a directory, encrypted with ChaCha20-Poly1305 using a shared password.
func NewCache ¶ added in v0.0.2
NewCache creates a cache in the given directory. The directory will be created if it doesn't exist.
func (*Cache) Load ¶ added in v0.0.2
func (c *Cache) Load(name string) (*TerminalIsolationMatrix, error)
Load retrieves and decrypts a TIM from the cache.
type TerminalIsolationMatrix ¶
TerminalIsolationMatrix represents a runc bundle.
func FromDataNode ¶
func FromDataNode(dn *datanode.DataNode) (*TerminalIsolationMatrix, error)
FromDataNode creates a new TerminalIsolationMatrix from a DataNode.
func FromSigil ¶ added in v0.0.2
func FromSigil(data []byte, password string) (*TerminalIsolationMatrix, error)
FromSigil decrypts and deserializes a .stim file into a TerminalIsolationMatrix.
func FromTar ¶ added in v0.0.2
func FromTar(data []byte) (*TerminalIsolationMatrix, error)
FromTar creates a TerminalIsolationMatrix from a tarball. The tarball must contain config.json and a rootfs/ directory.
func New ¶
func New() (*TerminalIsolationMatrix, error)
New creates a new, empty TerminalIsolationMatrix.
func (*TerminalIsolationMatrix) ToSigil ¶ added in v0.0.2
func (m *TerminalIsolationMatrix) ToSigil(password string) ([]byte, error)
ToSigil serializes and encrypts the TIM to .stim format using ChaChaPolySigil. Config and RootFS are encrypted separately. The output format is a Trix container with "STIM" magic containing: - Header: {"encryption_algorithm": "chacha20poly1305", "tim": true} - Payload: [config_size(4 bytes)][encrypted_config][encrypted_rootfs]
func (*TerminalIsolationMatrix) ToTar ¶
func (m *TerminalIsolationMatrix) ToTar() ([]byte, error)
ToTar serializes the TerminalIsolationMatrix to a tarball.