Imperva-WAF_direct-access is a project designed to help you check whether the backend of your websites behind an Imperva Web Application Firewall (WAF) is directly accessible without going through the WAF. This can be a valuable security measure to ensure that traffic is routed through your WAF as recommended (c.f. Imperva Documentation).
- Check if backend servers are directly accessible without the WAF.
- Option to list only the websites names (to see exactly what sites are secured by your WAF).
- User-friendly and easy to run.
-
Clone this repository:
git clone https://github.com/cletqui/Imperva-WAF_direct-access.git
-
Navigate to the project directory:
cd Imperva-WAF_direct-access
-
Make the script executable:
chmod +x check_direct_access.sh
To use this repository with Imperva API, you need to create a .env
file in the project directory with the following credentials:
-
API Endpoint: Set the API endpoint URL as follows:
API_ENDPOINT="https://my.imperva.com/api/prov/v1/sites/list"
-
API Credentials: Provide your Imperva API credentials:
- API_ID: Your API ID
- API_KEY: Your API Key
API_ID=00000 API_KEY="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
-
Account ID: Specify your Imperva Account ID:
ACCOUNT_ID=0000000
Ensure that you replace the placeholder values with your actual Imperva API information. Keep this .env
file secure and do not share it publicly. It is explicitely excluded in .gitignore
.
To use this script, you can run it from the command line with the following options:
./check_direct_access.sh check.py [OPTIONS]
Remember to replace the option values with your specific choices and ensure that you have created a .env
file with your Imperva API credentials as explained in the previous section.
-v, --verbose
: Enable verbose mode (log it into logs.txt).-a, --all
: Include all websites (only unsafe websites by default).-o, --output <file>
: Specify the output file (with a .json extension).-t, --timeout <timeout>
: Specify the timeout in seconds (positive integer).-l, --list-only
: List only websites (no check is performed).-e, --env <file>
: Specify the path to a .env file for environment variables.-h, --help
: Display this help message.
-
Basic Usage:
./check_direct_access.sh -v -a -o output.json -t 10 -e .env
-
Minimum Usage:
./check_direct_access.sh
-
Display Help:
./check_direct_access.sh -h
- Imperva for their Web Application Firewall technology.
- Contributors: List any contributors here.
- Return data in JSON.
- Add option to test only selected websites
- Improve user interface and error handling.
- Add additional security checks.
- Adapt shell scritp to Python.
If you have any questions or encounter issues, please open an issue.
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is actively maintained and open to contributions.