Skip to content

Commit 62d1f5e

Browse files
committed
go to language-tagged code snippets, asf header everywhere
1 parent 6e65f24 commit 62d1f5e

17 files changed

+146
-103
lines changed

sections/acknowledgements.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<!---
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License. See accompanying LICENSE file.
13+
-->
114
# Acknowledgements
215

316
* Everyone who has struggled to secure Hadoop deserves to be recognised, their sacrifice acknowledged.

sections/biblography.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<!---
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License. See accompanying LICENSE file.
13+
-->
114
# Bibliography
215

316
1. IETF [RFC 4120](https://www.ietf.org/rfc/rfc4120.txt)

sections/checklists.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
[ ] reverse DNS lookup of IPAddr returns hostname
111111
[ ] clock is in sync with rest of cluster: `date`
112112

113+
[ ] JVM has Java Crypto Extensions
113114
[ ] keytab exists
114115
[ ] keytab is readable by account running service.
115116
[ ] keytab contains principals in listing `ktlist -kt $keytab`

sections/glossary.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
<!---
2+
Licensed under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License.
4+
You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License. See accompanying LICENSE file.
13+
-->
114
# Glossary
215

316

sections/hadoop_and_kerberos.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,3 @@ SSL-certificate like system? Or OAuth?
3939
Kerberos was written to support centrally managed accounts in a local area network, one in
4040
which adminstrators manage individual accounts. This is actually much simpler to manage than
4141
PKI-certificate based systems: look at the effort it takes to revoke a certificate in a browser.
42-
43-
OAuth?

sections/hadoop_tokens.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,6 @@ work to Oozie to have a keytab and to pass it to Oozie.
330330
## Weaknesses
331331

332332
1. Any compromised DN can create block tokens.
333+
1. Possession of the tokens is sufficent to impersonate a user. This means it is critical
334+
to transport tokens over the network in an encrypted form. Typically, this is done
335+
by SASL-encrypting the Hadoop IPC channel.

sections/ipc.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ In its favour: it's a lot easier than SPNEGO.
4141

4242
### Annotating a service interface
4343

44-
```
44+
```java
4545
@KerberosInfo(serverPrincipal = "my.kerberos.principal")
4646
public interface MyRpc extends VersionedProtocol {
4747
long versionID = 0x01;
@@ -59,7 +59,7 @@ Every exported RPC service will need its own extension of the `SecurityInfo` cla
5959
### `PolicyProvider` subclass
6060

6161

62-
```
62+
```java
6363
public class MyRpcPolicyProvider extends PolicyProvider {
6464

6565
public Service[] getServices() {
@@ -69,12 +69,11 @@ public class MyRpcPolicyProvider extends PolicyProvider {
6969
}
7070

7171
}
72-
7372
```
7473

7574
This is used to inform the RPC infrastructure of the ACL policy: who may talk to the service. It must be explicitly passed to the RPC server
7675

77-
```
76+
```java
7877
rpcService.getServer() .refreshServiceAcl(serviceConf, new MyRpcPolicyProvider());
7978
```
8079

@@ -104,7 +103,7 @@ the server can determine the identity of the principal.
104103

105104
This is something it can ask for when handling the RPC Call:
106105

107-
```
106+
```java
108107
UserGroupInformation callerUGI;
109108

110109
// #1: get the current user identity
@@ -116,13 +115,13 @@ try {
116115
throw RPCUtil.getRemoteException(ie);
117116
}
118117
```
119-
118+
120119
The `callerUGI` variable is now set to the identity of the caller. If the caller
121120
has delegated authority (tickets, tokens) then they still authenticate as
122121
that principal they were acting as (possibly via a `doAs()` call).
123-
124122

125-
```
123+
124+
```java
126125
// #2 verify their permissions
127126
String user = callerUGI.getShortUserName();
128127
if (!checkAccess(callerUGI, MODIFY)) {
@@ -162,12 +161,12 @@ hadoop distcp -D ipc.client.fallback-to-simple-auth-allowed=true hdfs://secure:8
162161

163162
Although you can set it in a core-site.xml, this is dangerous from a security perpective
164163

165-
```
164+
```xml
166165
<property>
167166
<name>ipc.client.fallback-to-simple-auth-allowed</name>
168167
<value>true</value>
169168
</property>
170169
```
171170

172171
*warning* it's tempting to turn this on during development, as it makes problems go away. As it is
173-
not recommended in production: avoid except on the CLI during attempts to debug problems.
172+
not recommended in production: avoid except on the CLI during attempts to debug problems.

sections/jaas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ within the same file.
3939

4040
Hadoop's UGI class will dynamically create a JAAS context for Hadoop logins, dynamically determining the name of the kerberos module to use. For interacting purely with HDFS and YARN, you may be able to avoid needing to know about or understand JAAS.
4141

42-
Example of a JAAS file valid for Sun
42+
Example of a JAAS file valid for an Oracle JVM:
43+
4344

44-
If you need a basic JAAS cient configuration which
4545
```
4646
Client {
4747
com.sun.security.auth.module.Krb5LoginModule required

sections/kerberos_the_madness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Authors:
66

7-
S.A.Loughran
7+
S.A. Loughran
88

99

1010
----

sections/keytabs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ without prompts for passwords
2222

2323
If your management tools sets up keytabs for you: use it.
2424

25-
```
25+
```bash
26+
2627
kadmin.local
2728

2829
ktadd -k zk.service.keytab -norandkey zookeeper/devix@COTHAM
@@ -32,14 +33,14 @@ exit
3233

3334
and of course, make it accessible
3435

35-
```
36+
```bash
3637
chgrp hadoop zk.service.keytab
3738
chown zookeeper zk.service.keytab
3839
```
3940

4041
check that the user can login
4142

42-
```
43+
```bash
4344
# sudo -u zookeeper klist -e -kt zk.service.keytab
4445
# sudo -u zookeeper kinit -kt zk.service.keytab zookeeper/devix.cotham.uk
4546
# sudo -u zookeeper klist

0 commit comments

Comments
 (0)