From d81bc7de46616a398562deaa090db2f9981a65fd Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 19 Aug 2018 18:17:14 +0200 Subject: [PATCH] Change rating 1-6 (#658) --- API.md | 2 +- hassio/addons/utils.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/API.md b/API.md index e0bb0159b..32f96620f 100644 --- a/API.md +++ b/API.md @@ -480,7 +480,7 @@ Get all available addons. "homeassistant_api": "bool", "full_access": "bool", "protected": "bool", - "rating": "1-5", + "rating": "1-6", "stdin": "bool", "webui": "null|http(s)://[HOST]:port/xy/zx", "gpio": "bool", diff --git a/hassio/addons/utils.py b/hassio/addons/utils.py index 27c393f09..83f05ad2e 100644 --- a/hassio/addons/utils.py +++ b/hassio/addons/utils.py @@ -19,7 +19,7 @@ def rating_security(addon): 1 = not secure 5 = high secure """ - rating = 4 + rating = 5 # AppArmor if addon.apparmor == SECURITY_DISABLE: @@ -36,6 +36,10 @@ def rating_security(addon): PRIVILEGED_SYS_RAWIO): rating += -1 + # Not secure Networking + if addon.host_network: + rating += -1 + # Full Access if addon.with_full_access: rating += -2 @@ -44,7 +48,7 @@ def rating_security(addon): if addon.access_docker_api: rating = 1 - return max(min(5, rating), 1) + return max(min(6, rating), 1) def get_hash_from_repository(name):