This commit is contained in:
2026-07-21 09:32:52 +07:00
parent db1ce68800
commit 0714b442be
8 changed files with 72 additions and 12 deletions

View File

@@ -128,8 +128,8 @@ class AptInstaller(DebInstaller):
def discover_service_units(self, package_name: str) -> list[str]:
"""Return concrete systemd service units shipped by an installed package.
The package name is already constrained by the Agent APT allowlist. It is
still passed as a single argv item and no shell expansion is performed.
The package name is already syntax-validated by the manifest validator. It
is passed as a single argv item and no shell expansion is performed.
Template units are omitted because they cannot be meaningfully checked
without an instance name.
"""

View File

@@ -18,7 +18,7 @@ class ManifestValidator:
elif component_type == "apt":
component = AptComponent.model_validate(raw_component).model_dump(by_alias=True)
allowed_packages = set(settings.allowed_apt_packages)
if component["packageName"] not in allowed_packages:
if "*" not in allowed_packages and component["packageName"] not in allowed_packages:
raise ValueError(
f"APT package is not allowed: {component['packageName']}"
)