From c91bac2527cb0dc66990caa2885ac3e21cfffb75 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 24 Sep 2018 17:03:21 +0200 Subject: [PATCH] Add log to blacklist / reduce free calls (#713) --- hassio/api/security.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hassio/api/security.py b/hassio/api/security.py index 6197c495d..f766e1cc8 100644 --- a/hassio/api/security.py +++ b/hassio/api/security.py @@ -33,9 +33,7 @@ NO_SECURITY_CHECK = re.compile( # Can called by every add-on ADDONS_API_BYPASS = re.compile( r"^(?:" - r"|/homeassistant/info" - r"|/supervisor/info" - r"|/addons(?:/self/(?!security)[^/]+)?" + r"|/addons/self/(?!security)[^/]+)?" r")$" ) @@ -44,6 +42,7 @@ ADDONS_ROLE_ACCESS = { ROLE_DEFAULT: re.compile( r"^(?:" r"|/[^/]+/info" + r"|addons" r")$" ), ROLE_HOMEASSISTANT: re.compile( @@ -84,6 +83,7 @@ class SecurityMiddleware(CoreSysAttributes): # Blacklist if BLACKLIST.match(request.path): + _LOGGER.warning("%s is blacklisted!", request.path) raise HTTPForbidden() # Ignore security check