mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 11:06:32 +00:00
Change rating 1-6 (#658)
This commit is contained in:
parent
e3a99b9f89
commit
d81bc7de46
2
API.md
2
API.md
@ -480,7 +480,7 @@ Get all available addons.
|
|||||||
"homeassistant_api": "bool",
|
"homeassistant_api": "bool",
|
||||||
"full_access": "bool",
|
"full_access": "bool",
|
||||||
"protected": "bool",
|
"protected": "bool",
|
||||||
"rating": "1-5",
|
"rating": "1-6",
|
||||||
"stdin": "bool",
|
"stdin": "bool",
|
||||||
"webui": "null|http(s)://[HOST]:port/xy/zx",
|
"webui": "null|http(s)://[HOST]:port/xy/zx",
|
||||||
"gpio": "bool",
|
"gpio": "bool",
|
||||||
|
@ -19,7 +19,7 @@ def rating_security(addon):
|
|||||||
1 = not secure
|
1 = not secure
|
||||||
5 = high secure
|
5 = high secure
|
||||||
"""
|
"""
|
||||||
rating = 4
|
rating = 5
|
||||||
|
|
||||||
# AppArmor
|
# AppArmor
|
||||||
if addon.apparmor == SECURITY_DISABLE:
|
if addon.apparmor == SECURITY_DISABLE:
|
||||||
@ -36,6 +36,10 @@ def rating_security(addon):
|
|||||||
PRIVILEGED_SYS_RAWIO):
|
PRIVILEGED_SYS_RAWIO):
|
||||||
rating += -1
|
rating += -1
|
||||||
|
|
||||||
|
# Not secure Networking
|
||||||
|
if addon.host_network:
|
||||||
|
rating += -1
|
||||||
|
|
||||||
# Full Access
|
# Full Access
|
||||||
if addon.with_full_access:
|
if addon.with_full_access:
|
||||||
rating += -2
|
rating += -2
|
||||||
@ -44,7 +48,7 @@ def rating_security(addon):
|
|||||||
if addon.access_docker_api:
|
if addon.access_docker_api:
|
||||||
rating = 1
|
rating = 1
|
||||||
|
|
||||||
return max(min(5, rating), 1)
|
return max(min(6, rating), 1)
|
||||||
|
|
||||||
|
|
||||||
def get_hash_from_repository(name):
|
def get_hash_from_repository(name):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user