This sample shows how to implement threat protection using Apigee's RegularExpression Policy policy and JSONThreatProtection Policy policy
Let's get started!
- Provision Apigee X
- Configure external access for API traffic to your Apigee X instance
- Access to deploy proxies, create products, apps and developers in Apigee
- Make sure the following tools are available in your terminal's $PATH (Cloud Shell has these preconfigured)
- gcloud SDK
- unzip
- curl
- jq
- npm
Use the following GCP CloudShell tutorial, and follow the instructions.
- Clone the
apigee-samples
repo, and switch to thethreat-protection
directory
git clone https://github.com/GoogleCloudPlatform/apigee-samples.git
cd apigee-samples/threat-protection
- Edit
env.sh
and configure the following variables:
PROJECT
the project where your Apigee organization is locatedAPIGEE_HOST
the externally reachable hostname of the Apigee environment group that contains APIGEE_ENVAPIGEE_ENV
the Apigee environment where the demo resources should be created
Now source the env.sh
file
source ./env.sh
- Deploy Apigee API proxies, products and apps
./deploy-threat-protection.sh
To run the tests, first retrieve Node.js dependencies with:
npm install
and then run the tests:
npm run test
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