Documentation
¶
Overview ¶
Package security implements atago's security model: masking secret values in reports and logs, and the safe defaults enabled by --ci.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHost ¶
CheckHost reports whether hostport (a "host" or "host:port") is permitted by the allowlist, returning a *PolicyError otherwise. An empty allowlist means no network policy is configured and everything is permitted.
func ResolveSpecPath ¶
ResolveSpecPath resolves a spec-scoped path (currently snapshot paths) and guarantees it stays inside the spec directory. field names the spec field for a clear error.
func ResolveWorkdirPath ¶
ResolveWorkdirPath resolves a workdir-scoped path and guarantees it stays inside the scenario workdir. field names the spec field for a clear error.
func WithinRoot ¶
WithinRoot reports whether resolved lies inside root (root itself counts). Callers that resolve a path with non-default semantics — a symlink target resolved against the link's own directory, say — can reuse this single containment test instead of re-deriving prefix logic. It uses filepath.Rel so a relative root such as "." (a spec loaded by a bare filename) is handled the same as an absolute one, comparing whole path components rather than raw string prefixes.
Types ¶
type Masker ¶
type Masker struct {
// contains filtered or unexported fields
}
Masker replaces known secret values with a fixed placeholder.
func NewMasker ¶
NewMasker builds a Masker from literal secret values. Empty or very short values are ignored.
func NewMaskerForSpec ¶
NewMaskerForSpec collects secret values for a spec from the process environment and from per-step env overrides of the names listed under `secrets:`.
type PolicyError ¶
PolicyError reports a network egress that permissions.network.allow does not permit. It is returned by CheckHost and lets the engine flag a security-policy violation for grpc/ssh steps, mirroring the HTTP runner.
func (*PolicyError) Error ¶
func (e *PolicyError) Error() string