{"id":1167,"date":"2009-11-18T23:26:01","date_gmt":"2009-11-18T22:26:01","guid":{"rendered":"http:\/\/www.devco.net\/?p=1167"},"modified":"2010-08-17T12:29:52","modified_gmt":"2010-08-17T11:29:52","slug":"mcollective_security_with_activemq","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2009\/11\/18\/mcollective_security_with_activemq.php","title":{"rendered":"MCollective Security with ActiveMQ"},"content":{"rendered":"
As part of rolling out mcollective you need to think about security. The various examples in the quick start guide<\/a> and on this blog has allowed all agents to talk to all nodes all agents. The problem with this approach is that should you have untrusted users on a node they can install the client applications and read the username\/password from the server config file and thus control your entire architecture.<\/p>\n Since revision 71 of trunk the structure of messages has changed to be compatible with ActiveMQ authorization structure, I’ve also made the structure of the message targets configurable. The new default format is compatible with ActiveMQ wildcard patterns<\/a> and so we can now do fine grained controls over who can speak to what. <\/p>\n General information about ActiveMQ Security can be found on their wiki<\/a>.<\/p>\n The default message targets looks like this:<\/p>\n <\/code><\/p>\n The nodes only need read access to the command topics and only need write access to the reply topics. The examples below also give them admin access so these topics can be created dynamically. For simplicity we’ll wildcard the agent names, you could go further and limit certain nodes to only run certain agents. Adding these controls effectively means anyone who gets onto your node will not be able to write to the command topics and so will not be able to send commands to the rest of the collective.<\/p>\n There’s one special case and that’s the registration topic, if you want to enable the registration feature<\/a> you should give the nodes access to write on the command channel for the registration agent. Nothing should reply on the registration topic so you can limit that in the ActiveMQ config.<\/p>\n We’ll let mcollective log in as the mcollective<\/em> user, create a group called systemusers<\/em>, we’ll then give the systemsuser group access to run as a typical registration enabled mcollective node.<\/p>\n The rip<\/em> user is a mcollective admin and can create commands and receive replies.<\/p>\n First we’ll create users and the groups.<\/p>\n <\/code><\/p>\n Now we’ll create the access rights:<\/p>\n<\/p>\n
\r\n\/topic\/mcollective.agentname.command\r\n\/topic\/mcollective.agentname.reply\r\n<\/pre>\n
<\/p>\n
\r\n
<\/p>\n
\r\n