mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2025-12-17 09:45:34 +00:00
Added fixes to Caddy and Ngnix
Did the same fixes that have been done to Apache to Caddy and Nginx
This commit is contained in:
parent
6c267fbb63
commit
c58a1b486f
@ -15,7 +15,6 @@ def copy_waf_files():
|
|||||||
logging.info("Copying Apache WAF patterns...")
|
logging.info("Copying Apache WAF patterns...")
|
||||||
os.makedirs(APACHE_WAF_DIR, exist_ok=True)
|
os.makedirs(APACHE_WAF_DIR, exist_ok=True)
|
||||||
list_of_files = os.listdir(WAF_DIR)
|
list_of_files = os.listdir(WAF_DIR)
|
||||||
workaround = "{"
|
|
||||||
for conf_file in list_of_files:
|
for conf_file in list_of_files:
|
||||||
if conf_file.endswith('.conf'):
|
if conf_file.endswith('.conf'):
|
||||||
subprocess.run(["cp", f"{WAF_DIR}/{conf_file}", APACHE_WAF_DIR], check=True)
|
subprocess.run(["cp", f"{WAF_DIR}/{conf_file}", APACHE_WAF_DIR], check=True)
|
||||||
|
|||||||
@ -12,7 +12,10 @@ INCLUDE_STATEMENT = "import waf/*.conf"
|
|||||||
def copy_waf_files():
|
def copy_waf_files():
|
||||||
logging.info("Copying Caddy WAF patterns...")
|
logging.info("Copying Caddy WAF patterns...")
|
||||||
os.makedirs(CADDY_WAF_DIR, exist_ok=True)
|
os.makedirs(CADDY_WAF_DIR, exist_ok=True)
|
||||||
subprocess.run(["cp", "-R", f"{WAF_DIR}/*", CADDY_WAF_DIR], check=True)
|
list_of_files = os.listdir(WAF_DIR)
|
||||||
|
for conf_file in list_of_files:
|
||||||
|
if conf_file.endswith('.conf'):
|
||||||
|
subprocess.run(["cp", f"{WAF_DIR}/{conf_file}", CADDY_WAF_DIR], check=True)
|
||||||
|
|
||||||
def update_caddyfile():
|
def update_caddyfile():
|
||||||
logging.info("Ensuring WAF patterns are imported in Caddyfile...")
|
logging.info("Ensuring WAF patterns are imported in Caddyfile...")
|
||||||
|
|||||||
@ -12,7 +12,10 @@ INCLUDE_STATEMENT = "include /etc/nginx/waf/*.conf;"
|
|||||||
def copy_waf_files():
|
def copy_waf_files():
|
||||||
logging.info("Copying Nginx WAF patterns...")
|
logging.info("Copying Nginx WAF patterns...")
|
||||||
os.makedirs(NGINX_WAF_DIR, exist_ok=True)
|
os.makedirs(NGINX_WAF_DIR, exist_ok=True)
|
||||||
subprocess.run(["cp", "-R", f"{WAF_DIR}/*", NGINX_WAF_DIR], check=True)
|
list_of_files = os.listdir(WAF_DIR)
|
||||||
|
for conf_file in list_of_files:
|
||||||
|
if conf_file.endswith('.conf'):
|
||||||
|
subprocess.run(["cp", f"{WAF_DIR}/{conf_file}", NGINX_WAF_DIR], check=True)
|
||||||
|
|
||||||
def update_nginx_conf():
|
def update_nginx_conf():
|
||||||
logging.info("Ensuring WAF patterns are included in nginx.conf...")
|
logging.info("Ensuring WAF patterns are included in nginx.conf...")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user