Update release schedule
[docs.git] / docs / getting-started-guide / security_considerations.rst
1 .. _security_considerations:
2
3 ***********************
4 Security Considerations
5 ***********************
6
7 This document discusses the various security issues that might affect
8 OpenDaylight. The document also lists specific recommendations to
9 mitigate security risks.
10
11 This document also contains information about the corrective steps
12 you can take if you discover a security issue with
13 OpenDaylight, and if necessary, contact the Security Response Team,
14 which is tasked with identifying and resolving security threats.
15
16 Overview of OpenDaylight Security
17 =================================
18
19 There are many different kinds of security vulnerabilities that could affect
20 an OpenDaylight deployment, but this guide focuses on those where (a) the
21 servers, virtual machines or other devices running OpenDaylight have been
22 properly physically (or virtually in the case of VMs) secured against untrusted
23 individuals and (b) individuals who have access, either via remote logins or
24 physically, will not attempt to attack or subvert the deployment intentionally
25 or otherwise.
26
27 While those attack vectors are real, they are out of the scope of this
28 document.
29
30 What remains in scope is attacks launched from a server, virtual machine, or
31 device other than the one running OpenDaylight where the attack does not have
32 valid credentials to access the OpenDaylight deployment.
33
34 The rest of this document gives specific recommendations for deploying
35 OpenDaylight in a secure manner, but first we highlight some high-level
36 security advantages of OpenDaylight.
37
38 * Separating the control and management planes from the data plane (both
39   logically and, in many cases, physically) allows possible security threats to
40   be forced into a smaller attack surface.
41
42 * Having centralized information and network control gives network
43   administrators more visibility and control over the entire network, enabling
44   them to make better decisions faster. At the same time,
45   centralization of network control can be an advantage only if access to that
46   control is secure.
47
48   .. note:: While both previous advantages improve security, they also make
49             an OpenDaylight deployment an attractive target for attack making
50             understanding these security considerations even more important.
51
52 * The ability to more rapidly evolve southbound protocols and how they are used
53   provides more and faster mechanisms to enact appropriate security mitigations
54   and remediations.
55
56 * OpenDaylight is built from OSGi bundles and the Karaf Java container. Both
57   Karaf and OSGi provide some level of isolation with explicit code boundaries,
58   package imports, package exports, and other security-related features.
59
60 * OpenDaylight has a history of rapidly addressing known vulnerabilities and
61   a well-defined process for reporting and dealing with them.
62
63 OpenDaylight Security Resources
64 ===============================
65
66 * If you have any security issues, you can send a mail to
67   *security@lists.opendaylight.org*.
68
69 * For the list of current OpenDaylight security issues that are either being
70   fixed or resolved, refer to
71   https://wiki-archive.opendaylight.org/view/Security:Advisories.
72
73 * To learn more about the OpenDaylight security issues policies and procedure,
74   refer to https://wiki-archive.opendaylight.org/view/Security:Main
75
76 .. _security_deployment_recommendations:
77
78 Deployment Recommendations
79 ==========================
80
81 We recommend that you follow the deployment guidelines in setting up
82 OpenDaylight to minimize security threats.
83
84 * The default credentials should be changed before deploying OpenDaylight.
85
86 * OpenDaylight should be deployed in a private network that cannot be accessed
87   from the internet.
88
89 * Separate the data network (that connects devices using the network) from the
90   management network (that connects the network devices to OpenDaylight).
91
92   .. note:: Deploying OpenDaylight on a separate, private management network does not
93             eliminate threats, but only mitigates them. By construction, some
94             messages must flow from the data network to the management network, e.g.,
95             OpenFlow *packet_in* messages, and these create an attack surface even if
96             it is a small one.
97
98 * Implement an authentication policy for devices that connect to both the data
99   and management network. These are the devices which bridge, likely untrusted,
100   traffic from the data network to the management network.
101
102 Securing OSGi bundles
103 =====================
104
105 OSGi is a Java-specific framework that improves the way that Java classes
106 interact within a single JVM. It provides an enhanced version of the
107 *java.lang.SecurityManager* (ConditionalPermissionAdmin) in terms of security.
108
109 Java provides a security framework that allows a security policy to grant
110 permissions, such as reading a file or opening a network connection, to
111 specific code. The code maybe classes from the jarfile loaded from a specific
112 URL, or a class signed by a specific key. OSGi builds on the standard Java
113 security model to add the following features:
114
115 * A set of OSGi-specific permission types, such as one that grants the right
116   to register an OSGi service or get an OSGi service from the service registry.
117
118 * The ability to dynamically modify permissions at run-time. This includes the
119   ability to specify permissions by using code rather than a text configuration
120   file.
121
122 * A flexible predicate-based approach to determining which rules are
123   applicable to which *ProtectionDomain*. This approach is much more powerful
124   than the standard Java security policy which can only grant rights based on a
125   jarfile URL or class signature. A few standard predicates are provided,
126   including selecting rules based upon bundle symbolic-name.
127
128 * Support for bundle *local permissions* policies with optional further
129   constraints such as *DENY* operations. Most of this functionality is accessed
130   by using the *OSGi ConditionalPermissionAdmin* service which is part of the
131   OSGi core and can be obtained from the OSGi service registry. The
132   *ConditionalPermissionAdmin* API replaces the earlier *PermissionAdmin* API.
133
134 For more information, refer to https://www.osgi.org
135
136 .. _securing-karaf:
137
138 Securing the Karaf container
139 ============================
140
141 Apache Karaf is a OSGi-based run-time platform which provides a lightweight
142 container for OpenDaylight and applications. Apache Karaf uses
143 either Apache Felix Framework or Eclipse Equinox OSGi frameworks, and provide
144 additional features on top of the framework.
145
146 Apache Karaf provides a security framework based on Java Authentication and
147 Authorization Service (JAAS) in compliance with OSGi recommendations,
148 while providing RBAC (Role-Based Access Control) mechanism for the console and
149 Java Management Extensions (JMX).
150
151 The Apache Karaf security framework is used internally to control the access
152 to the following components:
153
154 * OSGi services
155
156 * console commands
157
158 * JMX layer
159
160 * WebConsole
161
162 The remote management capabilities are present in Apache Karaf by default,
163 however they can be disabled by using various configuration alterations. These
164 configuration options may be applied to the OpenDaylight Karaf distribution.
165
166 .. note:: Refer to the following list of publications for more information on
167           implementing security for the Karaf container.
168
169 * For role-based JMX administration, refer to
170   https://karaf.apache.org/manual/latest/#_monitoring_and_management_using_jmx
171
172 * For remote SSH access configuration, refer to
173   https://karaf.apache.org/manual/latest/#_remote
174
175 * For WebConsole access, refer to
176   https://karaf.apache.org/manual/latest/#_webconsole
177
178 * For Karaf security features, refer to
179   https://karaf.apache.org/manual/latest/#_security
180
181 Disabling the remote shutdown port
182 ----------------------------------
183
184 You can lock down your deployment post installation. Set
185 ``karaf.shutdown.port=-1`` in ``etc/custom.properties`` to
186 disable the remote shutdown port.
187
188 Securing Southbound Plugins
189 ===========================
190
191 Many individual southbound plugins provide mechanisms to secure their
192 communication with network devices. For example, the OpenFlow plugin supports
193 TLS connections with bi-directional authentication and the NETCONF plugin
194 supports connecting over SSH. Meanwhile, the Unified Secure Channel plugin
195 provides a way to form secure, remote connections for supported devices.
196
197 When deploying OpenDaylight, you should carefully investigate the secure
198 mechanisms to connect to devices using the relevant plugins.
199
200 Securing OpenDaylight using AAA
201 ===============================
202
203 AAA stands for Authentication, Authorization, and Accounting.
204 All three of these services can help improve the security posture of an
205 OpenDaylight deployment.
206
207 The vast majority of OpenDaylight's northbound APIs (and all RESTCONF APIs) are
208 protected by AAA by default when installing the ``+odl-restconf+`` feature.
209 In the cases that APIs are *not* protected by AAA, this will be noted in the
210 per-project release notes.
211
212 By default, OpenDaylight has only one user account with the username and
213 password *admin*. This should be changed before deploying OpenDaylight.
214
215 Securing RESTCONF using HTTPS
216 =============================
217
218 To secure Jetty RESTful services, including RESTCONF, you must configure the
219 Jetty server to utilize SSL by performing the following steps.
220
221 #. Issue the following command sequence to create a self-signed certificate in the ``etc`` folder for
222    use by the ODL deployment.
223
224    ::
225
226         keytool -keystore .keystore -alias jetty -genkey -keyalg RSA
227          Enter keystore password:  123456
228         What is your first and last name?
229           [Unknown]:  odl
230         What is the name of your organizational unit?
231           [Unknown]:  odl
232         What is the name of your organization?
233           [Unknown]:  odl
234         What is the name of your City or Locality?
235           [Unknown]:
236         What is the name of your State or Province?
237           [Unknown]:
238         What is the two-letter country code for this unit?
239           [Unknown]:
240         Is CN=odl, OU=odl, O=odl,
241         L=Unknown, ST=Unknown, C=Unknown correct?
242           [no]:  yes
243
244
245 #.  After the key has been obtained, make the following changes to
246     the ``etc/org.ops4j.pax.web.cfg`` file to set a few default properties.
247
248     ::
249
250         org.osgi.service.http.secure.enabled=true
251         org.osgi.service.http.port.secure=8443
252         org.ops4j.pax.web.ssl.keystore=./etc/.keystore
253         org.ops4j.pax.web.ssl.keystore.password=123456
254         org.ops4j.pax.web.ssl.keystore.type=PKCS12
255         org.ops4j.pax.web.ssl.key.password=123456
256         org.ops4j.pax.web.ssl.key.alias=jetty
257
258
259 You can test that the changes have succeeded by restarting Karaf,
260 issuing the following ``curl`` command, and ensuring that the 2XX HTTP status
261 code appears in the returned message.
262
263 ::
264
265         curl -u admin:admin -v -k https://localhost:8443/rests/operations
266
267 A more advanced example of Jetty security configuration can be found in this article:
268 https://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/6.3/html/security_guide/webconsole#idm139646384633952
269
270 Security Considerations for Clustering
271 ======================================
272
273 While OpenDaylight clustering provides many benefits including high
274 availability, scale-out performance, and data durability, it also opens a new
275 attack surface in the form of the messages exchanged between the various
276 instances of OpenDaylight in the cluster. In the current OpenDaylight release,
277 these messages are neither encrypted nor authenticated meaning that anyone with
278 access to the management network where OpenDaylight exchanges these clustering
279 messages can forge and/or read the messages. This means that if clustering is
280 enabled, it is even more important that the management network be kept secure
281 from any untrusted entities.