Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEnvFile ¶
IsEnvFile returns true if the filename matches .env patterns: .env, .env.local, .env.production, .env.*, etc.
func NewSecRoot ¶
func NewSecRoot(rootPath string, safeMode bool) (fs.InodeEmbedder, error)
NewSecRoot creates a new SecNode-based loopback root for the given directory.
Types ¶
type FileKind ¶
type FileKind int
FileKind classifies a file for the FUSE security filter.
const ( FileKindNone FileKind = iota // Not a sensitive file — passthrough. FileKindEnv // KEY=VALUE file (.env, .npmrc, .pypirc) — line-by-line redaction. FileKindJSON // JSON file (credentials.json, secrets.json) — JSON-aware redaction. FileKindYAML // YAML file (secrets.yaml) — YAML-aware redaction. FileKindOpaque // Binary/opaque (*.pem, *.key, *.p12, *.pfx) — always empty. )
func IsSensitiveFile ¶
IsSensitiveFile classifies a filename by its sensitivity.
type MountHandle ¶
type MountHandle struct {
// contains filtered or unexported fields
}
MountHandle holds a running FUSE mount and allows unmounting.
func Mount ¶
func Mount(sourceDir, mountPoint string, safeMode bool, logger zerolog.Logger) (*MountHandle, error)
Mount creates a FUSE passthrough filesystem at mountPoint that mirrors sourceDir. Sensitive files are redacted or served empty depending on safeMode. When safeMode is true, all sensitive files return empty content (maximum paranoia). When safeMode is false, sensitive files are redacted with structure preserved.
func (*MountHandle) Tier ¶
func (h *MountHandle) Tier() string
Tier returns a human-readable description of the I/O strategy in use.
func (*MountHandle) Unmount ¶
func (h *MountHandle) Unmount() error
Unmount stops the FUSE server and removes the mountpoint directory.
type SecNode ¶
type SecNode struct {
*fs.LoopbackNode
// contains filtered or unexported fields
}
SecNode is a FUSE inode that mirrors a real file or directory. For non-sensitive files, it delegates to LoopbackNode (passthrough). For sensitive files, it serves empty or redacted content and blocks writes.
func (*SecNode) Open ¶
Open intercepts sensitive files and returns a protected handle. All other files delegate to LoopbackNode.Open for passthrough I/O.
func (*SecNode) WrapChild ¶
func (n *SecNode) WrapChild(_ context.Context, ops fs.InodeEmbedder) fs.InodeEmbedder
WrapChild ensures every child inode created by Lookup/Create is a SecNode.