Documentation
¶
Overview ¶
Package canary generates the fake secrets planted inside a sandbox run.
Every value is synthetic, generated fresh for the run, and never derived from the real host environment or filesystem. A value showing up in sandbox output or in an outbound request is evidence the target read it and tried to use or exfiltrate it.
Index ¶
Constants ¶
const ( KindAWSKey = "aws_key" KindSSHKey = "ssh_key" KindAPIToken = "api_token" KindDBPassword = "db_password" KindFile = "file" )
Kind values, mirrored on analyzer.Canary.Kind
const ContainerHome = "/sandbox/home"
ContainerHome is where the sandbox mounts the directory a Set is materialized into, and the HOME it gives the container
Variables ¶
var ErrPathEscape = errors.New("canary: path escapes the run directory")
ErrPathEscape is returned by Materialize for a canary file path that is absolute or contains a ".." component
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set struct {
RunID string
Canaries []analyzer.Canary
// Files maps a path relative to the fake home root to its content
Files map[string]string
// Env is the set of environment variables to inject, all synthetic
Env map[string]string
}
Set is one run's worth of planted secrets: the analyzer.Canary records handed to the observer, the file tree that backs the file-based ones, and the environment variables to inject into the container
func Generate ¶
Generate builds a fresh set of synthetic secrets. It never reads os.Environ or any real file; every byte comes from crypto/rand.
func (*Set) Materialize ¶
Materialize writes the fake home directory tree under root through os.Root. Lexical checks reject obvious escapes, while kernel-backed resolution remains the actual filesystem boundary.