Skip to content

Latest commit

 

History

History

threat-protection

Threat Protection


This sample shows how to implement threat protection using Apigee's RegularExpression Policy policy and JSONThreatProtection Policy policy

Let's get started!


Prerequisites

  1. Provision Apigee X
  2. Configure external access for API traffic to your Apigee X instance
  3. Access to deploy proxies, create products, apps and developers in Apigee
  4. Make sure the following tools are available in your terminal's $PATH (Cloud Shell has these preconfigured)

(QuickStart) Setup using CloudShell

Use the following GCP CloudShell tutorial, and follow the instructions.

Open in Cloud Shell

Setup instructions

  1. Clone the apigee-samples repo, and switch to the threat-protection directory
git clone https://github.com/GoogleCloudPlatform/apigee-samples.git
cd apigee-samples/threat-protection
  1. Edit env.sh and configure the following variables:
  • PROJECT the project where your Apigee organization is located
  • APIGEE_HOST the externally reachable hostname of the Apigee environment group that contains APIGEE_ENV
  • APIGEE_ENV the Apigee environment where the demo resources should be created

Now source the env.sh file

source ./env.sh
  1. Deploy Apigee API proxies, products and apps
./deploy-threat-protection.sh

Testing the Proxy

To run the tests, first retrieve Node.js dependencies with:

npm install

and then run the tests:

npm run test

Cleanup

If you want to clean up the artifacts from this example in your Apigee Organization, first source your env.sh script, and then run

./clean-up-threat-protection.sh