Access Module
Alfred Botman
Compatibility :Description
This module adds support for access rights over commands exported by modules.The access module uses a configuration file having two arrays:
- An array of commands, defining each command and the access level needed to use it.
- An array of users, having the username (patterns accepted), and its associated userlevel.
Configuration
For this module to work, you need a minimal JSON file used as configuration file (/etc/gotham/modules.conf.d/access.conf
)
{
"revision": 1,
"citizens": [{
"pattern": "admin.*",
"level": 10,
"description": "Access rights for admins"
}, {
"pattern": "support.*",
"level": 5,
"description": "Access rights for support guys"
}],
"commands": [{
"pattern": ".ssh *",
"level": 5,
"description": "Open or close a maintenance tunnel"
}, {
"pattern": ".reboot *",
"level": 10,
"description": "Reboot system"
}]
}
The revision number is used to synchronize access rights over the botmans.It will grow automatically as you set rights using `.access set` command.
Commands
Alfred Botman
This command will list every access entry set.
Only user access can be managed here. For commands level, it has to be done manually in the configuration file.
This command will list every access entry set.
Only user access can be managed here. For commands level, it has to be done manually in the configuration file.
(23/11/2015 15:00:12) guillaume.friloux@botman.master.com: .access (15:00:12) Alfred Pennyworth: List of access rights : 0/ Pattern [botman.*] → Access level [1] Bots group 1/ Pattern [admin.*] → Access level [10] Admins group 2/ Pattern [dev.*] → Access level [8] Devs group 3/ Pattern [support.*] → Access level [5] Supports group
Alfred
This command allows you to add a pattern matching users to set access level.
The access right will be immediately applied to every bots.
This command allows you to add a pattern matching users to set access level.
The access right will be immediately applied to every bots.
(15:11:25) guillaume.friloux@botman.master.com: .access add demo.* 1 Demonstration (15:11:25) Alfred Pennyworth: Modification done
Alfred
This command will update an access entry to change the affected access level.
This command will update an access entry to change the affected access level.
(15:13:05) guillaume.friloux@botman.master.com: .access set demo.* 2 (15:13:05) Alfred Pennyworth: Modification done
Alfred
(15:26:33) guillaume.friloux@botman.master.com: .access del demo.* (15:26:33) Alfred Pennyworth: Modification done
Alfred
This command will sync current access rights to all the bots.
This might be useful if one bot missed an update due to being offline by the time the update happened.
This command will sync current access rights to all the bots.
This might be useful if one bot missed an update due to being offline by the time the update happened.
(15:36:28) guillaume.friloux@botman.master.com: .access sync (15:36:28) Alfred Pennyworth: Everyone seems to be up2date