ASE identifies attackers for HTTP(s) protocol using five client identifiers:
- Username
- API keys
- OAuth2 token
- Cookie
- IP address
The following sections describe how to configure ASE to capture OAuth2 Tokens and API keys.
Configure ASE support for OAuth2 tokens
ASE supports capturing and blocking of OAuth2 tokens. To enable OAuth2 token capture, set the value of oauth2_access_token to true in the API JSON file. Here is a snippet of an API JSON file with OAuth2 token capture activated. To disable, change the value to false.
"api_metadata": {
"protocol": "http",
"url": "/",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": true,
"oauth2_access_token": true,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
When blocking is enabled, ASE checks the token against the list of tokens in the whitelist and blacklist. If the token is in the blacklist, the client using the token is immediately blocked.
The following diagram shows the traffic flow in an OAuth2 environment:
Configure ASE support for API keys
ASE supports capturing and blocking of API keys. Depending on the API setup, the API key can be captured from the query string or API header. Each API JSON file can be configured with either the query string (apikey_qs) or API header (apikey_header) parameter.
Here is a snippet of an API JSON file showing API key being configured to capture the API key
from the Query String (apikey_qs
).
"api_metadata": {
"protocol": "http",
"url": "/",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": true,
"oauth2_access_token": true,
"apikey_qs": "key_1.4",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
When an API key is included in the API JSON file, ASE supports blocking of API keys which are manually added to the blacklist.