An instance of the flow2
family is an implementation of a finite-state machine whose description is given in the family instance configuration.
The syntax of the family instance configuration is fully identical to the syntax of the flow
family.
Family instance configuration
A configuration can be defined as a JSON object or as a string containing the path to a file with a JSON object.
During configuration, the parser of the family takes the following elements:
states
– set of internal states. This is specified as a JSON array.initial
– initial state represented by a string.transitions
– table of transitions between states. This is specified as a JSON object, where the key
is the current state, and the value
is the JSON array of states to which it may transition.All configuration parameters are required when creating a policy family instance.
Example
security.cfg
...
#include "kss/server/flow2.cfg"
/* service_flow – example implementation of an abstract service
with a configuration comprised of four states.
Further examples of using the flow2 policy are based on this example. */
use family service_flow = flow2 {
states : [sleep, started, stopped, finished],
initial : sleep,
transitions : {
sleep : [started],
started : [stopped, finished],
stopped : [started, finished]
}
};
...
Example of a finite-state machine used in this section
Page top