From 81eb53713e8903030a992b72944b66009621e5be Mon Sep 17 00:00:00 2001 From: ghptc Date: Tue, 27 Oct 2026 17:51:37 -0300 Subject: [PATCH] fix(security): preserve private Promod auto-fill policy --- docs/security-promod-autofill-policy.md | 26 ++++++++++++++ modes/promod/server.cfg | 4 +-- tests/test_promod_security_policy.py | 46 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 docs/security-promod-autofill-policy.md create mode 100644 tests/test_promod_security_policy.py diff --git a/docs/security-promod-autofill-policy.md b/docs/security-promod-autofill-policy.md new file mode 100644 index 0000000..3866b37 --- /dev/null +++ b/docs/security-promod-autofill-policy.md @@ -0,0 +1,26 @@ +# Security release: preserve the private Auto-Fill policy + +A read-only production `bot_status` check on 2026-10-27 found Auto-Fill disabled, +with limit12. The first pinned security image used catalog9f0fa1a, whose final +Promod rules forced `bot_enable "1"` after private configuration. Deploying that +image would enable an unrelated gameplay policy during the security freeze. + +Remove the final forced enable directive. Shared defaults and final mode rules +now leave the private/operator choice intact. The reviewed native engine defaults +Auto-Fill off, so no private enable directive also remains off. Explicit private +enabling and existing administration commands retain their normal authority. +Capacity, the fill limit, map rotation and integrity policy are unchanged. + +The regression checks model the documented shared → private → final-mode order. +They fail against9f0fa1a for both the off default and an explicit private off +choice, and pass after this change; an explicit private on choice also survives. +Actual runtime confirmation still requires rebuilding with the new approved +config revision and querying the isolated/homolog candidate. + +This PR changes no running service, secret or production file. The previously +built image remains preserved and is not edited or promoted. After owner review, +mandatory CI and a manual merge, bind a reviewed preparation driver to the exact +new config commit, rebuild through that driver, verify the new image/CFG hashes +and requalify the affected runtime behavior. Do not reuse the old image's approval +or substitute configuration under its digest. Homologation deployment and any +production release require separate explicit operator approval. diff --git a/modes/promod/server.cfg b/modes/promod/server.cfg index 5648edf..c243156 100644 --- a/modes/promod/server.cfg +++ b/modes/promod/server.cfg @@ -28,7 +28,7 @@ set g_voteMaxVotes "2" set g_voteAbstainWeight "1" set g_voteCooldown "5" -// Mode owns the existing Bot Warfare auto-fill policy. -set bot_enable "1" +// Security release: retain the private/operator Auto-Fill enable policy. +// The engine default is off; do not override an explicit private choice here. set bot_fill_limit "12" set sv_mapRotationCurrent "" diff --git a/tests/test_promod_security_policy.py b/tests/test_promod_security_policy.py new file mode 100644 index 0000000..57c82cb --- /dev/null +++ b/tests/test_promod_security_policy.py @@ -0,0 +1,46 @@ +"""Canonical rules run after private CFGs and must not silently enable Auto-Fill.""" +from pathlib import Path +import shlex +import unittest + +ROOT = Path(__file__).resolve().parents[1] + + +def apply_catalog_cfg(settings, path): + for line in path.read_text().splitlines(): + line = line.strip() + if not line or line.startswith('//'): + continue + words = shlex.split(line) + # These catalogs are data-only set commands; reject an unreviewed command + # rather than silently ignoring a future indirect policy override. + if len(words) != 3 or words[0].lower() != 'set': + raise AssertionError('Unreviewed catalog command in ' + str(path)) + settings[words[1].lower()] = words[2] + + +class PromodSecurityPolicy(unittest.TestCase): + def resolve(self, private_choice=None): + # Native SV_BotManagerInit at the reviewed release revision defaults off. + settings = {'bot_enable': '0'} + apply_catalog_cfg(settings, ROOT / 'shared/server.cfg') + if private_choice is not None: + settings['bot_enable'] = private_choice + apply_catalog_cfg(settings, ROOT / 'modes/promod/server.cfg') + return settings + + def test_security_release_does_not_enable_default_autofill(self): + self.assertEqual(self.resolve()['bot_enable'], '0') + + def test_private_autofill_choice_survives_final_mode_rules(self): + for choice in ('0', '1'): + with self.subTest(private_choice=choice): + settings = self.resolve(choice) + self.assertEqual(settings['bot_enable'], choice) + self.assertEqual(settings['bot_fill_limit'], '12') + self.assertEqual(settings['sv_pure'], '1') + self.assertEqual(settings['g_gametype'], 'sd') + + +if __name__ == '__main__': + unittest.main()