Documentation
¶
Overview ¶
Package lambdaext runs the sensor inside AWS Lambda as an external extension.
Lambda gives the sensor no kernel hooks and no port in front of the function, so it uses the one seam Lambda does offer: the Runtime API. The layer's exec wrapper points the function's runtime at the sensor (AWS_LAMBDA_RUNTIME_API=127.0.0.1:<port>), and the sensor forwards every call to the real Runtime API. When the runtime asks for its next invocation, the sensor inspects the event first: an API Gateway or function URL event is an HTTP request, and runs through the same engines and verdicts as the inbound proxy. A blocked or held request is answered with a 403 response on the function's behalf, the handler never sees it, and the sensor fetches the next invocation for the runtime.
Anything that is not an HTTP event passes through untouched, as does every event when the rules have not loaded or inspection fails.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Events ¶
Events blocks on the extension event stream, calling onInvoke after each INVOKE, and returns when Lambda says SHUTDOWN or ctx ends.
Types ¶
type RuntimeProxy ¶
type RuntimeProxy struct {
// Upstream is the real Runtime API, host:port.
Upstream string
Rules func() *engine.Set
Verdicts *decide.Engine
Report func(uplink.Event)
Client *http.Client
Now func() time.Time
}
RuntimeProxy is the Runtime API as the function's runtime sees it.
func (*RuntimeProxy) ServeHTTP ¶
func (p *RuntimeProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)