Project

General

Profile

Actions

User story #8629

closed

Allows generation-time javascript eval in directive parameters

Added by François ARMAND almost 8 years ago. Updated over 7 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

Some times, we want to make little transformation in user input before using it.

Typically, we want to use the node hostname, but actually just the hostname (not the full FQDN), and capitalize.
Or we want to take only the first char group of node UUID.
Or we want to hash some text in sha512 to sign something, and the text must containt the node ip.
Or whatever.

Today, these use case can only be done with a script on the node and a CFEngine variable definition. Not only these is cumbersome, sometimes it is NOT what we want. In particular in the case of the hash, we don't want to give admin of the node (or other people having read access to that information) hint about how the hash is built.

So, the goal is to provide a generic scripting langage (a subset of a well know one - js) to allows text manipulation, and have the eval done when we have node contextual information (id, properties, etc) available.

Of course, we must be careful about performance, error reporting, syntaxe.

Finally, we propose to put the feature available in 3.1 BEHIND a feature switch, so that people can try the feature in current long term supported version, but so that nothing change by default for other.


Subtasks 2 (0 open2 closed)

User story #8772: Document Javascript scripts usage in VariableReleasedVincent MEMBRÉ2016-07-28Actions
User story #8782: Fix details on script (remove $ from token and fix double password prefix)ReleasedBenoît PECCATTE2016-07-29Actions

Related issues 6 (0 open6 closed)

Related to Rudder - Bug #8801: Inconsistent hashing algorithms used in passwords generated in the script engineReleasedVincent MEMBRÉ2016-08-02Actions
Related to Rudder - Bug #8857: Some Javascript engine fails when accessing system valuesReleasedFrançois ARMAND2016-08-17Actions
Related to Rudder - Bug #8936: JS scripting engine is broken with IBM JDK 7 (and 8)ReleasedVincent MEMBRÉ2016-09-01Actions
Related to Rudder - Bug #9190: Script evaluation is not limited to password fields anymoreReleasedNicolas CHARLES2016-09-30Actions
Related to Rudder - User story #6264: Get directive parameter value from external source (kv store, rest, etc)ResolvedActions
Related to Rudder - User story #3380: Add ace.js libraryRejectedActions
Actions

Also available in: Atom PDF