124 Commits

Author SHA1 Message Date
github-actions[bot]
dd47e4b328 Update: [Mon Jan 6 00:28:11 UTC 2025] 2025-01-06 00:28:11 +00:00
github-actions[bot]
399ee7d20c Update: [Sun Jan 5 00:29:17 UTC 2025] 2025-01-05 00:29:17 +00:00
github-actions[bot]
d142c0ebaa Update: [Sat Jan 4 00:25:48 UTC 2025] 2025-01-04 00:25:48 +00:00
fab
5cf6e75096
Update badbots.py
feat: Integrate tqdm for progress tracking during bot list fetching
feat: Add regex filters to exclude IP addresses and domains from bot lists
refactor: Remove IP and domain-specific sources from BOT_LIST_SOURCES
refactor: Update parse_bot_list to skip lines matching IP or domain regex
refactor: Improve logging for better debugging and clarity
refactor: Use ThreadPoolExecutor with tqdm for concurrent fetching with progress
docs: Add comments and docstrings for better code understanding
chore: Ensure output directories exist before generating WAF configurations
2025-01-03 21:09:00 +01:00
fab
d77dbca4d8
Update owasp.py
* feat: add CLI support for output file and Git reference
* feat: implement atomic file writes for saving JSON
* feat: add dry-run mode to simulate fetching without saving
* feat: increase connection pool size to avoid "Connection pool is full" warnings
* feat: add progress bar for fetching and processing rule files
* feat: add retries for SHA verification in case of transient errors
* refactor: improve error handling for connection pool-related errors
* refactor: use ThreadPoolExecutor for parallel fetching of rule files
* refactor: improve logging with structured messages
* fix: handle edge cases in tag fetching logic
* fix: handle empty blob content gracefully
* fix: improve SHA verification logging
* docs: add comments and docstrings for better code readability
* chore: update requirements.txt to include tqdm
* test: add unit tests for critical functions
2025-01-03 20:58:23 +01:00
fab
b0705db71c
Update requirements.txt 2025-01-03 20:56:06 +01:00
fab
e5a7698724
Update README.md 2025-01-03 13:52:23 +01:00
github-actions[bot]
59dcd5155b Update: [Fri Jan 3 12:50:02 UTC 2025] 2025-01-03 12:50:02 +00:00
fab
76e6ccb5ce
Update update_patterns.yml 2025-01-03 13:49:41 +01:00
github-actions[bot]
8d87f12930 Update: [Fri Jan 3 12:48:10 UTC 2025] 2025-01-03 12:48:10 +00:00
fab
0b2aa45d4f
Update update_patterns.yml 2025-01-03 13:47:44 +01:00
github-actions[bot]
9c26633edc Update: [Fri Jan 3 12:45:52 UTC 2025] 2025-01-03 12:45:52 +00:00
fab
ba72f79990
Update update_patterns.yml 2025-01-03 13:45:28 +01:00
fab
cf43e2a382
Update update_patterns.yml 2025-01-03 13:43:55 +01:00
github-actions[bot]
d27e602eb2 Update: [Fri Jan 3 12:40:41 UTC 2025] 2025-01-03 12:40:41 +00:00
fab
88ff40dc10
Update update_patterns.yml 2025-01-03 13:40:18 +01:00
github-actions[bot]
0dfd63699d Update: [Fri Jan 3 12:38:40 UTC 2025] 2025-01-03 12:38:40 +00:00
fab
a03fd54da8
Update update_patterns.yml 2025-01-03 13:38:18 +01:00
github-actions[bot]
e3416a1bad Update: [Fri Jan 3 12:36:53 UTC 2025] 2025-01-03 12:36:53 +00:00
fab
65429e6a70
Update update_patterns.yml 2025-01-03 13:36:20 +01:00
github-actions[bot]
92e6b34844 Update: [Fri Jan 3 12:35:31 UTC 2025] 2025-01-03 12:35:31 +00:00
fab
87ed3d33b2
Update update_patterns.yml 2025-01-03 13:35:05 +01:00
github-actions[bot]
2a6d69c159 Update: [Fri Jan 3 12:33:57 UTC 2025] 2025-01-03 12:33:57 +00:00
fab
9979cba21e
Update update_patterns.yml 2025-01-03 13:33:35 +01:00
github-actions[bot]
cb25ab6582 Update: [Fri Jan 3 12:31:45 UTC 2025] 2025-01-03 12:31:45 +00:00
fab
1f4aefe3ad
Update update_patterns.yml 2025-01-03 13:31:22 +01:00
fab
c7e6223731
Delete waf_patterns/caddy directory 2025-01-03 13:28:13 +01:00
github-actions[bot]
911e47401b Update: [Fri Jan 3 12:26:53 UTC 2025] 2025-01-03 12:26:53 +00:00
fab
add09f044a
Update README.md 2025-01-03 13:25:16 +01:00
fab
472b26aef4
Update README.md 2025-01-03 13:24:40 +01:00
fab
9aba2163c2
Update owasp.py
Minor improvements.
2025-01-03 13:22:31 +01:00
fab
61e1a856c9
Update badbots.py
Improved error handling, logging and code structure.
2025-01-03 13:20:01 +01:00
fab
2356cdcff0
Update owasp2nginx.py 2025-01-03 13:18:21 +01:00
fab
8dcbfbeda4
Update import_nginx_waf.py 2025-01-03 13:17:55 +01:00
fab
a93481de4f
Update import_nginx_waf.py 2025-01-03 13:17:10 +01:00
fab
7ada922222
Update owasp2nginx.py 2025-01-03 13:16:19 +01:00
fab
77cecae490
Update import_haproxy_waf.py 2025-01-03 13:15:27 +01:00
fab
2c1401c1cf
Update owasp2haproxy.py
- Error Handling:
    - Added error handling for file operations, JSON parsing, and invalid rule structures.
    - Logs warnings for invalid rules instead of crashing.

- Path Handling:
    - Used pathlib.Path for better path manipulation and readability.
Made paths configurable via environment variables.

- Logging:
    - Replaced print() with Python's logging module for more flexible and structured logging.

- Input Validation:
    - Added checks for missing keys in the input JSON file.

- Rule Formatting:
    - Ensured proper formatting of HAProxy ACL rules.

- Output Directory Permissions:
    - Ensured the output directory is created with parents=True to handle nested directories.

- Code Structure:
    - Encapsulated the main logic in a main() function for better organization.
    - Added docstrings to functions for clarity.
2025-01-03 13:14:27 +01:00
fab
4655a25c4d
Update import_apache_waf.py
- Error Handling: Added try-except blocks to handle file operations, subprocess commands, and permission issues. Logs detailed error messages for debugging.
- Path Handling: Used pathlib.Path for better path manipulation and readability. Made paths configurable via environment variables.
- File Permissions: Ensured the target directory is created with parents=True to handle nested directories. Checked if files already exist in the target directory to avoid unnecessary overwrites.
- Logging: Added more detailed logging for better transparency and debugging.
- Subprocess Security: Added checks for apachectl and systemctl commands to ensure compatibility with supported systems.
- Input Validation: Validated the existence of .conf files before copying them.
- Code Structure: Encapsulated the main logic in a main() function for better organization.
- Added docstrings to functions for clarity.
2025-01-03 13:12:12 +01:00
fab
55297a76cf
Update owasp2apache.py
- Error Handling: Added error handling for file operations, JSON parsing, and invalid rule structures. Logs warnings for invalid rules instead of crashing.
- Unique Rule IDs: Each rule is assigned a unique id to avoid collisions in ModSecurity.
- Path Handling: Used pathlib.Path for better path manipulation and readability.
- Logging: Replaced print() with Python's logging module for more flexible and structured logging.
- Input Validation: Added checks for missing keys in the input JSON file.
- Template for Rules: Used a template string (MODSEC_RULE_TEMPLATE) for consistent rule formatting.
- Output Directory Permissions: Ensured the output directory is created with parents=True to handle nested directories.
2025-01-03 13:09:05 +01:00
fab
e59be8dd91
Update import_traefik_waf.py
Minor improvements,
2025-01-03 13:06:49 +01:00
fab
c7a580c983
Update owasp2traefik.py
Should fix resulting exported rules to match Traefik standards.
2025-01-03 11:31:58 +01:00
github-actions[bot]
93271ca213 Update: [Fri Jan 3 00:25:56 UTC 2025] 2025-01-03 00:25:56 +00:00
fab
9d057542c3
Update update_patterns.yml
Caddy support removed. 
Please check [this](https://github.com/fabriziosalmi/caddy-waf/)  project instead.
2025-01-03 00:15:47 +01:00
fab
75770a28ce
Update README.md 2025-01-02 19:08:47 +01:00
fab
af94e34764
Update README.md
Caddy support removed. Please check and contribute to the caddy-waf project [here](https://github.com/fabriziosalmi/caddy-waf).
2025-01-02 19:08:12 +01:00
fab
e6b1df2016
Delete waf_patterns/caddy directory 2025-01-02 19:05:52 +01:00
fab
25bae0e731
Delete owasp2caddy.py 2025-01-02 19:05:36 +01:00
fab
62e615c33b
Delete import_caddy_waf.py 2025-01-02 19:05:22 +01:00
fab
46a5414dcf
Update README.md 2025-01-02 13:56:42 +01:00