Table of Contents

This is where body server control is defined. body server control is where various settings related to cf-serverd can be tuned.

server bundles


Prototype: access_rules


bundle server access_rules()


      handle => "server_access_grant_access_policy",
      shortcut => "masterfiles",
      comment => "Grant access to the policy updates",
      admit => { @(def.acl) };

      handle => "server_access_grant_access_datafiles",
      comment => "Grant access to software updates",
      admit => { @(def.acl) };

      handle => "server_access_grant_access_binary",
      comment => "Grant access to binary for cf-runagent",
      admit => { @(def.acl) };

      handle => "server_access_grant_access_modules",
      shortcut => "modules",
      comment => "Grant access to modules directory",
      admit => { @(def.acl) };

      handle => "server_access_grant_access_plugins",
      comment => "Grant access to plugins directory",
      admit => { @(def.acl) };

      handle => "server_access_grant_access_templates",
      shortcut => "templates",
      comment => "Grant access to templates directory",
      admit => { @(def.acl) };

          resource_type => "query",
          admit_ips => { @(def.mpf_access_rules_collect_calls_admit_ips) };

      handle => "server_access_grant_access_shell_cmd",
      comment => "Grant access to shell for cfruncommand",
      admit => { @(def.policy_servers) };

      handle => "server_access_grant_access_ppkeys_hubs",
      comment => "Grant access to ppkeys for HA hubs",
      admit => { @(def.policy_servers) };

      # Allow slave hub to synchronize cf_robot and appsettings content.
      # Files are containing configuration that must be the same on all hubs.
      handle => "server_access_grant_access_cf_robot",
      comment => "Grant access to cf_robot file for HA hubs",
      admit => { @(def.policy_servers) };

      handle => "server_access_grant_access_appsettings",
      comment => "Grant access to appsettings for HA hubs",
      admit => { @(def.policy_servers) };

      # Allow access to notification_scripts directory so passive hub
      # will be able to synchronize its content. Once passive hub will
      # be promoted to act as a master all the custom scripts will be
      # accessible.
      handle => "server_access_grant_access_notification scripts",
      comment => "Grant access tonotification scripts",
      admit => { @(def.policy_servers) };

      # When HA is enabled clients are updating active hub IP address
      # using data stored in master_hub.dat file.
      handle => "server_access_grant_access_policy_server_dat",
      comment => "Grant access to policy_server.dat",
      admit => { @(def.acl) };

      # Hubs keys working in HA configuration are stored in ppkeys_hubs directory.
      # In order to perform failover while active hub is down clients needs to
      # have all hubs keys. This gives ability to connect to slave hub promoted to active role
      # once active is down.
      handle => "server_access_grant_access_to_clients",
      comment => "Grant access to hubs' keys to clients",
      admit => { @(def.acl) };

      "c:\program files\cfengine\bin\cf-agent.exe"
      handle => "server_access_grant_access_agent",
      comment => "Grant access to the agent (for cf-runagent)",
      admit   => { @(def.policy_servers) };


      # Use roles to allow specific remote cf-runagent users to
      # define certain soft-classes when running cf-agent on this host

      ".*" authorize => { "root" };


server bodies


Prototype: control


body server control
      # List of ciphers the server accepts. For Syntax help see man page
      # for "openssl ciphers". Default is "AES256-GCM-SHA384:AES256-SHA"
      #allowciphers          => "AES256-GCM-SHA384:AES256-SHA";

      # List of hosts that may connect (change the ACL in
      allowconnects         => { "" , "::1", @(def.acl) };

      # Out of them, which ones should be allowed to have more than one
      # connection established at the same time?
      allowallconnects      => { "" , "::1", @(def.acl) };

      # Out of the hosts in allowconnects, trust new keys only from the
      # following ones.  SEE COMMENTS IN
      trustkeysfrom         => { @(def.trustkeysfrom) };

      ## List of the hosts not using the latest protocol that we'll accept connections from
      ## (absence of this option or empty list means allow none)
      allowlegacyconnects   => { @(def.control_server_allowlegacyconnects) };

      # Maximum number of concurrent connections.
      # Suggested value >= total number of hosts
      maxconnections        => "$(def.control_server_maxconnections)";

      # Allow connections from nodes which are out-of-sync
      denybadclocks         => "false";


      # How often cf-serverd should try to establish a reverse tunnel for report
      # collection

      call_collect_interval => "$(def.control_server_call_collect_interval)";

      # The time in seconds that a collect-call tunnel will remain open for hub
      # to complete report transfer.
        collect_window => "$(def.control_server_collect_window)";

    # The MPF provides different variables for configuring which users are
    # allowed to initiate execution via cf-runagent.
      allowusers => { @(def.control_server_allowusers_non_policy_server) };

        allowusers => { @(def.control_server_allowusers_policy_server) };

      cfruncommand => "$(sys.cf_agent) -I -D cf_runagent_initiated -f \"$(sys.update_policy_path)\"  &
                       $(sys.cf_agent) -I -D cf_runagent_initiated";


      # In 3.10 the quotation is properly closed when EOF is reached. It is left
      # open so that arguments (like -K and --remote-bundles) can be appended.
      # 3.10.x does not automatically append -I -Dcfruncommand

        cfruncommand => "$(def.cf_runagent_shell) -c \'
                           $(sys.cf_agent) -I -D cf_runagent_initiated -f $(sys.update_policy_path)  ;
                           $(sys.cf_agent) -I -D cf_runagent_initiated";


      # 3.7.x does not properly close open quotes when EOF is reached preventing
      # policy execution, so we must provide a trailing quote for cfruncommand.

      # 3.7.x Automatically appends -I -Dcfruncommand to the cfruncommand. This
      # results in an error about not being allowed to specify inputs for remote
      # execution from the update policy. In order to preserve the ability for
      # policy to know its execution provenance we define a different class
      # `cf_runagent_initiated` that does not elicit the error.

        cfruncommand => "$(def.cf_runagent_shell) -c \'
                           $(sys.cf_agent) -I -D cf_runagent_initiated -f $(sys.update_policy_path)  ;
                           $(sys.cf_agent) -I -D cf_runagent_initiated\'";

      # Bind to all interfaces including ipv6
      # Adding this on windows will force ipv6 only
      bindtointerface => "::";