{"modulePath":"github.com/vulnetix/cli/v4","version":"v4.27.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package lambdaext\n\nPackage lambdaext runs the sensor inside AWS Lambda as an external extension.\n\nLambda 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:\\\u003cport\u003e), 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.\n\nAnything that is not an HTTP event passes through untouched, as does every event when the rules have not loaded or inspection fails.\n\n## Functions\n\n```go\nfunc Events(ctx context.Context, client *http.Client, runtimeAPI, id string, onInvoke func()) error\n```\nEvents blocks on the extension event stream, calling onInvoke after each INVOKE, and returns when Lambda says SHUTDOWN or ctx ends.\n\n```go\nfunc HTTPEvent(event []byte) (*http.Request, []byte, bool)\n```\nHTTPEvent reads an API Gateway (REST v1 or HTTP v2) or function URL event as an HTTP request. ok is false for any other event.\n\n```go\nfunc Register(ctx context.Context, client *http.Client, runtimeAPI, name string) (string, error)\n```\nRegister registers the extension for INVOKE and SHUTDOWN and returns its id.\n\n## Types\n\n```go\ntype RuntimeProxy struct {\n\t// Upstream is the real Runtime API, host:port.\n\tUpstream string\n\tRules    func() *engine.Set\n\tVerdicts *decide.Engine\n\tReport   func(uplink.Event)\n\tClient   *http.Client\n\tNow      func() time.Time\n}\n```\nRuntimeProxy is the Runtime API as the function's runtime sees it.\n\n```go\nfunc (p *RuntimeProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\n\n","path":"github.com/vulnetix/cli/v4/internal/sensor/lambdaext","name":"lambdaext","synopsis":"Package lambdaext runs the sensor inside AWS Lambda as an external extension.","isRedistributable":true}
