Skip to content

Commit 8269ef0

Browse files
committed
Avoid false positive on disabled Quadlet AutoUpdate
1 parent c964f6b commit 8269ef0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/validate_local_agent_templates.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class Finding:
3636
FORBIDDEN_SNIPPETS = [
3737
"Restart=always",
3838
"Pull=always",
39-
"AutoUpdate=registry",
4039
"/tmp/",
4140
]
4241

@@ -51,6 +50,11 @@ def validate_template(path: pathlib.Path) -> list[Finding]:
5150
for snippet in FORBIDDEN_SNIPPETS:
5251
if snippet in text:
5352
findings.append(Finding(str(path), "high", f"forbidden snippet: {snippet}"))
53+
if path.name.endswith(".container.tmpl"):
54+
for line in text.splitlines():
55+
stripped = line.strip()
56+
if stripped.startswith("AutoUpdate=") and stripped != "AutoUpdate=registry-disabled":
57+
findings.append(Finding(str(path), "high", f"forbidden AutoUpdate setting: {stripped}"))
5458
return findings
5559

5660

0 commit comments

Comments
 (0)