Project

General

Profile

Actions

Bug #18944

closed

Value replacement in "File key-value present" and "File keys-values present" methods doesn't work correctly in some cases.

Added by Anton Yakimov about 3 years ago. Updated almost 2 years ago.

Status:
Released
Priority:
N/A
Category:
Generic methods
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
63
Name check:
To do
Fix check:
Checked
Regression:

Description

I've run into a strange behavior of "File key-value present" method and couldn't understand if this correct behavior or not.

Steps:

  1. Create custom Technique
  2. Use generic method "File key-value present" with following params:
    1. File: /etc/mysql/mysql.conf.d/mysqld.cnf
    2. Key: bind-address
    3. Value: ${sys.ipv4}
    4. Separator: =
  3. Created necessary directive and assigned it to a particular node
  4. When I run rudder agent update && rudder agent run I can see that Technique is being applied to node and it shows that Technique is compliant

Observed: In /etc/mysql/mysql.conf.d/mysqld.cnf is bind-address = 127.0.0.1
Expected: In /etc/mysql/mysql.conf.d/mysqld.cnf is bind-address = 10.0.2.46

Contents of /etc/mysql/mysql.conf.d/mysqld.cnf:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
mysqlx-bind-address     = 127.0.0.1

Additional findings:

  • If I remove or comment bind-address in /etc/mysql/mysql.conf.d/mysqld.cnf - everything works as expected i.e. bind-address = 10.0.2.46 is added in the end of file.
  • If in /etc/mysql/mysql.conf.d/mysqld.cnf I replace bind-address = 127.0.0.1 with bind-address =127.0.0.1 (remove space after =) - works as expected.
  • Value = 10.0.2.46 - doesn't work.
  • Value = 192.168.0.1 - works
  • Value = 10.0.2.1 - works
  • Value = 10.0.2.10 - doesn't work
  • Value = 10.0.20.10 - works

Please see outputs from rudder agent run -v | grep -C200 ncf_maintain_keys_values_option when replacement works and doesn't in the attachment.


Subtasks 1 (0 open1 closed)

Bug #18946: also treat strict case and values methodReleasedAlexis MoussetActions

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #19908: Strict mode of file_key_value_present_option does not introduce unwanted escpaing charactersReleasedNicolas CHARLESActions
Actions

Also available in: Atom PDF