Imperva
23 min
the imperva connector allows for automated policy management and enhanced security operations by integrating imperva's cybersecurity solutions with the swimlane platform imperva, a leading provider of cybersecurity solutions, offers an api for managing security policies and configurations the imperva connector for swimlane turbine allows users to seamlessly retrieve, modify, and update security policies, enhancing their security posture without the need for complex coding by integrating with imperva, swimlane turbine users can leverage advanced security settings, manage policy exceptions, and ensure consistent protection across their digital assets this connector empowers security teams to automate their policy management tasks, ensuring swift and accurate security responses the imperva connector integrates with imperva cloud services to manage and retrieve policies this integration allows users to automate policy management tasks, enhancing security and compliance workflows limitations none to date supported versions this connector supports the latest version of the imperva policies api additional docs links to third party vendor’s api documentation https //docs imperva com/bundle/cloud application security/page/policies api definition htm https //docs imperva com/bundle/api docs/page/api/authentication htm configuration prerequisites to effectively utilize the imperva connector with swimlane turbine, ensure you have the following prerequisites api key authentication url the endpoint url for the imperva api api key your unique identifier to authenticate with the imperva api api id the api id associated with your imperva account for identification authentication methods the following authentication methods are supported for this connector api key authentication setup instructions log in to your imperva cloud services account navigate to the api section and generate a new api key copy the api id and api key and use it in the connector configuration the url will be https //www api imperva com https //docs imperva com/bundle/cloud application security/page/settings/api keys htm troubleshooting tips ensure the api key has the necessary permissions verify that the api key is not expired or revoked capabilities this connector provides the following capabilities get policy modify policy update policy get policy retrieve policy details modify policy modify an existing policy (partial update) when sending the content in the "data" attribute, it will be appended and not overwritten when updating an existing policy settings or exceptions, the relevant id (policy settings or exception id) must be provided update policy overwrite an existing policy(full update) configurations imperva api authentication authenticates using api key and api id configuration parameters parameter description type required url a url to the target host string required x api key api key string required x api id api id string required actions get policy retrieves the details of a specified policy in imperva using the policyid as a required path parameter endpoint url /policies/v2/policies/{{policyid}} method get input argument name type required description parameters caid number optional by default, the policy is retrieved for the account (a) associated with the api credentials used for authentication to retrieve the policy for a different account (an account under the account (a)), specify the account id parameters extended boolean optional optional to get full policy data default is false when set to false, the response returns basic policy details such as name, id, and policy type, according to getleanpoliciesresponse this is the default value if set to true, the response returns full policy details, including current configuration and settings, according to getpoliciesresponse path parameters policyid string required the policy id input example {"parameters" {"caid" 20,"extended"\ true},"path parameters" {"policyid" "string"}} output parameter type description status code number http status code of the response reason string response reason phrase value object value for the parameter value id number unique identifier value policytype string type of the resource value name string name of the resource value description string value for the parameter value lastmodified string value for the parameter value lastmodifiedby number value for the parameter value lastusermodified string value for the parameter value numberofassets number value for the parameter value ismarkedasdefault boolean value for the parameter iserror boolean error message if any output example {"status code" 200,"response headers" {},"reason" "ok","json body" {"value" {"id" 10,"policytype" "acl","name" "block ip policy","description" "string","lastmodified" "2024 10 10t06 54 37 640z","lastmodifiedby" 0,"lastusermodified" "string","numberofassets" 0,"ismarkedasdefault"\ true},"iserror"\ false}} modify policy appends content to an existing imperva policy without overwriting, using the 'data' attribute and requires a policyid endpoint url /policies/v2/policies/{{policyid}} method post input argument name type required description parameters caid number optional by default, the policy is retrieved for the account (a) associated with the api credentials used for authentication to retrieve the policy for a different account (an account under the account (a)), specify the account id path parameters policyid string required the policy id name string optional the policy name description string optional the policy description enabled boolean optional enable or disable the policy a waf rules policy is always created in the enabled state, and cannot be disabled accountid number optional the account id of the policy policytype string optional the policy type defaultpolicyconfig array optional sets the specified policy as default for the account, or indicates that the policy is set as default a default policy is used by any new website added to the account defaultpolicyconfig id number optional the id of this default policy configuration defaultpolicyconfig accountid number optional the account id defaultpolicyconfig assettype string optional the type of asset on which the policy is applied defaultpolicyconfig policyid number optional the id of this policy policysettings array optional parameter for modify policy policysettings id number optional the policy settings id policysettings policyid number optional the policy id of this setting policysettings settingsaction string optional the action taken by imperva when a policy rule is triggered policysettings policysettingtype string optional the policysettings type policysettings data object optional response data policysettings data geo object optional response data policysettings data geo countries array optional country codes array policysettings data geo continents array optional continent codes array policysettings data ips array optional response data policysettings data urls array optional response data policysettings data urls pattern string optional url pattern for rule policysettings data urls url string optional url value input example {"parameters" {"caid" 20},"json body" {"name" "block ip policy","description" "this is policy blocks all requests from europe ","enabled"\ true,"accountid" 10,"policytype" "acl","defaultpolicyconfig" \[{"id" 10,"accountid" 10,"assettype" "website","policyid" 8}],"policysettings" \[{"id" 10,"policyid" 10,"settingsaction" "block","policysettingtype" "ip/geo/url","data" {"geo" {"countries" \["ae","ac"],"continents" \["apac","us"]},"ips" \["string"],"urls" \[{"pattern" "equals","url" "/test"}]},"policydataexceptions" \[{"id" 10,"policysettingsid" 55,"data" \[{"exceptiontype" "geo","values" \["string"]}],"comment" "exclude all ips for pen tests","summary" "string"}]}]},"path parameters" {"policyid" "string"}} output parameter type description status code number http status code of the response reason string response reason phrase value object value for the parameter value name string name of the resource value description string value for the parameter value enabled boolean value for the parameter value accountid number unique identifier value policytype string type of the resource value defaultpolicyconfig array value for the parameter value defaultpolicyconfig id number unique identifier value defaultpolicyconfig accountid number unique identifier value defaultpolicyconfig assettype string type of the resource value defaultpolicyconfig policyid number unique identifier value policysettings array value for the parameter value policysettings id number unique identifier value policysettings policyid number unique identifier value policysettings settingsaction string value for the parameter value policysettings policysettingtype string type of the resource value policysettings data object response data value policysettings data geo object response data value policysettings data geo countries array response data value policysettings data geo continents array response data value policysettings data ips array response data value policysettings data urls array response data value policysettings data urls pattern string response data output example {"status code" 200,"response headers" {},"reason" "ok","json body" {"value" {"name" "block ip policy","description" "this is policy blocks all requests from europe","enabled"\ true,"accountid" 10,"policytype" "acl","defaultpolicyconfig" \[],"policysettings" \[]},"iserror"\ false}} update policy overwrite an existing policy on imperva by providing the policy id and updated settings including name, status, type, and configuration endpoint url /policies/v2/policies/{{policyid}} method put input argument name type required description parameters caid number optional by default, the policy is retrieved for the account (a) associated with the api credentials used for authentication to retrieve the policy for a different account (an account under the account (a)), specify the account id path parameters policyid string required the policy id name string optional the policy name description string optional the policy description enabled boolean optional enable or disable the policy a waf rules policy is always created in the enabled state, and cannot be disabled accountid number optional the account id of the policy policytype string optional the policy type defaultpolicyconfig array optional sets the specified policy as default for the account, or indicates that the policy is set as default a default policy is used by any new website added to the account defaultpolicyconfig id number optional the id of this default policy configuration defaultpolicyconfig accountid number optional the account id defaultpolicyconfig assettype string optional the type of asset on which the policy is applied defaultpolicyconfig policyid number optional the id of this policy policysettings array optional parameter for update policy policysettings id number optional the policy settings id policysettings policyid number optional the policy id of this setting policysettings settingsaction string optional the action taken by imperva when a policy rule is triggered policysettings policysettingtype string optional the policysettings type policysettings data object optional response data policysettings data geo object optional response data policysettings data geo countries array optional country codes array policysettings data geo continents array optional continent codes array policysettings data ips array optional response data policysettings data urls array optional response data policysettings data urls pattern string optional url pattern for rule policysettings data urls url string optional url value input example {"parameters" {"caid" 20},"json body" {"name" "block ip policy","description" "this is policy blocks all requests from europe ","enabled"\ true,"accountid" 10,"policytype" "acl","defaultpolicyconfig" \[{"id" 10,"accountid" 10,"assettype" "website","policyid" 8}],"policysettings" \[{"id" 10,"policyid" 10,"settingsaction" "block","policysettingtype" "ip/geo/url","data" {"geo" {"countries" \["ae","ac"],"continents" \["apac","us"]},"ips" \["string"],"urls" \[{"pattern" "equals","url" "/test"}]},"policydataexceptions" \[{"id" 10,"policysettingsid" 55,"data" \[{"exceptiontype" "geo","values" \["string"]}],"comment" "exclude all ips for pen tests","summary" "string"}]}]},"path parameters" {"policyid" "string"}} output parameter type description status code number http status code of the response reason string response reason phrase name string name of the resource description string output field description enabled boolean output field enabled accountid number unique identifier policytype string type of the resource defaultpolicyconfig array output field defaultpolicyconfig defaultpolicyconfig id number the id of this default policy configuration defaultpolicyconfig accountid number unique identifier defaultpolicyconfig assettype string type of the resource defaultpolicyconfig policyid number unique identifier policysettings array output field policysettings policysettings id number unique identifier policysettings policyid number unique identifier policysettings settingsaction string output field policysettings settingsaction policysettings policysettingtype string type of the resource policysettings data object response data policysettings data geo object response data policysettings data geo countries array response data policysettings data geo continents array response data policysettings data ips array response data policysettings data urls array response data policysettings data urls pattern string response data policysettings data urls url string response data output example {"status code" 200,"response headers" {},"reason" "ok","json body" {"name" "block ip policy","description" "this is policy blocks all requests from europe","enabled"\ true,"accountid" 10,"policytype" "acl","defaultpolicyconfig" \[{}],"policysettings" \[{}]}} response headers header description example content type the media type of the resource application/json date the date and time at which the message was originated thu, 01 jan 2024 00 00 00 gmt