Permissions
Location path
| Path in the container |
|---|
|
Overview
Defines permissions for using various resources.
If the file or a key for an application is absent, that application behaves according to its default behavior.
By default the file is absent.
{
"exec_perm": {
"user": "root" | "domain" | "custom"
"commands": array<str>,
"domains": array<object>
},
"erlang_apply": {
"function_groups": {
GroupKey: array<str>
},
"common": array<str>,
"domains": {
Domain: array<str>
}
},
"allowed_nodes": [
{
"node": str,
"cookie": str
},
...
]
}
"exec_perm" section
Contains the permission object for direct execution of OS (console) processes and applications by absolute path from scripts by the "Process launch" component.
By default execution of external commands is prohibited.
-
"user"– contains the name of the mode setting the user name under which allowed applications will be launched. Default"domain". Value variants:-
"root"– the application runs as the "root" user. Unless otherwise specified in the properties of the specific domain in the"domains"list. -
"domain"– the application runs as the user with a name matching the name of the domain in which the script runs. Unless otherwise specified in the domain properties in the"domains"list. -
"custom"– the application runs as the user defined in the properties of the specific domain in the "domains" list. In this case every domain in which the specified applications are allowed to execute must be listed in"domains"and must have a value in the"user"field.
-
-
"commands"– contains the set of commands (essentially applications) allowed to execute. Default empty list - nothing is allowed to launch by the "Process launch" component. -
"domains"– contains the set of domains and their individual properties. Default empty list. If the domain in which the script runs is found in the domain list, the allowed command (application) list is taken from the domain"commands"field. And the user under which the application runs is the value from the domain"user"field; if it is empty, the value from the common section is used.
{
"name": "DOMAIN_NAME",
"user": "USER_NAME",
"commands": array<str>
}
-
name– domain name. -
user– OS user name. -
commands– set of commands allowed to execute.
[ "echo", "myprogram1", "/bin/myprogram2", ":SYNC/common/cmd/echo.sh", ":GLOBALSHARE/common/cmd/myprogram3" ]
In a script a macro path or any path can be specified. A macro path is reduced to the common macro; other paths remain unchanged. The result must necessarily be contained in the allowed command list. A path can also be specified via the 'bash' command, for example 'bash :GLOBALSHARE_COMMON/cmd/myprogram3.sh'. In this case bash should not be mentioned in the allowed commands, but the given path to the bash script itself should be mentioned.'
"erlang_apply" section
Contains the permission object for executing functions from script expressions.
Script expressions are erlang expressions interpreted using special syntax (access to script variables, built-in functions, and operations). Thus an expression may contain complex code for specific data processing.
This code may contain calls to external functions declared in communication platform modules, in modules loaded via patches, or in Erlang OTP modules. Such calls may be unsafe both from the data perspective and from the perspective of a specific script’s impact on the whole system. Therefore by default execution of external functions is fully prohibited.
However, during system configuration permissions can be added for specific functions, individual modules, or any permissions can be opened (except certain system modules):
-
"module_name"- module is open; -
"module:function_name"- a specific function by name is open in any exported variant; -
"module:function_name/arity"- a specific function by name and parameter count is open; -
"*"- any functions are open except the os, file, code, init, rpc, erlang modules. To allow working with one of the listed modules, it must be explicitly included in the permission.
The configuration may contain special permissions for specific domains by their names. For convenience functions are collected into groups (allowed_functions), and domain configuration specifies the names of connected groups. Groups specified in the "common" list are available to all domains.
{
"allowed_functions": {
"public": ["math","maps","lists"],
"erlang": [
"erlang:!", "erlang:*", "erlang:+", "erlang:++", "erlang:-", "erlang:--", "erlang:/", "erlang:/=",
"erlang:<", "erlang:=/=", "erlang:=:=", "erlang:=<", "erlang:==", "erlang:>", "erlang:>=", "erlang:abs",
"erlang:adler32", "erlang:adler32_combine", "erlang:and", "erlang:append", "erlang:append_element",
"erlang:atom_to_binary", "erlang:atom_to_list", "erlang:band", "erlang:binary_part", "erlang:binary_to_atom",
"erlang:binary_to_existing_atom", "erlang:binary_to_float", "erlang:binary_to_integer", "erlang:binary_to_list",
"erlang:binary_to_term", "erlang:bit_size", "erlang:bitstring_to_list", "erlang:bnot", "erlang:bor",
"erlang:bsl", "erlang:bsr", "erlang:bxor", "erlang:byte_size", "erlang:ceil", "erlang:convert_time_unit",
"erlang:crc32", "erlang:crc32_combine", "erlang:date", "erlang:decode_packet", "erlang:delete_element",
"erlang:display", "erlang:display_string", "erlang:div", "erlang:element", "erlang:erase", "erlang:float",
"erlang:float_to_binary", "erlang:float_to_list", "erlang:floor", "erlang:function_exported", "erlang:get",
"erlang:insert_element", "erlang:integer_to_binary", "erlang:integer_to_list", "erlang:iolist_size",
"erlang:iolist_to_binary", "erlang:is_alive", "erlang:is_atom", "erlang:is_binary", "erlang:is_bitstring",
"erlang:is_boolean", "erlang:is_builtin", "erlang:is_float", "erlang:is_function", "erlang:is_integer",
"erlang:is_list", "erlang:is_map", "erlang:is_map_key", "erlang:is_number", "erlang:is_pid", "erlang:is_record",
"erlang:is_reference", "erlang:is_tuple", "erlang:length", "erlang:list_to_atom", "erlang:list_to_binary",
"erlang:list_to_bitstring", "erlang:list_to_existing_atom", "erlang:list_to_float", "erlang:list_to_integer",
"erlang:list_to_ref", "erlang:list_to_tuple", "erlang:localtime", "erlang:localtime_to_universaltime",
"erlang:make_ref", "erlang:make_tuple", "erlang:map_get", "erlang:map_size", "erlang:max", "erlang:md5",
"erlang:md5_final", "erlang:md5_init", "erlang:md5_update", "erlang:memory", "erlang:min",
"erlang:monotonic_time", "erlang:node", "erlang:not", "erlang:now", "erlang:or", "erlang:phash", "erlang:phash2",
"erlang:pid_to_list", "erlang:posixtime_to_universaltime", "erlang:put", "erlang:ref_to_list", "erlang:rem",
"erlang:round", "erlang:self", "erlang:setelement", "erlang:size", "erlang:split_binary", "erlang:subtract",
"erlang:term_to_binary", "erlang:time", "erlang:time_offset", "erlang:timestamp", "erlang:tl", "erlang:trunc",
"erlang:tuple_size", "erlang:tuple_to_list", "erlang:unique_integer", "erlang:universaltime",
"erlang:universaltime_to_localtime", "erlang:universaltime_to_posixtime", "erlang:xor"
],
"extra": ["patch_module:my_method/3"],
"all": ["*"]
},
"common": ["public","erlang"],
"domains": {
"incoplax.com": ["all"],
"pbx.incoplax.com": ["extra"]
}
}