[DRAFT 2.0] spine: TLS-by-default and plugin-contract behavior changes - #537
[DRAFT 2.0] spine: TLS-by-default and plugin-contract behavior changes#537somethingwithproof wants to merge 179 commits into
Conversation
- Add CMakeLists.txt mirroring configure.ac feature checks - Add config/config.h.cmake.in template for cmake builds - Add build-cmake-linux CI job (gcc/clang matrix) - Add build-windows CI job (MSYS2/MinGW-w64, continue-on-error) - Windows crash dump collection via WER LocalDumps - Gate -Wall by compiler ID (GNU/Clang vs MSVC) - Use CMAKE_DL_LIBS instead of hardcoded -ldl - Parse net-snmp-config --libs into proper NETSNMP_LIBRARIES - Add SNMP_LOCALNAME compile check for feature parity - No C source files modified Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
spine.h depends on types from common.h (MYSQL, pid_t, size_t, pthread types, RESULTS_BUFFER from config.h). Add a compile-time guard that produces a clear error if spine.h is included without common.h, rather than cascading type errors. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
strncasecmp() returns 0 on match, but the comparisons used the raw return value as truthy, inverting the logic. TCP matched non-TCP strings and vice versa. Also fix: comparisons against 'hostname' instead of 'token' (lines 1020, 1032), and strncasecmp length 3 for 4-char strings "TCP6"/"UDP6" (should be 4). Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
getarg(opt, &argv) advances the argv pointer on each call. Three successive calls in the --mode handler consumed three argv entries instead of one, corrupting subsequent argument parsing when using the space-separated form (--mode online). Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Adds a thin libaudit wrapper (spine_audit_event) that emits a USER_CMD record with op=spine-* prefix so auditd filter rules can route spine events to a dedicated audit pipe. Events wired up at: * SIGHUP reload success/failure * SIGTERM graceful stop * Per-host circuit breaker trip (device id + skip cycles in detail) libaudit is a soft dependency: WITH_AUDIT=OFF or absent audit-libs compiles spine_audit_event to a no-op so non-Linux and audit-less Linux builds keep working. Signed-off-by: Thomas Vincent <thomas@atconsulting.ie>
…tate" This reverts commit 2110794. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
BREAKING: DB_UseSSL and RDB_UseSSL default to 1 (preferred) instead of 0. A spine binary talking to a TLS-capable MySQL/MariaDB server now negotiates an encrypted channel without operator action. The option becomes tri-state: 0 = plaintext (explicit opt-out; former default) 1 = preferred (default; negotiate TLS if server offers it) 2 = verify_identity (require TLS and verify hostname against CA) Previously the code treated any non-zero value as VERIFY_IDENTITY, which made it impossible to ask for best-effort TLS. The new middle tier closes that gap without forcing CA bundle distribution on every poller. Deployments that cannot reach a TLS-capable server (legacy MySQL, plain TCP inside a trusted L2 segment) must set DB_UseSSL=0 explicitly. Signed-off-by: Thomas Vincent <thomas@atconsulting.ie>
There was a problem hiding this comment.
cppcheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
…ption Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
platform_sandbox_linux.c used uint64_t in the HAVE_LANDLOCK block without including <stdint.h>; the missing type caused the add_path_rule signature to fail to parse, which cascaded into an implicit-declaration error at the first call site. spine.c calls prctl() under #ifdef __linux__ but sys/prctl.h was only pulled in transitively via common.h when HAVE_LCAP is defined; add a direct conditional include so non-cap builds see the declaration. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
glibc's <features.h> freezes the feature-test bitmap on first inclusion. platform.h pulls <time.h> and platform_process.h pulls <sys/types.h>, both of which reach <features.h> before CMake's -D_GNU_SOURCE=1 flag can take effect in the preprocessor pipeline on clang/Linux. Without the macro visible at that point, pthread_setname_np and pipe2 remain undeclared, producing -Werror=implicit-function-declaration failures. Add a `#if defined(__linux__) && !defined(_GNU_SOURCE)` guard at the top of each affected TU so the macro is always set before any system header is included, regardless of include order or compiler. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…oaders Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
Addressed the outstanding security-analysis findings in dd8550f:
Validation: actionlint and workflow policy pass; the reported cppcheck patterns are gone; CMake build passes; all 19 CTest tests pass. |
|
Closing in favour of #523. These branches are not three features. All three independently delete autotools ( The TLS work here is worth keeping and I will bring it back separately: the |
Carved out from #535 per @TheWitness — behavioral changes that affect the plugin state-machine contract (thold, amqp-publisher, boost) land in 2.0, not 1.3.
What's in this PR
A1. TLS-by-default for MySQL (6896444)
Flips
DB_UseSSL/RDB_UseSSLdefault from0to1(preferred, with graceful fallback). Plugin-observable via connection setup timing and cleartext-required MySQL servers rejecting the handshake.1.3 behavior (matrix branch): default remains
0, operators opt in via spine.conf.2.0 behavior (this branch): default is
1, operators opt out explicitly.Why these items defer
Each change touches one of the plugin contract layers:
poller_outputwrite timing or contentpoller_timerow shapehost.statustransition semanticsState-machine RFC
Planning an RFC doc to define the 2.0 contract with @TheWitness:
poller_output,poller_time,host.*)Next steps
cacti_check_shell_metachars.php) for deprecation windowCloses nothing on 1.3; tracking for 2.0 only.
Related: #523 (CMake migration, 1.3), #535 (platform + security + operator tooling, 1.3).