You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/security.md
+136-3Lines changed: 136 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,147 @@ Spark currently supports authentication via a shared secret. Authentication can
7
7
8
8
* For Spark on [YARN](running-on-yarn.html) deployments, configuring `spark.authenticate` to `true` will automatically handle generating and distributing the shared secret. Each application will use a unique shared secret.
9
9
* For other types of Spark deployments, the Spark parameter `spark.authenticate.secret` should be configured on each of the nodes. This secret will be used by all the Master/Workers and applications.
10
+
***IMPORTANT NOTE:***The experimental Netty shuffle path (`spark.shuffle.use.netty`) is not secured, so do not use Netty for shuffles if running with authentication.*
11
+
12
+
## Web UI
10
13
11
14
The Spark UI can also be secured by using [javax servlet filters](http://docs.oracle.com/javaee/6/api/javax/servlet/Filter.html) via the `spark.ui.filters` setting. A user may want to secure the UI if it has data that other users should not be allowed to see. The javax servlet filter specified by the user can authenticate the user and then once the user is logged in, Spark can compare that user versus the view ACLs to make sure they are authorized to view the UI. The configs `spark.ui.acls.enable` and `spark.ui.view.acls` control the behavior of the ACLs. Note that the user who started the application always has view access to the UI.
12
15
On YARN, the Spark UI uses the standard YARN web application proxy mechanism and will authenticate via any installed Hadoop filters.
13
16
17
+
## Event Logging
18
+
14
19
If your applications are using event logging, the directory where the event logs go (`spark.eventLog.dir`) should be manually created and have the proper permissions set on it. If you want those log files secured, the permissions should be set to `drwxrwxrwxt` for that directory. The owner of the directory should be the super user who is running the history server and the group permissions should be restricted to super user group. This will allow all users to write to the directory but will prevent unprivileged users from removing or renaming a file unless they own the file or directory. The event log files will be created by Spark with permissions such that only the user and group have read and write access.
15
20
16
-
**IMPORTANT NOTE:***The experimental Netty shuffle path (`spark.shuffle.use.netty`) is not secured, so do not use Netty for shuffles if running with authentication.*
21
+
## Configuring Ports for Network Security
22
+
23
+
Spark makes heavy use of the network, and some environments have strict requirements for using tight
24
+
firewall settings. Below are the primary ports that Spark uses for its communication and how to
<td>Connect to application<br>Notify executor state changes</td>
96
+
<td><code>spark.driver.port</code></td>
97
+
<td>Akka-based. Set to "0" to choose a port randomly.</td>
98
+
</tr>
99
+
<tr>
100
+
<td>Driver</td>
101
+
<td>Executor</td>
102
+
<td>(random)</td>
103
+
<td>Schedule tasks</td>
104
+
<td><code>spark.executor.port</code></td>
105
+
<td>Akka-based. Set to "0" to choose a port randomly.</td>
106
+
</tr>
107
+
<tr>
108
+
<td>Driver</td>
109
+
<td>Executor</td>
110
+
<td>(random)</td>
111
+
<td>Executor actor system port</td>
112
+
<td><code>spark.executor.env.port</code></td>
113
+
<td>Akka-based. Set to "0" to choose a port randomly.</td>
114
+
</tr>
115
+
<tr>
116
+
<td>Executor</td>
117
+
<td>Driver</td>
118
+
<td>(random)</td>
119
+
<td>File server for files and jars</td>
120
+
<td><code>spark.fileserver.port</code></td>
121
+
<td>Jetty-based</td>
122
+
</tr>
123
+
<tr>
124
+
<td>Executor</td>
125
+
<td>Driver</td>
126
+
<td>(random)</td>
127
+
<td>HTTP Broadcast</td>
128
+
<td><code>spark.broadcast.port</code></td>
129
+
<td>Jetty-based. Not used by TorrentBroadcast, which sends data through the block manager
130
+
instead.</td>
131
+
</tr>
132
+
<tr>
133
+
<td>Executor</td>
134
+
<td>Driver</td>
135
+
<td>(random)</td>
136
+
<td>Class file server</td>
137
+
<td><code>spark.replClassServer.port</code></td>
138
+
<td>Jetty-based. Only used in Spark shells.</td>
139
+
</tr>
140
+
<tr>
141
+
<td>Executor / Driver</td>
142
+
<td>Executor / Driver</td>
143
+
<td>(random)</td>
144
+
<td>Block Manager port</td>
145
+
<td><code>spark.blockManager.port</code></td>
146
+
<td>Raw socket via ServerSocketChannel</td>
147
+
</tr>
148
+
</table>
17
149
18
-
See the [configuration page](configuration.html) for more details on the security configuration parameters.
19
150
20
-
See <ahref="{{site.SPARK_GITHUB_URL}}/tree/master/core/src/main/scala/org/apache/spark/SecurityManager.scala"><code>org.apache.spark.SecurityManager</code></a> for implementation details about security.
151
+
See the [configuration page](configuration.html) for more details on the security configuration
152
+
parameters, and <ahref="{{site.SPARK_GITHUB_URL}}/tree/master/core/src/main/scala/org/apache/spark/SecurityManager.scala">
153
+
<code>org.apache.spark.SecurityManager</code></a> for implementation details about security.
0 commit comments