Imperva Cloud WAF¶
Imperva Cloud WAF (formerly Incapsula) protects websites and APIs at Imperva's edge; one connector covers one Imperva account and all its sites.
- What DRACO uses: Access and security logs of your sites (SIEM logs, CEF) as events; the sites of the account; Attack Analytics incidents.
- What for: Detections, hunts and the ID directory on web traffic and WAF attacks, site names on events and assets, Attack Analytics incident import, IP blocking on your sites and a threat intel IP blocklist.
Add it in Connectors > Add connector: pick Imperva Cloud WAF, then choose what DRACO collects and what it may change. Add more later with Add a part on its connector page. See Connectors for how connectors, read and write access and tags work.
What you need¶
| Part | Imperva subscription |
|---|---|
| Logs | Cloud WAF with the Log Integration (SIEM logs) add-on |
| Directory (the sites) | Any Cloud WAF account |
| Incidents | Attack Analytics |
| Block and unblock IPs, the threat intel IP blocklist | Any Cloud WAF account |
- An account administrator of the Imperva Cloud Security Console: only administrators set up log connections and add users and API keys.
- One connection is one Imperva account. A sub-account is connected on its own, with its own account ID.
- Network: pull only. DRACO reads Imperva's log server (
logs1.incapsula.com) and calls Imperva's API over HTTPS. Nothing has to reach DRACO from your network.
Parts¶
Imperva has separate keys for its log server and for its API, so a full setup uses up to three keys, each created once.
| Part | What DRACO uses | Access | Imperva key |
|---|---|---|---|
| Logs | Access and security logs of your sites | read | the log connection's API ID and key |
| Directory | The sites of the account (site ID and domain) | read | an account API key of a user with the Reader role |
| Incidents | Attack Analytics incidents | read | the same account API key (Reader) |
| Response | Block IP, Unblock IP | write | a second account API key allowed to edit policies |
| Enforcement | Imperva Cloud WAF blocked IPs (threat intel IP blocklist) | write | the same second account API key |
Read access: the log connection¶
- Sign in to the Imperva Cloud Security Console as an account administrator.
- Open Account Management > SIEM Logs > Log Configuration (older consoles: Logs > Log Setup).
- Click Add connection. Delivery method (Connection): Imperva API. Name:
DRACO. - Click Generate API keys. Copy the API ID, the API key and the Log Server URL (it looks like
https://logs1.incapsula.com/1234_5678/): Imperva shows the API key only once. - On the new connection click Add log type and pick Cloud WAF.
- Format:
CEF. Log types: Access logs and Security logs. Compress logs: on or off, DRACO reads both. Save. - Encryption (optional): leave it off for now. DRACO makes a key pair for this connection when you save it; see Encrypted log files to turn encryption on afterwards.
- Copy your account ID: click the account name at the top of the console; the ID is the number in brackets after the name.
- Back in DRACO, on Account enter the Account ID and the Log server URL. On Sign in choose Create a new credential and fill in the API ID and the API key, then click Next.
Test signs in to the log server and reads its list of log files; the connection is created only after a passing test.
| Setting in Imperva | Value |
|---|---|
| Delivery method | Imperva API |
| Log type | Cloud WAF |
| Format | CEF |
| Log types | Access logs and Security logs |
| Compression | On or off |
| Encryption | Off, or on with the public key DRACO shows for this connection |
Encrypted log files¶
DRACO makes a key pair for the log source when the connector is saved and shows its public key under Log encryption key: on the wizard's last step (Done) and on the log source's page (open the source from the connector's page). The private key never leaves DRACO.
- Copy the public key with its copy button.
- In Imperva, open Account Management > SIEM Logs > Log Configuration, open the Cloud WAF log type of the
DRACOconnection, turn encryption on and paste the key. Save.
DRACO decrypts the files itself; files that are not encrypted are read as they are. A source without a key (made before) shows Generate key.
Rotation. Rotate key on the log source's page makes a new key pair and asks first: paste the new public key into the log type's encryption setting right after, since Imperva keeps encrypting with the key before until then. Files encrypted with the key before still decrypt.
Rotation of the log connection keys. The log connection keys work only for the log server. To rotate them, generate new API keys on the DRACO log connection and paste them into the DRACO credential (Settings > Credentials).
Imperva documents the log connection in its log integration guide.
Logs¶
The Imperva Cloud WAF data source pulls the log files of the log connection: every request to your sites (access logs) and every request a security rule acted on (security logs), with the client IP, country, site, URL, response code, the rule and the action Imperva took.
- Imperva writes a log file about 10 minutes after the requests (30 minutes or more under heavy load); DRACO reads new files every few minutes and continues after the last file it read, so a paused source catches up.
- A file read twice (a retried run) is stored once.
Read access: the account API key¶
The log connection keys cannot read the sites or Attack Analytics. Directory and Incidents use an account API key of an API-only user with the Reader role. Skip this until you turn on one of them.
- Open Account Management > User Management > Users and click Add User. Name:
DRACO read. Email: a mailbox of your team. Choose Assign a role and pick Reader. Click Save. - Open the new user. In the right panel choose Actions > Set as API-only use: the user never signs in to the console.
- In the right panel open API Keys and click Add API Key. Name:
DRACO read. Set an expiry date, turn Status on and click Save. - Copy the API ID and the API key: Imperva shows them only once.
- In DRACO, tick Directory, Incidents or both on the Collectors step. On Sign in, under Imperva API key (below the log connection's key), choose Create a new credential and fill in the API ID and the API key.
Without this key, Directory and Incidents cannot be turned on: the wizard asks for it on Sign in. Test checks each part on its own: the log server with the log connection keys, the sites and Attack Analytics with the account API key, and the write key when you add it; a missing permission is named on its row.
Expiry and rotation. The key stops working on the expiry date you set. To rotate, add a new API key to the same user, then either paste it into the DRACO credential (Settings > Credentials) or pick a new credential with Update Credentials on the connector, which changes the key of Directory and Incidents together. Then delete the old key.
Directory¶
Pulls the sites of the account into the ID directory (readable names for alerts, incidents and investigations) and the assets: site ID and domain. DRACO also learns sites from the events. Tick Directory on the Collectors step (or turn on Directory on the connection) and run Test.
Permissions (read): the Reader role of the account API key reads the sites; nothing else to grant.
DRACO reads the directory every hour and in full once a day. When the pull fails three times in a row, the connection shows the error and a connector health problem is opened.
Incidents¶
Imports Attack Analytics incidents as DRACO incidents: Imperva groups the security events of your sites into incidents by attacker, tool and target, with a severity and the attacked sites. How sync works for every vendor is in Incident connectors. Attack Analytics is a separate Imperva subscription.
Import: the account API key (Reader) reads the incidents. Nothing else to create. Tick Incidents on the Collectors step.
Responders: what DRACO may change¶
Response actions and the threat intel blocklist use a second account API key that may edit policies, so the read keys never change anything. DRACO blocks IPs with an access control (ACL) policy of its own, named DRACO blocked IPs, with a blocked IPs rule, and applies it to your sites; your own policies and rules are never touched.
- Open Account Management > User Management > Roles and click Add Role. Name:
DRACO write. Tick the permissions to view sites and to view and edit policies. Click Save. - Open Account Management > User Management > Users and click Add User. Name:
DRACO write. Email: a mailbox of your team. Choose Assign a role and pick DRACO write. Click Save. - Open the new user and choose Actions > Set as API-only use. Then open API Keys, click Add API Key, name it
DRACO write, set an expiry date, turn Status on and click Save. - Copy the API ID and the API key (shown only once).
- In DRACO, on Write access choose Create a new credential and fill in the API ID and the API key.
- Test reads the policies of the account and checks the key's rights without changing anything; a missing permission is named.
If your account cannot create custom roles, give the API user the Administrator role instead.
Response actions¶
| Action | What it does |
|---|---|
| Block IP (Imperva Cloud WAF) | Adds the IP to the blocked IPs of DRACO's ACL policy: Imperva blocks its requests to your sites at the edge; undo unblocks it |
| Unblock IP (Imperva Cloud WAF) | Removes the IP from DRACO's ACL policy |
Every action reads the current state first (already blocked), and a dry run shows the exact request without sending it.
Threat intel blocklist¶
The Imperva Cloud WAF blocked IPs enforcement target keeps the IP and range indicators of a selection in DRACO's ACL policy; IPs blocked by response actions and your own rules are never touched. See Enforcement.
Troubleshooting¶
| Last error | Fix |
|---|---|
| The log server refused the API ID and key | Check the keys of the DRACO log connection; generated again in Imperva, the old ones stop working. |
| The log server has no files | Check that the log connection has the Cloud WAF log type with Access logs and Security logs; the first file arrives about 10 minutes after the setup. |
| The log files are encrypted with another key | Paste the public key under Log encryption key on the log source's page into the log type's encryption setting, or turn encryption off. |
| Imperva refused the API key | The account API key expired, was turned off or deleted: add a new one to the API user and paste it into the DRACO credential. |
| The API key lacks the permission to edit policies | Use the key of a user whose role may view and edit policies as the write credential. |
Not covered yet¶
- Imperva log types other than Cloud WAF access and security logs (such as network DDoS protection and audit trail logs).
- Two-way sync of Attack Analytics incidents: status and comments stay in DRACO.