phishlet

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile added in v0.3.0

func Compile(yaml string) (*aitm.Phishlet, error)

Compile parses raw YAML and returns a fully compiled Phishlet.

func Load added in v0.3.0

func Load(path string) (*aitm.Phishlet, error)

Load reads the YAML file at path and returns a fully compiled Phishlet.

Types

type Compiler added in v0.3.0

type Compiler struct{}

Compiler satisfies the phishletCompiler interface defined in the aitm package.

func (Compiler) Compile added in v0.3.0

func (Compiler) Compile(yaml string) (*aitm.Phishlet, error)

type Resolver added in v0.3.0

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver maps request hostnames to their configured phishlet and lure. All state is held in memory. Register must be called whenever a phishlet is enabled or its config changes. InvalidateLures must be called whenever a lure is created, updated, or deleted.

func NewResolver added in v0.3.0

func NewResolver(lureStore lureStore, logger *slog.Logger) *Resolver

func (*Resolver) Get added in v0.3.0

func (r *Resolver) Get(name string) *aitm.ConfiguredPhishlet

Get returns the registered configured phishlet by name, or nil if not registered.

func (*Resolver) InvalidateLures added in v0.3.0

func (r *Resolver) InvalidateLures()

InvalidateLures reloads the lure cache from the store. Call after any lure mutation. On store error the stale cache is kept so in-flight requests are not disrupted.

func (*Resolver) LoadLuresFromDB added in v0.3.0

func (r *Resolver) LoadLuresFromDB() error

LoadLuresFromDB populates the in-memory lure cache from the store. Call once at startup before serving requests.

func (*Resolver) OwnerOf added in v0.3.0

func (r *Resolver) OwnerOf(hostname string) string

OwnerOf returns the name of the enabled phishlet that owns hostname, or "" if no phishlet is registered for it.

func (*Resolver) Register added in v0.3.0

func (r *Resolver) Register(cp *aitm.ConfiguredPhishlet)

Register stores cp in both indexes. If cp is enabled and has a non-empty hostname it becomes reachable by hostname. Replaces any previously registered entry with the same name, cleaning up the old hostname index entry if the hostname changed.

func (*Resolver) ResolveHostname added in v0.3.0

func (r *Resolver) ResolveHostname(hostname, urlPath string) (*aitm.ConfiguredPhishlet, *aitm.Lure, error)

ResolveHostname returns the configured phishlet and best-matching lure for a request. When multiple lures share a phishlet, the longest path prefix wins.

Jump to

Keyboard shortcuts

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