For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • General
    • About Enforcers
    • Support first-party HUMAN calls
    • Troubleshoot Enforcer configurations
  • Enforcer frameworks
    • Akamai ESI
    • Apache - C Module
    • ASP.NET
      • Changelog
      • Installation
      • Configuration
    • Callout Enforcer
    • Envoy Proxy
    • F5 BIGIP
    • Fastly JavaScript Compute@Edge
    • Google Cloud Platform (GCP) Callout Enforcer
    • Kong Plugin
    • NGINX - C Module
    • NGINX - LUA Module
    • PHP
    • Python
    • Ruby
    • Salesforce Commerce Cloud Cartridge
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
On this page
  • Prerequisites
  • Installation
Enforcer frameworksAWS API Gateway-HTTP API Gateway-Lambda Integration-Payload V2

Installation

Was this page helpful?
Previous

Configuration

Next
Built with

If your organization uses AWS HTTP API Gateway with a NodeJS Lambda integration, you can use the HUMAN API Gateway Enforcer to protect your API Gateway against malicious behavior. The HUMAN enforcer easily integrates into your existing AWS Lambda function.

Prerequisites

  • An existing AWS HTTP API Gateway
  • A NodeJS Lambda integration with Node v16.x or later.

For the HUMAN AWS HTTP API Gateway Enforcer to be compatible with your AWS Lambda function integration, the AWS Lambda function must use v2 of the payload format structure.

Installation

  1. Install the Enforcer using NPM package in your project.
$npm install @humansecurity/aws-api-gateway-enforcer
  1. Save your handler in a constant
1import { APIGatewayProxyEventV2 } from 'aws-lambda';
2
3const myHandler = (event: APIGatewayProxyEventV2): Promise<APIGatewayProxyStructuredResultV2> => {
4 // ... original lambda handler code
5}
  1. Export HUMAN Security’s handler from your Lambda.
1import { handler as humanSecurityHandler } from "@humansecurity/aws-api-gateway-enforcer";
2
3const pxConfig = {
4 onPass: myHandler,
5 px_app_id: "<APP_ID>",
6 px_cookie_secret: "<COOKIE_SECRET>",
7 px_auth_token: "<AUTH_TOKEN>"
8 // ...
9};
10export const handler = humanSecurityHandler(pxConfig);
  1. Deploy the AWS Lambda function and API Gateway.