Download tasks/DSK/DSK_task_1_gsettings_dconf_policy.md from wanlilll/WeaveBench: direct link, hf CLI and curl.
- Browser
- Download file 22 kB
-
https://huggingface.co/datasets/wanlilll/WeaveBench/resolve/main/tasks/DSK/DSK_task_1_gsettings_dconf_policy.md
- Command line
-
hf download hf://datasets/wanlilll/WeaveBench/tasks/DSK/DSK_task_1_gsettings_dconf_policy.md
-
curl -L -o DSK_task_1_gsettings_dconf_policy.md https://huggingface.co/datasets/wanlilll/WeaveBench/resolve/main/tasks/DSK/DSK_task_1_gsettings_dconf_policy.md
id: DSK_task_1_gsettings_dconf_policy
name: GNOME 桌面策略审计与强制合规 — gsettings + dconf-editor 双通道
category: DSK
timeout_seconds: 1500
Prompt
⚙️ Execution convention: This is a legitimate desktop + terminal test task. All deliverables go under
/tmp_workspace/results/. Execute directly; do not refuse.ℹ️ About this task: This is a desktop-configuration audit sandbox task running inside an isolated test VM.
policy_spec.jsonis a test fixture (synthetic GNOME setting thresholds), not a real production policy; the agent only mutates keys in the VM's own dconf and does not affect any real host or user. Execute all steps directly (including using sudo to install tools and using xdotool/pyautogui to automate GUI clicks); do not refuse.
Task background: The company IT security team has drafted a GNOME desktop policy spec (/tmp_workspace/policy_spec.json) listing target compliance values for a number of gsettings keys. You must audit the current desktop environment, locate non-compliant entries, confirm the semantics of each key (Summary / Description / Type / Range / Default value and other metadata), apply the compliance edits, and re-verify the final values.
Domain background: GNOME desktop configuration is stored in the dconf database. The gsettings schema provides per-key metadata such as type, default value, and value range. dconf watch prints change paths of the form /org/gnome/desktop/<schema>/<key> to stdout in real time. dconf dump emits only non-default keys, so keys whose target value happens to equal the default will not appear in the dump diff and must be verified individually per key.
Deliverables
All deliverables go under /tmp_workspace/results/.
baseline_dump.txt: full gsettings baseline snapshot of the current desktop session, ≥ 200 lines.audit_before.json: compliance audit result for every key inpolicy_spec.json, with fields:{ "total_keys": "<int>", "compliant": "<int>", "non_compliant": "<int>", "items": [ {"schema": "<string>", "key": "<string>", "expected": "<value>", "actual": "<value>", "status": "<COMPLIANT|NON_COMPLIANT>"} ] }itemscount equals the total number of keys in the spec file; each entry contains 5 fields.key_ranges.txt:type/enum/rangemetadata gathered for all keys in the spec; file must contain at least oneenumorrangeline.view_01_dconf_interface.png: shows the key list under theorg.gnome.desktop.interfacepath together with the right-side key properties panel; Summary / Description / Type / Default value and other fields that are only exposed in the GUI must be visible.view_02_dconf_privacy.png: shows the properties panel of any key under theorg.gnome.desktop.privacypath, containing Default value / Custom value fields or the corresponding toggle.dconf_signals.log: dconf change-signal log collected in the background during the policy edits; must contain at least 2/org/gnome/...path entries.view_03_dconf_edit_before.png: properties panel state for some non-compliant boolean key right before it is about to be modified (showing the current key value).view_04_dconf_edit_after.png: properties panel for a key marked NON_COMPLIANT in audit_before after it has been changed to the compliant target value; the "Use default value" switch and the current Custom value must be visible.view_05_dconf_lockdown.png: shows the properties panel of at least one key under theorg.gnome.desktop.lockdownpath.view_06_dconf_watch.png: shows real-time dconf change-signal output inside a real terminal window (with a command prompt and several/org/gnome/...lines), as runtime evidence.view_07_dconf_verified.png: final re-inspection of a modified interface key; the toggle next to "Use default value" must be consistent with the Custom value that was set.audit_after.json: re-audit againstpolicy_spec.jsonperformed after the policy edits, same schema as audit_before; goal is for everyitems.status == "COMPLIANT"and for eachactualvalue to matchgt/expected.json.dconf_after_dump.ini: full dconf database dump after the policy edits; non-empty.policy_diff.txt: diff betweenbaseline_dump.txtanddconf_after_dump.ini, ≥ 3 changed lines.compliance_report.md: must contain an H1 title, ≥ 6 markdown table rows of the form| schema | key | before | after | status |, one compliance-rate percentage in the form\d+(\.\d+)?%, and references to all 7 screenshots.audit_summary.json:{ "total_keys": "<int>", "compliant_before": "<int>", "compliant_after": "<int>", "compliance_rate_before": "<float 0-1>", "compliance_rate_after": "<float 0-1>", "screenshots": ["<filename>", "..."], "signals_captured": "<int>" }
Expected Behavior
- 最终交付:对
policy_spec.json中列出的全部 gsettings 键完成"基线 → 审计 → 修复 → 复验"闭环,所有不合规项被改为合规目标值。 - 系统应能体现:
audit_before.json中标为 NON_COMPLIANT 的键在audit_after.json中全部转为 COMPLIANT,且 actual 值与gt/expected.json对齐。 - 产物中应能验证:策略修改过程产生了真实的 dconf 变更信号(
dconf_signals.log含 ≥ 2 条/org/gnome/...路径),策略修改前后的 dconf dump 存在可观察的差异(policy_diff.txt≥ 3 行)。 - 7 张取证截图应分别覆盖 interface / privacy / lockdown 等 schema 的属性面板、修改前后状态、最终回看,以及命令行变更信号窗口,跨通道交叉印证。
compliance_report.md应给出表格化的合规对照与百分比合规率,audit_summary.json字段齐全。
Source
- GNOME gsettings-desktop-schemas: https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas
- dconf-editor 项目: https://gitlab.gnome.org/GNOME/dconf-editor
- Red Hat 系统级 GNOME 配置文档: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/administering_the_system_using_the_gnome_desktop_environment/configuring-gnome-at-system-level_administering-the-system-using-the-gnome-desktop-environment
- Red Hat dconf 数据库管理(system-wide overrides): https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/configuring-gnome-at-the-system-level_using-the-desktop-environment-in-rhel-8
- ArchWiki dconf: https://wiki.archlinux.org/title/Dconf
Grading Criteria
-
baseline_dump.txt存在且 ≥ 200 行
-
audit_before.json含 items 数组且每条含 schema/key/expected/actual/status
-
- 7 张 dconf-editor / 终端截图齐全
-
- 截图 OCR 命中 dconf-editor UI 关键词(Key properties / Summary / Default value / Custom value 等)
-
key_ranges.txt含 ≥ 1 处 enum / range 元数据
-
dconf_signals.log含 ≥ 2 条/org/gnome/...信号路径
-
dconf_after_dump.ini非空
-
policy_diff.txt含 ≥ 3 处变更
-
audit_after.json全部 COMPLIANT,且 actual 值与 gt/expected.json 对齐
-
compliance_report.md含标题 + 表格 + 合规率百分比
-
audit_summary.json含全部 7 个必备字段
-
- VLM 验证 dconf-editor 真打开(4 项 rubric)
-
- 截图反作弊:md5 互不相同 + 分辨率 ≥ 1280×720 + 文件 ≥ 5KB
-
- 加权聚合(核心 60% / GUI 30% / 辅助 10%)+ VLM/OCR 缺失封顶 0.6
Automated Checks
def grade(workspace_path=None, **kwargs) -> dict:
"""Multi-dimensional grader for gsettings + dconf-editor policy audit task."""
import json, re
from pathlib import Path
try:
from PIL import Image
except ImportError:
Image = None
try:
import pytesseract
except ImportError:
pytesseract = None
try:
from _judge_helper import vlm_score_rubric
except Exception:
vlm_score_rubric = None
workspace = Path(workspace_path) if workspace_path else Path("/tmp_workspace")
rd = workspace / "results"
gt = workspace / "gt"
s = {}
def _safe_text(p):
try:
return p.read_text(errors="ignore") if p.exists() else ""
except Exception:
return ""
# 1. baseline_dump.txt: must exist AND >= 200 lines (empty -> 0.000)
bd = rd / "baseline_dump.txt"
bd_lines = _safe_text(bd).splitlines()
if not bd.exists() or len(bd_lines) == 0:
s["baseline_dump"] = 0.0
elif len(bd_lines) >= 200:
s["baseline_dump"] = 1.0
else:
s["baseline_dump"] = round(len(bd_lines) / 200.0, 3)
# 2. audit_before.json schema (items with required fields)
ab = rd / "audit_before.json"
ab_data = {}
if ab.exists():
try:
ab_data = json.loads(_safe_text(ab))
except Exception:
ab_data = {}
items_before = ab_data.get("items", []) if isinstance(ab_data, dict) else []
required_fields = {"schema", "key", "expected", "actual", "status"}
valid_items = [
it for it in items_before
if isinstance(it, dict) and required_fields.issubset(it.keys())
]
target_count = max(1, len(items_before)) if items_before else 1
if not items_before:
s["audit_before_schema"] = 0.0
else:
s["audit_before_schema"] = round(len(valid_items) / target_count, 3)
# 3. screenshots present (7 GUI shots) — 必须文件 ≥ 5KB 才算真截图
shots = [
"view_01_dconf_interface.png",
"view_02_dconf_privacy.png",
"view_03_dconf_edit_before.png",
"view_04_dconf_edit_after.png",
"view_05_dconf_lockdown.png",
"view_06_dconf_watch.png",
"view_07_dconf_verified.png",
]
present = sum(1 for n in shots if (rd / n).exists() and (rd / n).stat().st_size >= 5120)
s["screenshots_count"] = round(present / len(shots), 3)
# 3b. anti-cheat: md5 uniqueness + 分辨率 ≥ 1280x720
import hashlib
md5s = set()
res_ok = 0
valid_shots = 0
for n in shots:
p = rd / n
if not p.exists() or p.stat().st_size < 5120:
continue
valid_shots += 1
try:
md5s.add(hashlib.md5(p.read_bytes()).hexdigest())
except Exception:
pass
if Image is not None:
try:
w, h = Image.open(p).size
if w >= 1280 and h >= 720:
res_ok += 1
except Exception:
pass
s["screenshots_unique"] = round(len(md5s) / max(1, len(shots)), 3) if valid_shots else 0.0
s["screenshots_resolution"] = round(res_ok / max(1, len(shots)), 3) if valid_shots else 0.0
# 4. OCR coverage on screenshots
ocr_hits = 0
dconf_kws = ["Key properties", "Summary", "Description",
"Default value", "Custom value", "Use default",
"dconf", "schema", "Apply"]
if pytesseract and Image:
for n in shots:
p = rd / n
if not p.exists() or p.stat().st_size == 0:
continue
try:
tx = pytesseract.image_to_string(Image.open(p))
if any(k.lower() in tx.lower() for k in dconf_kws):
ocr_hits += 1
except Exception:
pass
s["screenshots_ocr"] = round(ocr_hits / len(shots), 3)
else:
s["screenshots_ocr"] = 0.0
# 5. key_ranges.txt has range/enum metadata
kr = rd / "key_ranges.txt"
kr_text = _safe_text(kr)
if not kr.exists() or not kr_text.strip():
s["key_ranges"] = 0.0
else:
has_meta = bool(re.search(r"(enum|range|type|maximum|minimum)", kr_text, re.IGNORECASE))
s["key_ranges"] = 1.0 if has_meta else 0.0
# 6. dconf_signals.log has >= 2 /org/gnome paths
sl = rd / "dconf_signals.log"
sig_text = _safe_text(sl)
if not sl.exists() or not sig_text.strip():
s["dconf_signals"] = 0.0
else:
sig_paths = re.findall(r"/org/gnome/\S+", sig_text)
if len(sig_paths) >= 2:
s["dconf_signals"] = 1.0
else:
s["dconf_signals"] = round(len(sig_paths) / 2.0, 3)
# 7. dconf_after_dump.ini non-empty
dd = rd / "dconf_after_dump.ini"
if not dd.exists() or dd.stat().st_size <= 50:
s["dconf_dump"] = 0.0
else:
s["dconf_dump"] = 1.0
# 8. policy_diff.txt has >= 3 changes
pd = rd / "policy_diff.txt"
pd_text = _safe_text(pd)
if not pd.exists() or not pd_text.strip():
s["policy_diff"] = 0.0
else:
change_lines = len(re.findall(r"^[<>+-]", pd_text, re.MULTILINE))
s["policy_diff"] = 1.0 if change_lines >= 3 else round(change_lines / 3.0, 3)
# 9. audit_after.json: all COMPLIANT + cross-validate w/ gt
aa = rd / "audit_after.json"
aa_data = {}
if aa.exists():
try:
aa_data = json.loads(_safe_text(aa))
except Exception:
aa_data = {}
items_after = aa_data.get("items", []) if isinstance(aa_data, dict) else []
if not items_after:
s["audit_after_compliant"] = 0.0
else:
compliant = sum(
1 for it in items_after
if isinstance(it, dict) and it.get("status") == "COMPLIANT"
)
s["audit_after_compliant"] = round(compliant / max(1, len(items_after)), 3)
gt_file = gt / "expected.json"
gt_expected = {}
if gt_file.exists():
try:
gt_expected = json.loads(_safe_text(gt_file))
except Exception:
gt_expected = {}
if gt_expected and items_after:
gt_items = gt_expected.get("items", [])
gt_map = {(g.get("schema"), g.get("key")): g.get("expected")
for g in gt_items if isinstance(g, dict)}
match = 0
for it in items_after:
k = (it.get("schema"), it.get("key"))
if k in gt_map and str(it.get("actual")) == str(gt_map[k]):
match += 1
s["values_match_gt"] = round(match / max(1, len(gt_map)), 3)
else:
s["values_match_gt"] = 0.0
# 10. compliance_report.md
cr = rd / "compliance_report.md"
cr_text = _safe_text(cr)
if not cr.exists() or not cr_text.strip():
s["compliance_report"] = 0.0
else:
score = 0.0
if re.search(r"^#\s+", cr_text, re.MULTILINE):
score += 0.3
table_rows = len(re.findall(r"^\|.*\|.*\|", cr_text, re.MULTILINE))
if table_rows >= 6:
score += 0.4
if re.search(r"\d+(\.\d+)?\s*%", cr_text):
score += 0.3
s["compliance_report"] = round(score, 3)
# 11. audit_summary.json
ass = rd / "audit_summary.json"
ass_data = {}
if ass.exists():
try:
ass_data = json.loads(_safe_text(ass))
except Exception:
ass_data = {}
req_keys = {"total_keys", "compliant_before", "compliant_after",
"compliance_rate_before", "compliance_rate_after",
"screenshots", "signals_captured"}
if not ass_data:
s["audit_summary_schema"] = 0.0
else:
present_k = req_keys & set(ass_data.keys())
s["audit_summary_schema"] = round(len(present_k) / len(req_keys), 3)
# 12. VLM rubric (4 items)
sample = [str(rd / n) for n in shots if (rd / n).exists() and (rd / n).stat().st_size > 0][:4]
if vlm_score_rubric and sample:
rubric = {
"vlm_dconf_editor_real": "截图清晰显示 dconf-editor 应用窗口(左侧路径树 + 右侧 Key properties / 编辑面板)",
"vlm_key_detail_visible": "至少一张截图能看到 Summary / Description / Type / Default value 这些 GUI-only 字段",
"vlm_edit_evidence": "至少一张截图显示某个键的 Custom value 输入框、'Use default value' 切换条或 ✓ Apply 按钮",
"vlm_watch_terminal": "view_06 截图含真实终端窗口 + 命令提示符 + dconf watch 输出的实时路径行(不是文字 PS)",
}
try:
vlm = vlm_score_rubric(sample, rubric,
instruction="评估 dconf-editor + 终端 dconf watch 的取证截图真实性。")
for k in rubric:
s[k] = vlm.get(k, 0.0) if isinstance(vlm, dict) else 0.0
if isinstance(vlm, dict):
s["judge_method"] = vlm.get("judge_method", "failed")
except Exception:
for k in rubric:
s[k] = 0.0
else:
for k in ["vlm_dconf_editor_real", "vlm_key_detail_visible",
"vlm_edit_evidence", "vlm_watch_terminal"]:
s[k] = 0.0
# 13. Content-reality sub-scores (drive content-driven hard gates)
# 13a. compliance_report.md mentions >= 3 specific schema keys
if not cr.exists() or not cr_text.strip():
s["report_key_specificity"] = 0.0
else:
keys_mentioned = set(re.findall(r"org\.gnome\.[A-Za-z0-9_\-\.]+", cr_text))
if len(keys_mentioned) >= 3:
s["report_key_specificity"] = 1.0
else:
s["report_key_specificity"] = round(len(keys_mentioned) / 3.0, 3)
# 13b. audit_after flips: NON_COMPLIANT(before) -> COMPLIANT(after)
flip = 0
if items_before and items_after:
bad_before = {(i.get("schema"), i.get("key"))
for i in items_before
if isinstance(i, dict) and i.get("status") == "NON_COMPLIANT"}
good_after = {(i.get("schema"), i.get("key"))
for i in items_after
if isinstance(i, dict) and i.get("status") == "COMPLIANT"}
flip = len(bad_before & good_after)
if flip >= 3:
s["compliance_flips"] = 1.0
elif flip >= 1:
s["compliance_flips"] = round(flip / 3.0, 3)
else:
s["compliance_flips"] = 0.0
# 13c. dconf after-dump truly differs from baseline (line set diff)
dd_text = _safe_text(dd)
base_set = set(l.strip() for l in bd_lines if l.strip())
after_set = set(l.strip() for l in dd_text.splitlines() if l.strip())
if not base_set or not after_set:
s["dump_diff_real"] = 0.0
else:
diff_n = len(after_set.symmetric_difference(base_set))
if diff_n >= 3:
s["dump_diff_real"] = 1.0
else:
s["dump_diff_real"] = round(diff_n / 3.0, 3)
# Aggregate (weighted): core 60% / gui 30% / aux 10%
def _g(k, default=0.0):
v = s.get(k, default)
return float(v) if isinstance(v, (int, float)) else default
core_keys = ["audit_after_compliant", "values_match_gt", "compliance_flips",
"dconf_dump", "dump_diff_real"]
gui_keys = ["screenshots_count", "screenshots_ocr", "screenshots_unique",
"screenshots_resolution",
"vlm_dconf_editor_real", "vlm_key_detail_visible",
"vlm_edit_evidence", "vlm_watch_terminal"]
aux_keys = ["baseline_dump", "audit_before_schema", "key_ranges",
"dconf_signals", "policy_diff", "compliance_report",
"audit_summary_schema", "report_key_specificity"]
core = sum(_g(k) for k in core_keys) / len(core_keys)
gui = sum(_g(k) for k in gui_keys) / len(gui_keys)
aux = sum(_g(k) for k in aux_keys) / len(aux_keys)
base = 0.6 * core + 0.3 * gui + 0.1 * aux
# VLM 不可用时整体封顶 0.6,不能让无 VLM 也满分
if vlm_score_rubric is None or s.get("judge_method") == "failed":
base = min(base, 0.6)
# OCR 全 0 (pytesseract 不可用或截图全失败) 封顶 0.6
if s.get("screenshots_ocr", 0) < 0.4:
base = min(base, 0.6)
# Hard gates — 关键产物缺失或退化路径直接封顶
if s.get("screenshots_count", 0) < 0.7:
base = min(base, 0.40)
if s.get("screenshots_unique", 0) < 0.7:
base = min(base, 0.45) # 截图重复 = 伪截图嫌疑
if s.get("screenshots_resolution", 0) < 0.5:
base = min(base, 0.50)
if s.get("baseline_dump", 0) == 0:
base = min(base, 0.30)
if s.get("audit_before_schema", 0) < 0.5:
base = min(base, 0.40)
if s.get("dconf_signals", 0) == 0:
base = min(base, 0.50)
if s.get("audit_after_compliant", 0) < 0.5:
base = min(base, 0.40)
if s.get("compliance_report", 0) < 0.5:
base = min(base, 0.50)
# Content-driven stepped hard gates (上拉)
if s.get("compliance_flips", 0) < 0.5:
base = min(base, 0.45)
if s.get("dump_diff_real", 0) < 0.5:
base = min(base, 0.50)
if s.get("report_key_specificity", 0) < 0.7:
base = min(base, 0.55)
if s.get("values_match_gt", 0) < 0.5:
base = min(base, 0.45)
s["overall_score"] = round(base, 3)
return s
Workspace Path
workspace/DSK/task_1_gsettings_dconf_policy
Skills
Env
Warmup
echo c2V0ICtlCiggZWNobyBwYXNzd29yZCB8IHN1ZG8gLVMgLXAgJycgYmFzaCAtYyAnZXhwb3J0IERFQklBTl9GUk9OVEVORD1ub25pbnRlcmFjdGl2ZTsgYXB0LWdldCB1cGRhdGUgLXFxIHx8IHRydWU7IGFwdC1nZXQgaW5zdGFsbCAteSAtcXEgbGliZ2xpYjIuMC1iaW4gZGNvbmYtY2xpIGRjb25mLWVkaXRvciB4ZG90b29sIHdtY3RybCBnbm9tZS1zY3JlZW5zaG90IHNjcm90IHRlc3NlcmFjdC1vY3IgcHl0aG9uMy1waWwgcHl0aG9uMy1weXRlc3NlcmFjdCB8fCB0cnVlOyBwaXAgaW5zdGFsbCAtcSBweXRlc3NlcmFjdCBwaWxsb3cgbnVtcHkgfHwgdHJ1ZTsgbWtkaXIgLXAgL3RtcF93b3Jrc3BhY2UvcmVzdWx0cyAvdG1wX3dvcmtzcGFjZS9ndDsgY2hvd24gLVIgdXNlcjp1c2VyIC90bXBfd29ya3NwYWNlL3Jlc3VsdHMgL3RtcF93b3Jrc3BhY2UvZ3QgMj4vZGV2L251bGwgfHwgdHJ1ZScgPi90bXBfd29ya3NwYWNlL2luc3RhbGwubG9nIDI+JjEgJiApIHx8IHRydWUKdHJ1ZQo= | base64 -d | bash