]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3939] Changed restrict-commands default to true
authorFrancis Dupont <fdupont@isc.org>
Thu, 12 Jun 2025 15:06:58 +0000 (17:06 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 16 Jun 2025 13:56:58 +0000 (15:56 +0200)
doc/sphinx/arm/hooks-ha.rst
src/hooks/dhcp/high_availability/ha_config.cc
src/hooks/dhcp/high_availability/ha_config_parser.cc
src/hooks/dhcp/high_availability/ha_service_states.cc
src/hooks/dhcp/high_availability/tests/ha_config_unittest.cc
src/hooks/dhcp/high_availability/tests/ha_mt_unittest.cc

index 89f4e31ed03f9c651631a90783d0c628808a27a7..86ecd1d9626cd9877c9fa5583af8317edc61df76 100644 (file)
@@ -232,7 +232,7 @@ Since Kea 2.1.7 the HTTPS server side is supported:
 
 Kea 2.1.7 added a new security feature with the ``restrict-commands`` HA config
 parameter: when set to ``true``, commands which are not used by the hook are
-rejected. The default is ``false``.
+rejected. The default is ``true`` since Kea 3.0.0.
 
 The following is an example of an HA server pair and Control Agent configuration
 for ``hot-standby`` with TLS.
index 8bb9e4f9d89d08dabda6347926934ec0fd407b0f..8ac96f782cb4b33fc16c36454d89723eff67671c 100644 (file)
@@ -170,7 +170,7 @@ HAConfig::HAConfig()
       wait_backup_ack_(false), enable_multi_threading_(false),
       http_dedicated_listener_(false), http_listener_threads_(0), http_client_threads_(0),
       trust_anchor_(), cert_file_(), key_file_(), require_client_certs_(true),
-      restrict_commands_(false), peers_(),
+      restrict_commands_(true), peers_(),
       state_machine_(new StateMachineConfig()) {
 }
 
index f7349e0872124bb3edec3bdcc25c6b1fbce00e50..de944a8be27668a8bb604ff644c14d809836023b 100644 (file)
@@ -34,7 +34,7 @@ const SimpleDefaults HA_CONFIG_DEFAULTS = {
     { "max-unacked-clients",        Element::integer, "10" },
     { "max-rejected-lease-updates", Element::integer, "10" },
     { "require-client-certs",       Element::boolean, "true" },
-    { "restrict-commands",          Element::boolean, "false" },
+    { "restrict-commands",          Element::boolean, "true" },
     { "send-lease-updates",         Element::boolean, "true" },
     { "sync-leases",                Element::boolean, "true" },
     { "sync-timeout",               Element::integer, "60000" },
index 5371142ec07b59ef8fe9df0d1288147c84736279..d2529a75077778b9e58cd1c2b097d08514efa8fe 100644 (file)
@@ -90,5 +90,5 @@ int stringToState(const std::string& state_name) {
     isc_throw(BadValue, "unknown state " << state_name);
 }
 
-} // end of namespace isc::ha 
+} // end of namespace isc::ha
 } // end of namespace isc
index 1c17ea4a4c70c0d92a31e074aa471218b76669ac..5d5bd204494b74104b9bf12867c628712c6e8696 100644 (file)
@@ -1430,7 +1430,7 @@ TEST_F(HAConfigTest, tlsParameterInheritance) {
         "        \"cert-file\": \"!CA!/kea-client.crt\","
         "        \"key-file\": \"!CA!/kea-client.key\","
         "        \"require-client-certs\": false,"
-        "        \"restrict-commands\": true,"
+        "        \"restrict-commands\": false,"
         "        \"peers\": ["
         "            {"
         "                \"name\": \"my-server\","
@@ -1479,7 +1479,7 @@ TEST_F(HAConfigTest, tlsParameterInheritance) {
     expected += "/kea-client.key";
     EXPECT_EQ(expected, impl->getConfig()->getKeyFile().get());
     EXPECT_FALSE(impl->getConfig()->getRequireClientCerts());
-    EXPECT_TRUE(impl->getConfig()->getRestrictCommands());
+    EXPECT_FALSE(impl->getConfig()->getRestrictCommands());
 
     // Check the first peer parameters: it inherits them from the global level.
     HAConfig::PeerConfigPtr cfg = impl->getConfig()->getThisServerConfig();
index e84057480f766749cc1f672358570a957bdbfef7..f9a79638a253ac4625fc520a888dff521db8fb83 100644 (file)
@@ -165,7 +165,7 @@ TEST_F(HAMtServiceTest, multiThreadingBasics) {
         "        \"this-server-name\": \"server1\","
         "        \"mode\": \"passive-backup\","
         "        \"wait-backup-ack\": true,"
-        "        \"restrict-commands\": true,"
+        "        \"restrict-commands\": false,"
         "        \"peers\": ["
         "            {"
         "                \"name\": \"server1\","