host: pin the syscall lines' exact order (Astra R1 P2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
internal/host/units_hardening_test.go+10 −5
CI passed — run details
Intent
<task-notification> <task-id>by3hmss1u</task-id> <tool-use-id>toolu_01NX8zThosvp3Mh4fgNZbhza</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/57f7b202-ce27-4792-9462-b99ef5f502c4/tasks/by3hmss1u.output</output-file> <status>completed</status> <summary>Background command "Run Astra review round 1 via codex" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 14.3 g CO₂e (1,714,546 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on instance-syscall-filter, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/host/units_hardening_test.go b/internal/host/units_hardening_test.go| index b558b4a92..e39bf7767 100644 |
| --- a/internal/host/units_hardening_test.go |
| +++ b/internal/host/units_hardening_test.go |
| @@ -246,11 +246,11 @@ func TestTenantUnitsCarryTheSyscallFilter(t *testing.T) { |
| allowed[d] = true |
| } |
| for name, u := range units { |
| - for _, want := range syscallBlock { |
| - if !hasDirective(u, want) { |
| - t.Errorf("%s lacks %q", name, want) |
| - } |
| - } |
| + // Exactly the block, in order, once: systemd folds every |
| + // SystemCallFilter= line in sequence, so a later allow line puts |
| + // back what the ~ line took out, and a reversed pair is a |
| + // deny-list with nothing else refused (Astra R1 P2). |
| + var got []string |
| for _, d := range directives(u) { |
| key, _, _ := strings.Cut(d, "=") |
| switch key { |
| @@ -258,8 +258,13 @@ func TestTenantUnitsCarryTheSyscallFilter(t *testing.T) { |
| if !allowed[d] { |
| t.Errorf("%s carries %q beside the tenant syscall block", name, d) |
| } |
| + got = append(got, d) |
| } |
| } |
| + want := []string{syscallBlock[3], syscallBlock[0], syscallBlock[1], syscallBlock[2]} |
| + if strings.Join(got, "\n") != strings.Join(want, "\n") { |
| + t.Errorf("%s syscall lines = %q, want exactly %q", name, got, want) |
| + } |
| } |
| // The demo build and snapshot units are DynamicUser, which implies |
| // RestrictSUIDSGID=; they open no instancefs path. Everywhere else it |