Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/actions/build-fork/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ runs:
git -C /tmp/core/libntech checkout -q FETCH_HEAD
echo "core=$core" >> "$GITHUB_OUTPUT"
echo "libntech=$libntech" >> "$GITHUB_OUTPUT"
# In the job log, not only the summary: the libntech commit core's
# submodule pointer names exists on the fork, not on the upstream URL
# in .gitmodules, and is fetched from `libntech.repo` above.
# In the job log, not only the summary. The libntech commit core's
# submodule pointer names exists on the fork, and is fetched from
# `libntech.repo` above, never through .gitmodules: that file names the
# fork too since core 8d8dc94 (in the pin 4443504), but this action does
# not depend on it, so overlay/fork.json stays the one source.
echo "build-fork: core $core, libntech $libntech (from $libntech_repo)"

- name: Build dependencies (core's own script; Debian/Ubuntu branch)
Expand Down
12 changes: 8 additions & 4 deletions docs/architecture/tendcf-validate-proposal-2026-11-03.md
Original file line number Diff line number Diff line change
Expand Up @@ -1225,16 +1225,20 @@ The fork-side all-or-nothing loader (PR #41) and this check hold each without
the other: with the loader failing closed, the file's keys are not loaded and
the check refuses and reports it, which is correct and louder. The independence
is limited, not complete: the loader's strict parse (a repeated member or
trailing input refuses the file; fork `6505f488a`) belongs to the CMDB loader
trailing input refuses the file; fork `4443504`) belongs to the CMDB loader
only, while this check's `readjson` stays lenient and sees the last of a
repeated member or `vars` section, so an earlier container the loader refused
is not named by the check. The check reports a refusal when that lenient view
still lists variables the loader did not install (or another feature it refuses
on its own); when the lenient view is empty (`{"vars":{},"vars":{}}`, or
`{"vars":{}}` followed by non-whitespace) nothing is installed and nothing
on its own); when the lenient view is empty nothing is installed and nothing
actuates, but the check has nothing to report, so no actuation is not a refusal
report and the loader's own error is the only trace (`run.sh` 9b, empty-view
controls). The check does not detect such a file when the loader is lenient and
controls, which pin two examples: `{"vars":{},"vars":{}}` and `{"vars":{}}`
followed by non-whitespace). The examples are not the whole class; the one that
matters operationally is `{"vars":{<the real configuration>},"vars":{}}`: the
lenient parser keeps the last, empty `vars`, the strict loader refuses the file,
and the whole intended configuration is silently not applied, with the loader's
error as the only trace. The check does not detect such a file when the loader is lenient and
the repeated member is invisible to both parsers.

Two findings from the implementation, both about the proof above. (1) The
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/upstream-register.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ tendcf that is fail-open: an interlock entry dropped at load leaves the
services it guards actuated unguarded. `tendcf-integration` now carries
`cmdb-fail-closed` (`a750b1dfe`, `dbf9dede6`, `61065e551`, `736becc07`, merged
`d32cade13`; hardened by djbclark/core PR #98 and a strict libntech JSON parse,
the pin now `6505f488a`): `LoadCMDBData()` validates every entry of
fork PR 99 moved the CMDB test seam under `TEST_UNIT_TEST`; the pin now `4443504`): `LoadCMDBData()` validates every entry of
`vars`/`variables`/`classes` first and installs nothing from
`host_specific.json` if any one is invalid (also an unknown top-level key, a
null section, a key with index brackets, a frame-dependent special scope, two
Expand Down
2 changes: 1 addition & 1 deletion overlay/fork.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"core": {
"repo": "https://github.com/djbclark/core",
"branch": "tendcf-integration",
"commit": "6505f488a80ab3e18b089c7d8e32571c88128866"
"commit": "4443504fdeb7ad0be247b26ee8ebdf8ee2ee5a28"
},
"libntech": {
"repo": "https://github.com/djbclark/libntech"
Expand Down
2 changes: 1 addition & 1 deletion overlay/overlay.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"retire_when": "an upstream commit carries the same change (`bin/overlay.py retired` says RETIRE), or the code it protects is no longer shipped",
"role": "load-bearing",
"subject": "Fixed one bad CMDB entry discarding every entry in its section",
"superseded_on_fork": "2026-11-02, operator ruling R13 (PR #41): the fork's tendcf-integration branch, which overlay/fork.json pins, replaces this patch's per-entry skip with an all-or-nothing loader (branch cmdb-fail-closed: a750b1dfe, dbf9dede6, 61065e551, 736becc07; merged d32cade13, hardened by djbclark/core PR #98 and a strict libntech parse, pin 6505f488a). A skipped interlock entry leaves the services it guards unguarded. This entry still describes, and apply reproduces, commit 8f0076b81 exactly, so upstream plus the overlay skips a bad entry and does NOT behave like the pinned fork. Operator ruling 2026-11-14: Replace. A later, separate PR makes the overlay carry the all-or-nothing loader instead of this per-entry skip, because that changes what the overlay reproduces (upstream-overlay.md section 7); this PR leaves the patch and its manifest entry as they are.",
"superseded_on_fork": "2026-11-02, operator ruling R13 (PR #41): the fork's tendcf-integration branch, which overlay/fork.json pins, replaces this patch's per-entry skip with an all-or-nothing loader (branch cmdb-fail-closed: a750b1dfe, dbf9dede6, 61065e551, 736becc07; merged d32cade13, hardened by djbclark/core PR #98 and a strict libntech parse; test seam under TEST_UNIT_TEST by fork PR 99, pin 4443504). A skipped interlock entry leaves the services it guards unguarded. This entry still describes, and apply reproduces, commit 8f0076b81 exactly, so upstream plus the overlay skips a bad entry and does NOT behave like the pinned fork. Operator ruling 2026-11-14: Replace. A later, separate PR makes the overlay carry the all-or-nothing loader instead of this per-entry skip, because that changes what the overlay reproduces (upstream-overlay.md section 7); this PR leaves the patch and its manifest entry as they are.",
"upstream_pr": "https://github.com/cfengine/core/pull/6320",
"upstream_pr_state": "closed unmerged 2026-08-19"
}
Expand Down
20 changes: 13 additions & 7 deletions policy/tendcf_services.cf
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,22 @@
# loads all-or-nothing instead: an invalid entry, a repeated object member
# anywhere, non-whitespace after the document, a class name with whitespace at
# either end, a variable that exists already, and it installs none of the file,
# so this check then sees every `vars` key missing and refuses. That strict parse
# so this check, if its lenient view lists any `vars` key, sees every one of
# them missing and refuses. That strict parse
# is the CMDB loader's only: `readjson`, which this check reads the file with,
# and def.json stay lenient, so after a repeated member or a repeated `vars`
# section the check sees the LAST one only (an earlier container is not named).
# It reports a refusal when that lenient view still lists variables the loader
# did not install (or another feature it refuses on its own). When the lenient
# view is EMPTY (`{"vars":{},"vars":{}}`, or `{"vars":{}}` plus non-whitespace
# after it) nothing is installed and nothing actuates, but the check has nothing
# to report: no actuation is not a refusal report, and the loader's own error is
# then the only trace (tests/policy/run.sh 9b, empty-view controls). The two are
# view is EMPTY nothing is installed and nothing actuates, but the check has
# nothing to report: no actuation is not a refusal report, and the loader's own
# error is then the only trace (tests/policy/run.sh 9b, empty-view controls,
# which pin two examples, `{"vars":{},"vars":{}}` and `{"vars":{}}` plus
# non-whitespace after it). The examples are not the whole class. The one that
# matters operationally is `{"vars":{<the real configuration>},"vars":{}}`: the
# lenient parser keeps the last, empty `vars`, the strict loader refuses the
# file, and the whole intended configuration is silently not applied, with the
# loader's error as the only trace. The two are
# not fully independent for that reason, and each holds for a loader that fails
# closed, for one that does not, and for a gap in either, to the extent the
# other does not share the gap. The check does not model WHY an entry was
Expand Down Expand Up @@ -153,8 +159,8 @@
# `default:tendcf_cmdb.doc` or `default:tendcf_services.interlock_ids` presets
# that variable before any policy runs. What a preset does then depends on the
# promise (verify_vars.c VerifyVarPromise, read at commit b8abf28408b1; the
# pin in overlay/fork.json is now 6505f488a, which differs from it only in
# libpromises/cmdb.c, cmdb.h, tests and the libntech submodule pointer): a promise with a LITERAL rvalue (`slist => { }`) always
# pin in overlay/fork.json is now 4443504, which differs from it only in
# libpromises/cmdb.c, cmdb.h, tests, .gitmodules and the libntech submodule pointer): a promise with a LITERAL rvalue (`slist => { }`) always
# redefines it, so the policy's value stands. A promise whose rvalue is a
# FUNCTION CALL is skipped when the variable exists ("Already did this") if the
# call was not already evaluated to a value when the promise runs, and
Expand Down
10 changes: 10 additions & 0 deletions tests/policy/fixtures/test-done.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Test-only completion marker. tests/policy/run.sh appends this bundle to the
# entry policy's bundlesequence AFTER tendcf_interlocks and tendcf_services, so
# its report appears in the same output only if cf-agent validated the policy
# and evaluated both tendcf bundles in that very invocation. It is not part of
# the shipped policy/ files and actuates nothing.
bundle agent tendcf_test_done
{
reports:
"tendcf-test-done: the entry policy evaluated tendcf_interlocks and tendcf_services";
}
Loading
Loading