Imperva Cloud Application Security

App · 22 actions

Manage the websites Imperva protects: block IP addresses, countries and URLs, set threat protection, add custom rules, apply policies, purge the cache, and read visits, statistics and audit events.

Actions

ActionWhat it does
Add siteAdd a website to the account.
Apply policy to siteApply a policy to a website.
Create custom ruleAdd a custom security rule to a website: alert on, block or challenge the requests its filter matches.
Delete custom ruleDelete a website's custom rule.
Delete siteRemove a website from Imperva.
Get accountGet the account's plan, name and settings.
Get audit eventsList who did what in the account: sign-ins, setting changes and API calls.
Get custom ruleGet a website's custom rule.
Get policyGet a policy with its settings.
Get siteGet a website's status, DNS records to set, and security settings, optionally running checks first.
Get traffic statisticsGet visits, hits, bandwidth, caching, threats and custom rule statistics for the account or one website.
Get visitsList recent visits to a website, newest first, optionally only those Imperva acted on, or from one country or IP address.
List data centersList a website's origin data centers and their servers.
List policiesList the account's security policies: access lists, allow lists and WAF settings shared across websites.
List site rulesList a website's custom security rules and delivery rules.
List sitesList the websites the account protects, 50 at a time unless a page size is given.
List sub-accountsList the sub-accounts the account manages.
Purge site cacheClear a website's cached content, or only the resources matching a pattern.
Remove policy from siteStop applying a policy to a website.
Set blocked or allowed listReplace a website's blocked IP addresses, allowed IP addresses, blocked countries or blocked URLs with the values given.
Set threat protectionChoose what Imperva does when it finds SQL injection, cross-site scripting, illegal resource access, remote file inclusion or a backdoor on a website.
Update custom ruleReplace a custom rule's name, action, filter and whether it's on.

Add site

Add a website to the account. If it's already there, its status comes back.

Inputs

DomaindomaintextRequired
The website's domain, such as www.example.com.
Account IDaccount_idtext
A sub-account or managed account to act on. Leave empty for the connected account.
Send setup emailssend_site_setup_emailstrue/false
Email the account's users the DNS and SSL setup steps. Defaults to off.
Reference IDref_idtext
Your own reference for the site.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "acceleration_level": "example",
    "account_id": 1,
    "active": "example",
    "display_name": "example",
    "dns": [
      {
        "dns_record_name": "example",
        "set_data_to": [
          "example"
        ],
        "set_type_to": "example"
      }
    ],
    "domain": "example",
    "ips": [
      "example"
    ],
    "original_dns": [
      {
        "dns_record_name": "example",
        "set_data_to": [
          "example"
        ],
        "set_type_to": "example"
      }
    ],
    "res": 1,
    "res_message": "example",
    "security": {},
    "site_creation_date": 1,
    "site_id": 1,
    "status": "example",
    "warnings": [
      {}
    ]
  }
}

Apply policy to site

Apply a policy to a website.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Policypolicy_idtextRequired
The policy.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "applied": true,
    "policy_id": "example",
    "site_id": "example"
  }
}

Create custom rule

Add a custom security rule to a website: alert on, block or challenge the requests its filter matches.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
NamenametextRequired
The rule's name.
Actionrule_actiontextRequired
What the rule does to matching requests.One of: RULE_ACTION_ALERT (Alert), RULE_ACTION_BLOCK (Block the request), RULE_ACTION_BLOCK_USER (Block the session), RULE_ACTION_BLOCK_IP (Block the IP address), RULE_ACTION_CAPTCHA (Require a CAPTCHA), RULE_ACTION_RETRY (Require cookie support), RULE_ACTION_INTRUSIVE_HTML (Require JavaScript support).
Filterfiltertext
Which requests the rule matches, in Imperva's rule syntax, such as ClientIP == 192.0.2.10. Leave empty to match every request.
Enabledenabledtrue/false
Whether the rule is on. Defaults to on.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "action": "example",
    "enabled": true,
    "filter": "example",
    "name": "example",
    "rule_id": 1
  }
}

Delete custom rule

Delete a website's custom rule.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Rule IDrule_idnumberRequired
The rule's ID, which Create custom rule and List site rules return.At least 1.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "deleted": true,
    "rule_id": "example"
  }
}

Delete site

Remove a website from Imperva. Its traffic stops being protected.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example"
  }
}

Get account

Get the account's plan, name and settings.

Inputs

Account IDaccount_idtext
A sub-account or managed account to act on. Leave empty for the connected account.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "account": {},
    "res": 1,
    "res_message": "example"
  }
}

Get audit events

List who did what in the account: sign-ins, setting changes and API calls.

Inputs

Account IDaccount_idtext
A sub-account or managed account to act on. Leave empty for the connected account.
Time rangetime_rangetext
A named time range. Use From and To instead for your own range.One of: today, last_7_days (Last 7 days), last_30_days (Last 30 days), last_90_days (Last 90 days), month_to_date (Month to date).
Fromstart_timedate and time
The start of your own time range.
Toend_timedate and time
The end of your own time range.
Event typetypetext
Only events of this type, such as audit.account_login.
Page sizepage_sizenumber
How many to return, up to 100.From 1 to 100.
Pagepage_numnumber
The page to return, counting from 0.At least 0.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "audit_events": [
      {}
    ],
    "res": 1,
    "res_message": "example"
  }
}

Get custom rule

Get a website's custom rule.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Rule IDrule_idnumberRequired
The rule's ID, which Create custom rule and List site rules return.At least 1.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "action": "example",
    "enabled": true,
    "filter": "example",
    "name": "example",
    "rule_id": 1
  }
}

Get policy

Get a policy with its settings.

Inputs

Policypolicy_idtextRequired
The policy.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "isError": true,
    "value": {
      "accountId": 1,
      "description": "example",
      "enabled": true,
      "id": 1,
      "isMarkedAsDefault": true,
      "name": "example",
      "policySettings": [
        {
          "data": {},
          "policySettingType": "example",
          "settingsAction": "example"
        }
      ],
      "policyType": "example"
    }
  }
}

Get site

Get a website's status, DNS records to set, and security settings, optionally running checks first.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Checkstestslist
Checks to run before answering.One or more of: domain_validation (Domain validation), services, dns.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "acceleration_level": "example",
    "account_id": 1,
    "active": "example",
    "display_name": "example",
    "dns": [
      {
        "dns_record_name": "example",
        "set_data_to": [
          "example"
        ],
        "set_type_to": "example"
      }
    ],
    "domain": "example",
    "ips": [
      "example"
    ],
    "original_dns": [
      {
        "dns_record_name": "example",
        "set_data_to": [
          "example"
        ],
        "set_type_to": "example"
      }
    ],
    "res": 1,
    "res_message": "example",
    "security": {},
    "site_creation_date": 1,
    "site_id": 1,
    "status": "example",
    "warnings": [
      {}
    ]
  }
}

Get traffic statistics

Get visits, hits, bandwidth, caching, threats and custom rule statistics for the account or one website.

Inputs

StatisticsstatslistRequired
The statistics to get.One or more of: visits_timeseries (Visits timeseries), hits_timeseries (Hits timeseries), bandwidth_timeseries (Bandwidth timeseries), requests_geo_dist_summary (Requests by country), visits_dist_summary (Visits by client), caching, caching_timeseries (Caching timeseries), threats, incap_rules (Custom rules), incap_rules_timeseries (Custom rules over time).
Sitesite_idnumber
One website. Leave empty for the whole account.At least 1.
Account IDaccount_idtext
A sub-account or managed account to act on. Leave empty for the connected account.
Time rangetime_rangetext
A named time range. Defaults to the last 7 days; use From and To for your own range.One of: today, last_7_days (Last 7 days), last_30_days (Last 30 days), last_90_days (Last 90 days), month_to_date (Month to date).
Fromstart_timedate and time
The start of your own time range.
Toend_timedate and time
The end of your own time range.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "bandwidth_timeseries": [
      {}
    ],
    "caching": {},
    "caching_timeseries": [
      {}
    ],
    "hits_timeseries": [
      {}
    ],
    "incap_rules": [
      {}
    ],
    "incap_rules_timeseries": [
      {}
    ],
    "requests_geo_dist_summary": {},
    "res": 1,
    "res_message": "example",
    "threats": [
      {}
    ],
    "visits_dist_summary": [
      {}
    ],
    "visits_timeseries": [
      {}
    ]
  }
}

Get visits

List recent visits to a website, newest first, optionally only those Imperva acted on, or from one country or IP address.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Time rangetime_rangetext
A named time range. Use From and To instead for your own range.One of: today, last_7_days (Last 7 days), last_30_days (Last 30 days), last_90_days (Last 90 days), month_to_date (Month to date).
Fromstart_timedate and time
The start of your own time range.
Toend_timedate and time
The end of your own time range.
Security eventssecuritylist
Only visits Imperva handled this way, such as blocked IP addresses or SQL injection.One or more of: api.threats.action.block_request (Block the request), api.threats.action.block_user (Block the user), api.threats.action.block_ip (Block the IP address), api.threats.action.alert (Alert only), api.threats.sql_injection (SQL injection), api.threats.cross_site_scripting (Cross-site scripting), api.threats.illegal_resource_access (Illegal resource access), api.threats.remote_file_inclusion (Remote file inclusion), api.threats.backdoor (Backdoor protection).
Countrycountrytext
Only visits from this two-letter country code.
IP addressiptext
Only visits from this IP address.
Include live visitslist_live_visitstrue/false
Include visits still in progress. Defaults to on.
Page sizepage_sizenumber
How many to return, up to 100.From 1 to 100.
Pagepage_numnumber
The page to return, counting from 0.At least 0.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example",
    "visits": [
      {
        "actions": [
          {}
        ],
        "clientApplication": "example",
        "clientIPs": [
          "example"
        ],
        "clientType": "example",
        "country": [
          "example"
        ],
        "countryCode": [
          "example"
        ],
        "endTime": 1,
        "entryPage": "example",
        "hits": 1,
        "id": "example",
        "pageViews": 1,
        "securitySummary": {},
        "siteId": 1,
        "startTime": 1,
        "userAgent": "example"
      }
    ]
  }
}

List data centers

List a website's origin data centers and their servers.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "DCs": [
      {}
    ],
    "res": 1,
    "res_message": "example"
  }
}

List policies

List the account's security policies: access lists, allow lists and WAF settings shared across websites.

Inputs

None.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "isError": true,
    "value": [
      {
        "accountId": 1,
        "description": "example",
        "enabled": true,
        "id": 1,
        "isMarkedAsDefault": true,
        "name": "example",
        "policySettings": [
          {
            "data": {},
            "policySettingType": "example",
            "settingsAction": "example"
          }
        ],
        "policyType": "example"
      }
    ]
  }
}

List site rules

List a website's custom security rules and delivery rules.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Security rulesinclude_security_rulestrue/false
Include the security rules. Defaults to on.
Delivery rulesinclude_delivery_rulestrue/false
Include the delivery rules (redirects and rewrites). Defaults to on.
Page sizepage_sizenumber
How many to return, up to 100.From 1 to 100.
Pagepage_numnumber
The page to return, counting from 0.At least 0.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "delivery_rules": {},
    "incap_rules": {},
    "res": 1,
    "res_message": "example"
  }
}

List sites

List the websites the account protects, 50 at a time unless a page size is given.

Inputs

Account IDaccount_idtext
A sub-account or managed account to act on. Leave empty for the connected account.
Page sizepage_sizenumber
How many to return, up to 100.From 1 to 100.
Pagepage_numnumber
The page to return, counting from 0.At least 0.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example",
    "sites": [
      {
        "acceleration_level": "example",
        "account_id": 1,
        "active": "example",
        "display_name": "example",
        "dns": [
          {
            "dns_record_name": "example",
            "set_data_to": [
              "example"
            ],
            "set_type_to": "example"
          }
        ],
        "domain": "example",
        "ips": [
          "example"
        ],
        "original_dns": [
          {
            "dns_record_name": "example",
            "set_data_to": [
              "example"
            ],
            "set_type_to": "example"
          }
        ],
        "security": {},
        "site_creation_date": 1,
        "site_id": 1,
        "status": "example",
        "warnings": [
          {}
        ]
      }
    ]
  }
}

List sub-accounts

List the sub-accounts the account manages.

Inputs

Account IDaccount_idtext
A sub-account or managed account to act on. Leave empty for the connected account.
Page sizepage_sizenumber
How many to return, up to 100.From 1 to 100.
Pagepage_numnumber
The page to return, counting from 0.At least 0.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example",
    "resultList": [
      {}
    ]
  }
}

Purge site cache

Clear a website's cached content, or only the resources matching a pattern.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Patternpurge_patterntext
Only resources whose names match: name (contains), ^name (starts with) or name$ (ends with). Leave empty to purge everything.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example"
  }
}

Remove policy from site

Stop applying a policy to a website.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Policypolicy_idtextRequired
The policy.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "applied": true,
    "policy_id": "example",
    "site_id": "example"
  }
}

Set blocked or allowed list

Replace a website's blocked IP addresses, allowed IP addresses, blocked countries or blocked URLs with the values given. An empty list clears it.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Listrule_idtextRequired
Which list to replace.One of: api.acl.blacklisted_ips (Blocked IP addresses), api.acl.whitelisted_ips (Allowed IP addresses), api.acl.blacklisted_countries (Blocked countries and continents), api.acl.blacklisted_urls (Blocked URLs).
IP addressesipslist
For an IP list: IP addresses, ranges or CIDR blocks, such as 192.0.2.1, 192.0.2.1-192.0.2.100 or 192.0.2.0/24.
Countriescountrieslist
For blocked countries: two-letter country codes, such as RU.
Continentscontinentslist
For blocked countries: continent codes (AF, AN, AS, EU, NA, OC, SA).One or more of: AF, AN, AS, EU, NA, OC, SA.
URLsurlslist
For blocked URLs: paths on the site, such as /admin.
URL matchurl_patterntext
For blocked URLs: how each path is matched. Defaults to contains.One of: contains, equals, prefix, suffix, not_equals (Not equals), not_contains (Not contains), not_prefix (Not prefix), not_suffix (Not suffix).

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example"
  }
}

Set threat protection

Choose what Imperva does when it finds SQL injection, cross-site scripting, illegal resource access, remote file inclusion or a backdoor on a website.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Threatrule_idtextRequired
The threat.One of: api.threats.sql_injection (SQL injection), api.threats.cross_site_scripting (Cross-site scripting), api.threats.illegal_resource_access (Illegal resource access), api.threats.remote_file_inclusion (Remote file inclusion), api.threats.backdoor (Backdoor protection).
Actionsecurity_rule_actiontextRequired
What to do when it's found.One of: api.threats.action.block_request (Block the request), api.threats.action.block_user (Block the user), api.threats.action.block_ip (Block the IP address), api.threats.action.alert (Alert only), api.threats.action.quarantine_url (Quarantine the URL (backdoors only)), api.threats.action.disabled (Ignore).

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "res": 1,
    "res_message": "example"
  }
}

Update custom rule

Replace a custom rule's name, action, filter and whether it's on.

Inputs

Sitesite_idnumberRequired
The website, by its Imperva site ID.At least 1.
Rule IDrule_idnumberRequired
The rule's ID, which Create custom rule and List site rules return.At least 1.
NamenametextRequired
The rule's name.
Actionrule_actiontextRequired
What the rule does to matching requests.One of: RULE_ACTION_ALERT (Alert), RULE_ACTION_BLOCK (Block the request), RULE_ACTION_BLOCK_USER (Block the session), RULE_ACTION_BLOCK_IP (Block the IP address), RULE_ACTION_CAPTCHA (Require a CAPTCHA), RULE_ACTION_RETRY (Require cookie support), RULE_ACTION_INTRUSIVE_HTML (Require JavaScript support).
Filterfiltertext
Which requests the rule matches, in Imperva's rule syntax, such as ClientIP == 192.0.2.10. Leave empty to match every request.
Enabledenabledtrue/false
Whether the rule is on. Defaults to on.

Outputs

dataobject
The response from Imperva Cloud Application Security.
Example output
{
  "data": {
    "action": "example",
    "enabled": true,
    "filter": "example",
    "name": "example",
    "rule_id": 1
  }
}

On this page