Skip to content

Commit b1d24e2

Browse files
committed
Drop content trust and force security options
A cosign based signature verification will likely be named differently to avoid confusion with existing implementations. For now, remove the options entirely.
1 parent 475013f commit b1d24e2

File tree

5 files changed

+4
-51
lines changed

5 files changed

+4
-51
lines changed

supervisor/api/addons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ async def options_validate(self, request: web.Request) -> OptionsValidateRespons
375375
data["pwned"] = None
376376
break
377377

378-
if self.sys_security.force and data["pwned"] in (None, True):
378+
if data["pwned"] in (None, True):
379379
data["valid"] = False
380380
if data["pwned"] is None:
381381
data["message"] = "Error happening on pwned secrets check!"

supervisor/api/security.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77

88
from supervisor.exceptions import APIGone
99

10-
from ..const import ATTR_CONTENT_TRUST, ATTR_FORCE_SECURITY, ATTR_PWNED
10+
from ..const import ATTR_PWNED
1111
from ..coresys import CoreSysAttributes
1212
from .utils import api_process, api_validate
1313

1414
# pylint: disable=no-value-for-parameter
1515
SCHEMA_OPTIONS = vol.Schema(
1616
{
1717
vol.Optional(ATTR_PWNED): vol.Boolean(),
18-
vol.Optional(ATTR_CONTENT_TRUST): vol.Boolean(),
19-
vol.Optional(ATTR_FORCE_SECURITY): vol.Boolean(),
2018
}
2119
)
2220

@@ -28,9 +26,7 @@ class APISecurity(CoreSysAttributes):
2826
async def info(self, request: web.Request) -> dict[str, Any]:
2927
"""Return Security information."""
3028
return {
31-
ATTR_CONTENT_TRUST: self.sys_security.content_trust,
3229
ATTR_PWNED: self.sys_security.pwned,
33-
ATTR_FORCE_SECURITY: self.sys_security.force,
3430
}
3531

3632
@api_process
@@ -40,10 +36,6 @@ async def options(self, request: web.Request) -> None:
4036

4137
if ATTR_PWNED in body:
4238
self.sys_security.pwned = body[ATTR_PWNED]
43-
if ATTR_CONTENT_TRUST in body:
44-
self.sys_security.content_trust = body[ATTR_CONTENT_TRUST]
45-
if ATTR_FORCE_SECURITY in body:
46-
self.sys_security.force = body[ATTR_FORCE_SECURITY]
4739

4840
await self.sys_security.save_data()
4941

supervisor/api/supervisor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
ATTR_BLK_READ,
1717
ATTR_BLK_WRITE,
1818
ATTR_CHANNEL,
19-
ATTR_CONTENT_TRUST,
2019
ATTR_COUNTRY,
2120
ATTR_CPU_PERCENT,
2221
ATTR_DEBUG,
2322
ATTR_DEBUG_BLOCK,
2423
ATTR_DETECT_BLOCKING_IO,
2524
ATTR_DIAGNOSTICS,
26-
ATTR_FORCE_SECURITY,
2725
ATTR_HEALTHY,
2826
ATTR_ICON,
2927
ATTR_IP_ADDRESS,
@@ -69,8 +67,6 @@
6967
vol.Optional(ATTR_DEBUG): vol.Boolean(),
7068
vol.Optional(ATTR_DEBUG_BLOCK): vol.Boolean(),
7169
vol.Optional(ATTR_DIAGNOSTICS): vol.Boolean(),
72-
vol.Optional(ATTR_CONTENT_TRUST): vol.Boolean(),
73-
vol.Optional(ATTR_FORCE_SECURITY): vol.Boolean(),
7470
vol.Optional(ATTR_AUTO_UPDATE): vol.Boolean(),
7571
vol.Optional(ATTR_DETECT_BLOCKING_IO): vol.Coerce(DetectBlockingIO),
7672
vol.Optional(ATTR_COUNTRY): str,

supervisor/security/module.py

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@
44

55
import logging
66

7-
from ..const import (
8-
ATTR_CONTENT_TRUST,
9-
ATTR_FORCE_SECURITY,
10-
ATTR_PWNED,
11-
FILE_HASSIO_SECURITY,
12-
)
7+
from ..const import ATTR_PWNED, FILE_HASSIO_SECURITY
138
from ..coresys import CoreSys, CoreSysAttributes
14-
from ..exceptions import PwnedError
159
from ..utils.common import FileConfiguration
1610
from ..utils.pwned import check_pwned_password
1711
from ..validate import SCHEMA_SECURITY_CONFIG
@@ -27,26 +21,6 @@ def __init__(self, coresys: CoreSys):
2721
super().__init__(FILE_HASSIO_SECURITY, SCHEMA_SECURITY_CONFIG)
2822
self.coresys = coresys
2923

30-
@property
31-
def content_trust(self) -> bool:
32-
"""Return if content trust is enabled/disabled."""
33-
return self._data[ATTR_CONTENT_TRUST]
34-
35-
@content_trust.setter
36-
def content_trust(self, value: bool) -> None:
37-
"""Set content trust is enabled/disabled."""
38-
self._data[ATTR_CONTENT_TRUST] = value
39-
40-
@property
41-
def force(self) -> bool:
42-
"""Return if force security is enabled/disabled."""
43-
return self._data[ATTR_FORCE_SECURITY]
44-
45-
@force.setter
46-
def force(self, value: bool) -> None:
47-
"""Set force security is enabled/disabled."""
48-
self._data[ATTR_FORCE_SECURITY] = value
49-
5024
@property
5125
def pwned(self) -> bool:
5226
"""Return if pwned is enabled/disabled."""
@@ -63,9 +37,4 @@ async def verify_secret(self, pwned_hash: str) -> None:
6337
_LOGGER.warning("Disabled pwned, skip validation")
6438
return
6539

66-
try:
67-
await check_pwned_password(self.sys_websession, pwned_hash)
68-
except PwnedError:
69-
if self.force:
70-
raise
71-
return
40+
await check_pwned_password(self.sys_websession, pwned_hash)

supervisor/validate.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
ATTR_AUTO_UPDATE,
1313
ATTR_CHANNEL,
1414
ATTR_CLI,
15-
ATTR_CONTENT_TRUST,
1615
ATTR_COUNTRY,
1716
ATTR_DEBUG,
1817
ATTR_DEBUG_BLOCK,
@@ -21,7 +20,6 @@
2120
ATTR_DISPLAYNAME,
2221
ATTR_DNS,
2322
ATTR_ENABLE_IPV6,
24-
ATTR_FORCE_SECURITY,
2523
ATTR_HASSOS,
2624
ATTR_HASSOS_UNRESTRICTED,
2725
ATTR_HASSOS_UPGRADE,
@@ -229,9 +227,7 @@ def validate_repository(repository: str) -> str:
229227
# pylint: disable=no-value-for-parameter
230228
SCHEMA_SECURITY_CONFIG = vol.Schema(
231229
{
232-
vol.Optional(ATTR_CONTENT_TRUST, default=True): vol.Boolean(),
233230
vol.Optional(ATTR_PWNED, default=True): vol.Boolean(),
234-
vol.Optional(ATTR_FORCE_SECURITY, default=False): vol.Boolean(),
235231
},
236232
extra=vol.REMOVE_EXTRA,
237233
)

0 commit comments

Comments
 (0)