Project

General

Profile

Actions

Bug #18286

closed

Agents fail to check their policy server's identity

Added by Alexis Mousset over 3 years ago. Updated 9 months ago.

Status:
Released
Priority:
N/A
Category:
Security
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Reviewed
Fix check:
Checked
Regression:

Description

The situation:

  • With protocol v1 changing server certs prevented connection from nodes (but very likely because of a bug more than a security check), and required removing server public key on nodes
Authentication failure: private decrypt of received challenge failed (padding check failed)
  • With protocol v2 nodes always trusts nodes having an IP matching the one configured (or resolved from hostname) as policy server.

We promise at least a TOFU on these connections, with the ability to securely provision nodes.

In the current situation, an attacker only needs to use the root or relay IP or poison the DNS, and can take control of the nodes (even without knowing their ids as code can be injected in ncf).


Subtasks 15 (0 open15 closed)

Architecture #18291: Add a keyword to restrict copy_from sources by keyReleasedBenoît PECCATTEActions
Bug #18293: Bootstrap should only trustkey if it has no trusted key yetReleasedBenoît PECCATTEActions
Bug #18319: Typo in ticket 18293ReleasedAlexis MoussetActions
Bug #18323: policies broken by parent ticketReleasedAlexis MoussetActions
Bug #18345: Broken policy in parent when agent is not compatibleRejectedActions
Bug #18343: Agents only check server IP when downloading policies - 5.0 fixesReleasedFélix DALLIDETActions
Bug #18344: copyfrom_restrict_keys not correctly applied in 5.0 initial policiesReleasedFélix DALLIDETActions
Bug #18348: After a factory reset agents can no longer download their policies from the new server they are managed byReleasedAlexis MoussetActions
Bug #18407: Factory reset does not workReleasedBenoît PECCATTEActions
Bug #18408: Factory reset does not work - techniquesReleasedNicolas CHARLESActions
Bug #18410: Parent will fait to trust server in some casesReleasedNicolas CHARLESActions
Bug #18422: parent ticket fails to prevent trustReleasedAlexis MoussetActions
Bug #18356: Add a command to reset trustReleasedAlexis MoussetActions
Bug #18399: Improve messages in agent about server key resetReleasedFrançois ARMANDActions
Bug #18430: server-reset-keys should call a resetReleasedBenoît PECCATTEActions

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #18289: Missing system variable "POLICY_SERVER_KEY"ReleasedAlexis MoussetActions
Related to Rudder - Bug #18297: Store policy server key hash separately to establish a specific trustRejectedActions
Actions #1

Updated by Alexis Mousset over 3 years ago

  • Subject changed from Agent only check server IP when downloading policies to Agents only check server IP when downloading policies
Actions #2

Updated by Alexis Mousset over 3 years ago

  • Status changed from New to In progress
  • Assignee set to Alexis Mousset
Actions #3

Updated by Alexis Mousset over 3 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Alexis Mousset to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1625
Actions #4

Updated by François ARMAND over 3 years ago

  • Related to Bug #18289: Missing system variable "POLICY_SERVER_KEY" added
Actions #5

Updated by Alexis Mousset over 3 years ago

No relay

When there are no relay servers we can:

  • Remove trustkey from copy_from bodies in initial and generated policies
  • Empty trustkeysfrom on non policy server nodes
  • => These ensure bootstrap policies are the only place we allow nodes to establish trust with their server. Once bootstrapped (and if not reset) the node will only trust its server.

The key point is that root server do not download policies from a server but executes them locally, and only accepts remote-run from local addresses. This makes it immune to the described attack which only affect nodes and relays.

With this:

  • We have TOFU back by default
  • We allow secured bootstrapping

With relays

We need all from previous section, but it's trickier as we need the relay to allow connections from managed nodes and to download policies from a remote server

Idea

Add an admit_key for policy update (could be global to the agent for all connections with a copyfrom_restrict_keys => { ... } in body agent control, cannot be admit_keys as we can't provide a meaningful default value). This makes the security model really simple, but is some work, and may not be upstreamed.

Actions #6

Updated by Alexis Mousset over 3 years ago

  • Target version changed from 6.1.6 to 5.0.20
Actions #7

Updated by Alexis Mousset over 3 years ago

  • Status changed from Pending technical review to In progress
  • Assignee changed from Benoît PECCATTE to Alexis Mousset
Actions #8

Updated by Alexis Mousset over 3 years ago

  • Pull Request changed from https://github.com/Normation/rudder-techniques/pull/1625 to https://github.com/Normation/rudder-techniques/pull/1626
Actions #9

Updated by Alexis Mousset over 3 years ago

Actions #10

Updated by Alexis Mousset over 3 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Alexis Mousset to Benoît PECCATTE
Actions #11

Updated by Alexis Mousset over 3 years ago

  • Related to Bug #18297: Store policy server key hash separately to establish a specific trust added
Actions #12

Updated by Benoît PECCATTE over 3 years ago

  • Related to Bug #18293: Bootstrap should only trustkey if it has no trusted key yet added
Actions #13

Updated by Alexis Mousset over 3 years ago

  • Status changed from Pending technical review to Pending release
Actions #14

Updated by Alexis Mousset over 3 years ago

  • Subject changed from Agents only check server IP when downloading policies to Agents fail to check their policy server's identity
Actions #15

Updated by Alexis Mousset over 3 years ago

  • Name check changed from To do to Reviewed
Actions #16

Updated by Alexis Mousset over 3 years ago

  • Fix check changed from To do to Checked
Actions #17

Updated by Alexis Mousset over 3 years ago

  • Related to Bug #18408: Factory reset does not work - techniques added
Actions #18

Updated by Alexis Mousset over 3 years ago

  • Related to Bug #18407: Factory reset does not work added
Actions #19

Updated by Vincent MEMBRÉ almost 3 years ago

This bug has been fixed in Rudder 5.0.20, 6.0.10, 6.1.6, 6.2.0~beta1 which were released by the end of October 2020.

Actions #20

Updated by Vincent MEMBRÉ almost 3 years ago

  • Status changed from Pending release to Released
Actions #21

Updated by Alexis Mousset 9 months ago

  • Private changed from Yes to No
Actions

Also available in: Atom PDF