Update mcollective.init according to OSCI-855
[packages/precise/mcollective.git] / website / reference / plugins / security_aes.md
1 ---
2 layout: default
3 title: OpenSSL based Security Plugin
4 ---
5 [SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
6 [Registration]: registration.html
7 [SSLSecurity]: security_ssl.html
8 [SecurityOverview]: ../../security.html
9
10 ## Overview
11 This plugin impliments a AES encryption and RSA public / private key based security system
12 for The Marionette Collective.
13
14 Please review the [Security Overview][SecurityOverview] for a general discussion about security in Marionette Collective.
15
16 The design goals of this plugin are:
17
18  * Each actor - clients and servers - can have their own set of public and private keys
19  * All actors are uniquely and cryptographically identified
20  * Requests are encrypted using the clients private key and anyone that has
21    the public key can see the request.  Thus an atacker may see the requests
22    given access to a public key of the requester.
23  * Request TTLs and Message Times are cryptographically secured and tampered
24    messages are not accepted by default. This is a first line defence in message
25    replaying and tampering.
26  * Replies are encrypted using the calling clients public key.  Thus no-one but
27    the caller can view the contents of replies.
28  * Servers can all have their own SSL keys, or share one, or reuse keys created
29    by other PKI using software like Puppet
30  * Requests from servers - like registration data - can be secured even to external
31    eavesdropping depending on the level of configuration you are prepared to do
32  * Given a network where you can ensure third parties are not able to access the
33    middleware public key distribution can happen automatically
34
35 During the design of this system we considered the replies back to clients to be most
36 important piece of information on the network.  This is secured in a way that only
37 the client can decrypt the replies he gets.  An attacker will need to gain access
38 to every private key of every client to see all the reply data.
39
40 Serialization uses Marshal or YAML, which means data types in and out of mcollective
41 will be preserved from client to server and reverse.
42
43 ## Compared to the SSL plugin
44
45 The earlier [SSLSecurity] only provided message signing and identification of clients, this
46 new plugin builds on this adding payload encryption, identification of servers and optional
47 automatic key distribution.
48
49 The [SSLSecurity] plugin puts less drain on resources, if you do not specifically need encryption
50 you should consider using that one instead.
51
52 ## Deployment Scenarios
53
54 There are various modes of deployment, the more secure you wish to be the more work you have
55 to do in terms of key exchange and initial setup.
56
57 This plugin is designed to allow you to strike a balance between security and setup cost
58 the sections below discuss the possible deployment scenarios to help you choose an approach.
59
60 In all of the below setups the following components are needed:
61
62  * Each user making requests - the client - needs a public and private key pair
63  * Each server receiving requests need the public key of each client
64
65 In cases where you wish to use [Registration] or initiate requests from the server for any
66 reason the following are needed:
67
68  * Each server needs a public and private key pair
69  * Each other server that wish to receive these requests need the public key of the sending server
70
71 In this scenario each server will act as a client making RPC requests to the collective network
72 for any agent called _registration_.  So in this scenario the server acts as a client and therefore
73 need a key-pair to identify it.
74
75 ### Manual key distribution with each server and client having unique keys
76
77 In this setup each client and each server needs a unique set of keys.  You need to
78 distribute these keys manually and securely - perhaps using Puppet.
79
80 The setup cost is great, to enable registration the nodes receiving registration data
81 need to have the public key of every other node stored locally before registration
82 data can be received.
83
84 If you do not use Puppet or some other PKI system that provide access to keys you need
85 create keypairs for each node and client.
86
87 This is the most secure setup protecting all replies and registration data.  Rogue people
88 on the network who do not compromise a running host cannot make requests on the network.
89
90 Attackers who compromise a server can only make registration requests assuming you deployed
91 a strictly configured [Authorization][SimpleRPCAuthorization] system they cannot use those
92 machines as starting points to inject requests for the rest of your network.
93
94 By gaining access to your Middleware an attacker will not be able to observe the contents of
95 requests, replies or registration messages.  Attackers need to compromise servers and gain
96 access to private keys before they can start observing parts of the exchange.
97
98 |Feature / Capability|Supported|
99 |--------------------|---------|
100 |Clients are uniquely identified using cryptographic means|yes|
101 |Anyone with the client public key can observe request contents|yes|
102 |Attackers can gain access to the client public key by just listening on the network|no|
103 |Replies back to the client are readable only by client that initiated the request|yes|
104 |Attackers can create new certificates and start using them to make requests as clients|no|
105 |Servers are uniquely identified using cryptographic means|yes|
106 |Anyone with the server public key can observe registration contents|yes|
107 |Attackers can gain access to the server public keys by just listening on the network|no|
108 |Registration data can be protected from rogue agents posing as registration agents|yes|
109 |Attackers can create new nodes and inject registration data for those new nodes|no|
110
111 To configure this scenario use the following options and manually copy public keys to the
112 _plugin.aes.client`_`cert`_`dir_ directory:
113
114 |Settings|Value|Descritpion|
115 |--------|-----|-----------|
116 |plugin.aes.send_pubkey|0|Do not send public keys|
117 |plugin.aes.learn_pubkeys|0|Do not learn public keys|
118
119 ### Automatic public key distribution with each server and client having unique keys
120
121 Here we enable the  _plugin.aes.learn`_`pubkeys_ feature on all servers.  Your public keys
122 will now be distributed automatically on demand but you loose some security in that anyone
123 with access to your network or middleware can observe the contents of replies and registration
124 data
125
126 You still need to create keys for every node - or use Puppets.  You still need to create keys
127 for every user.
128
129 In order to protect against attackers creating new certificates and making requests on your network
130 deploy a [Authorization][SimpleRPCAuthorization] plugin that denies unknown clients.
131
132 |Feature / Capability|Supported|
133 |--------------------|---------|
134 |Clients are uniquely identified using cryptographic means|yes|
135 |Anyone with the client public key can observe request contents|yes|
136 |Attackers can gain access to the client public key by just listening on the network|*yes*|
137 |Replies back to the client are readable only by client that initiated the request|yes|
138 |Attackers can create new certificates and start using them to make requests as clients|*yes*|
139 |Servers are uniquely identified using cryptographic means|yes|
140 |Anyone with the server public key can observe registration contents|yes|
141 |Attackers can gain access to the server public keys by just listening on the network|*yes*|
142 |Registration data can be protected from rogue agents posing as registration agents|yes|
143 |Attackers can create new nodes and inject registration data for those new nodes|*yes*|
144
145 To configure this scenario use the following options and ensure the _mcollectived_ can write
146 to the _plugin.aes.client`_`cert`_`dir_ directory:
147
148 |Settings|Value|Descritpion|
149 |--------|-----|-----------|
150 |plugin.aes.send_pubkey|1|Send public keys|
151 |plugin.aes.learn_pubkeys|1|Learn public keys|
152
153 ### Manual public key distribution with servers sharing a key pair and clients having unique keys
154
155 This is comparable to the older SSL plugin where all servers shared the same public / private
156 pair.  Here anyone who is part of the network can decrypt the traffic related to registration
157 but replies to clients are still securely encrypted and visable only to them.
158
159 You will not need to create unique keys for every server, you can simply copy the same one out
160 everywhere.  You still need to create keys for every user.
161
162 If you do not use registration, this is a very secure setup that requires a small configuration
163 overhead.
164
165 |Feature / Capability|Supported|
166 |--------------------|---------|
167 |Clients are uniquely identified using cryptographic means|yes|
168 |Anyone with the client public key can observe request contents|yes|
169 |Attackers can gain access to the client public key by just listening on the network|no|
170 |Replies back to the client are readable only by client that initiated the request|yes|
171 |Attackers can create new certificates and start using them to make requests as clients|no|
172 |Servers are uniquely identified using cryptographic means|*no*|
173 |Anyone with the server public key can observe registration contents|yes|
174 |Attackers can gain access to the server public keys by just listening on the network|no|
175 |Registration data can be protected from rogue agents posing as registration agents|*no*|
176
177 To configure this scenario use the following options and ensure the _mcollectived_ can write
178 to the _plugin.aes.client`_`cert`_`dir_ directory:
179
180 |Settings|Value|Descritpion|
181 |--------|-----|-----------|
182 |plugin.aes.send_pubkey|0|Do not send public keys|
183 |plugin.aes.learn_pubkeys|0|Do not learn public keys|
184
185 ### Automatic public key distribution with servers sharing a key and client having unique keys
186
187 This is comparable to the older SSL plugin where all servers shared the same public / private
188 pair.  Here anyone who is part of the network can decrypt the traffic related to registration
189 but replies to clients are still securely encrypted and visable only to them.
190
191 Here we enable the  _plugin.aes.learn`_`pubkeys_ feature on all servers.  Your public keys
192 will now be distributed automatically on demand but you loose some security in that anyone
193 with access to your network or middleware can observe the contents of replies and registration
194 data
195
196 You will not need to create unique keys for every server, you can simply copy the same one out
197 everywhere.  You still need to create keys for every user.
198
199 In order to protect against attackers creating new certificates and making requests on your network
200 deploy a [Authorization][SimpleRPCAuthorization] plugin that denies unknown clients.
201
202 |Feature / Capability|Supported|
203 |--------------------|---------|
204 |Clients are uniquely identified using cryptographic means|yes|
205 |Anyone with the client public key can observe request contents|yes|
206 |Attackers can gain access to the client public key by just listening on the network|*yes*|
207 |Replies back to the client are readable only by client that initiated the request|yes|
208 |Attackers can create new certificates and start using them to make requests as clients|*yes*|
209 |Servers are uniquely identified using cryptographic means|*no*|
210 |Anyone with the server public key can observe registration contents|yes|
211 |Attackers can gain access to the server public keys by just listening on the network|*yes*|
212 |Registration data can be protected from rogue agents posing as registration agents|*no*|
213
214 To configure this scenario use the following options and ensure the _mcollectived_ can write
215 to the _plugin.aes.client`_`cert`_`dir_ directory:
216
217 |Settings|Value|Descritpion|
218 |--------|-----|-----------|
219 |plugin.aes.send_pubkey|1|Send public keys|
220 |plugin.aes.learn_pubkeys|1|Learn public keys|
221
222 ## Creating keys
223
224 Keys are created using OpenSSL.  The filenames of public keys are significant you should name
225 them so that they are unique for your network and they should match on the client and servers.
226
227 {% highlight console %}
228  % openssl genrsa -out server-private.pem 1024
229  % openssl rsa -in server-private.pem -out server-public.pem -outform PEM -pubout
230 {% endhighlight %}
231
232 Client and Server keys are made using the same basic method.
233
234 ## Reusing Puppet keys
235
236 Puppet managed nodes will all have keys created by Puppet already, you can reuse these if your
237 _mcollectived_ runs as root.
238
239 Generally Puppet stores these in _/var/lib/puppet/ssl/private`_`keys/fqdn.pem_ and _/var/lib/puppet/ssl/public`_`keys/fqdn.pem_
240 simply configure these paths for your _server`_`private_ and _server`_`public_ options.
241
242 Clients will still need their own keys made and distributed.
243
244 ## Future Roadmap
245
246  * Depending on performance of the initial system we might validate request certificates are
247    signed by a known CA this will provide an additional level of security preventing attackers
248    from creating their own keys and using those on the network without also compromising the CA.
249  * Private keys will be secured with a password
250
251
252 ## Configuration Options
253
254 ### Common Options
255
256 |Setting|Example / Default|Description
257 |-------|-----------------|-----------|
258 |securityprovider|aes_security|Enables this security provider|
259 |plugin.aes.serializer|yaml or marshal|Serialization to use|
260 |plugin.aes.send_pubkey|0 or 1|Send the public key with every request|
261 |plugin.aes.learn_pubkeys|0 or 1|Receive public keys from the network and cache them locally|
262
263 ### Client Options
264
265 |Setting|Example / Default|Description
266 |-------|-----------------|-----------|
267 |plugin.aes.client_private|/home/user/.mcollective.d/user-private.pem|The private key path for the user.  File must be /\w\.\-/|
268 |plugin.aes.client_public|/home/user/.mcollective.d/user.pem|The public key path for the user.  File must be /\w\.\-/|
269
270 ### Server Options
271
272 |Setting|Example / Default|Description
273 |-------|-----------------|-----------|
274 |plugin.aes.client_cert_dir|/etc/mcollective/ssl/clients|Where to store and load client public keys|
275 |plugin.aes.server_private|/etc/mcollective/ssl/server-private.pem|Server private key.  File must be /\w\.\-/|
276 |plugin.aes.server_public|/etc/mcollective/ssl/server-public.pem|Server public key.  File must be /\w\.\-/|
277 |plugin.aes.enforce_ttl|1|Enforce TTL and Message time security, warn only when disabled.  1.3.2 and newer only|
278