use of org.apache.kerby.kerberos.kerb.server.SimpleKdcServer in project testcases by coheigea.
the class HDFSKerberosTest method configureKerby.
private static void configureKerby(String baseDir) throws Exception {
// System.setProperty("sun.security.krb5.debug", "true");
System.setProperty("java.security.krb5.conf", baseDir + "/target/krb5.conf");
kerbyServer = new SimpleKdcServer();
kerbyServer.setKdcRealm("hadoop.apache.org");
kerbyServer.setAllowUdp(false);
kerbyServer.setWorkDir(new File(baseDir + "/target"));
kerbyServer.init();
// Create principals
String alice = "alice@hadoop.apache.org";
String bob = "bob@hadoop.apache.org";
String hdfs = "hdfs/localhost@hadoop.apache.org";
String http = "HTTP/localhost@hadoop.apache.org";
kerbyServer.createPrincipal(alice, "alice");
File keytabFile = new File(baseDir + "/target/alice.keytab");
kerbyServer.exportPrincipal(alice, keytabFile);
kerbyServer.createPrincipal(bob, "bob");
keytabFile = new File(baseDir + "/target/bob.keytab");
kerbyServer.exportPrincipal(bob, keytabFile);
kerbyServer.createPrincipal(hdfs, "hdfs");
kerbyServer.createPrincipal(http, "http");
keytabFile = new File(baseDir + "/target/hdfs.keytab");
kerbyServer.exportPrincipal(hdfs, keytabFile);
kerbyServer.exportPrincipal(http, keytabFile);
kerbyServer.start();
}
use of org.apache.kerby.kerberos.kerb.server.SimpleKdcServer in project testcases by coheigea.
the class KafkaRangerGSSAuthorizerTest method configureKerby.
private static void configureKerby(String baseDir) throws Exception {
// System.setProperty("sun.security.krb5.debug", "true");
System.setProperty("java.security.krb5.conf", baseDir + "/target/krb5.conf");
kerbyServer = new SimpleKdcServer();
kerbyServer.setKdcRealm("kafka.apache.org");
kerbyServer.setAllowUdp(false);
kerbyServer.setWorkDir(new File(baseDir + "/target"));
kerbyServer.init();
// Create principals
String zookeeper = "zookeeper/127.0.0.1@kafka.apache.org";
String kafka = "kafka/localhost@kafka.apache.org";
String client = "client@kafka.apache.org";
kerbyServer.createPrincipal(zookeeper, "zookeeper");
File keytabFile = new File(baseDir + "/target/zookeeper.keytab");
kerbyServer.exportPrincipal(zookeeper, keytabFile);
kerbyServer.createPrincipal(kafka, "kafka");
keytabFile = new File(baseDir + "/target/kafka.keytab");
kerbyServer.exportPrincipal(kafka, keytabFile);
kerbyServer.createPrincipal(client, "client");
keytabFile = new File(baseDir + "/target/client.keytab");
kerbyServer.exportPrincipal(client, keytabFile);
kerbyServer.start();
}
use of org.apache.kerby.kerberos.kerb.server.SimpleKdcServer in project testcases by coheigea.
the class HadoopKerbyTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
System.setProperty("sun.security.krb5.debug", "true");
// System.setProperty("java.security.auth.login.config", basedir + "/target/test-classes/kerberos/kerberos.jaas");
kerbyServer = new SimpleKdcServer();
kerbyServer.setKdcRealm("hadoop.apache.org");
kerbyServer.setAllowUdp(false);
kerbyServer.setWorkDir(new File(basedir + "/target"));
// kerbyServer.setInnerKdcImpl(new NettyKdcServerImpl(kerbyServer.getKdcSetting()));
kerbyServer.init();
// Create principals
String alice = "alice@hadoop.apache.org";
String bob = "bob@hadoop.apache.org";
String ranger = "ranger/localhost@hadoop.apache.org";
String hdfs = "hdfs/localhost@hadoop.apache.org";
String http = "HTTP/localhost@hadoop.apache.org";
kerbyServer.createPrincipal(alice, "alice");
File keytabFile = new File(basedir + "/target/alice.keytab");
kerbyServer.exportPrincipal(alice, keytabFile);
kerbyServer.createPrincipal(bob, "bob");
keytabFile = new File(basedir + "/target/bob.keytab");
kerbyServer.exportPrincipal(bob, keytabFile);
kerbyServer.createPrincipal(hdfs, "hdfs");
kerbyServer.createPrincipal(http, "http");
keytabFile = new File(basedir + "/target/hdfs.keytab");
kerbyServer.exportPrincipal(hdfs, keytabFile);
kerbyServer.exportPrincipal(http, keytabFile);
kerbyServer.createPrincipal(ranger, "ranger");
keytabFile = new File(basedir + "/target/ranger.keytab");
kerbyServer.exportPrincipal(ranger, keytabFile);
kerbyServer.exportPrincipal(http, keytabFile);
kerbyServer.start();
}
use of org.apache.kerby.kerberos.kerb.server.SimpleKdcServer in project testcases by coheigea.
the class HiveKerbyTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
System.setProperty("sun.security.krb5.debug", "true");
// System.setProperty("java.security.auth.login.config", basedir + "/target/test-classes/kerberos/kerberos.jaas");
kerbyServer = new SimpleKdcServer();
kerbyServer.setKdcRealm("hadoop.apache.org");
kerbyServer.setAllowUdp(false);
kerbyServer.setWorkDir(new File(basedir + "/target"));
// kerbyServer.setInnerKdcImpl(new NettyKdcServerImpl(kerbyServer.getKdcSetting()));
kerbyServer.init();
// Create principals
String hive = "hiveserver2/localhost@hadoop.apache.org";
String hdfs = "hdfs/localhost@hadoop.apache.org";
String http = "HTTP/localhost@hadoop.apache.org";
String mapred = "mapred/localhost@hadoop.apache.org";
String alice = "alice@hadoop.apache.org";
kerbyServer.createPrincipal(hive, "hiveserver2");
File keytabFile = new File(basedir + "/target/hiveserver2.keytab");
kerbyServer.exportPrincipal(hive, keytabFile);
kerbyServer.createPrincipal(hdfs, "hdfs");
kerbyServer.createPrincipal(http, "http");
keytabFile = new File(basedir + "/target/hdfs.keytab");
kerbyServer.exportPrincipal(hdfs, keytabFile);
kerbyServer.exportPrincipal(http, keytabFile);
kerbyServer.createPrincipal(mapred, "mapred");
keytabFile = new File(basedir + "/target/mapred.keytab");
kerbyServer.exportPrincipal(mapred, keytabFile);
kerbyServer.createPrincipal(alice, "alice");
keytabFile = new File(basedir + "/target/alice.keytab");
kerbyServer.exportPrincipal(alice, keytabFile);
kerbyServer.start();
}
use of org.apache.kerby.kerberos.kerb.server.SimpleKdcServer in project testcases by coheigea.
the class KafkaKerbyTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
System.setProperty("sun.security.krb5.debug", "true");
// System.setProperty("java.security.auth.login.config", basedir + "/target/test-classes/kerberos/kerberos.jaas");
kerbyServer = new SimpleKdcServer();
kerbyServer.setKdcRealm("kafka.apache.org");
kerbyServer.setAllowUdp(false);
kerbyServer.setWorkDir(new File(basedir + "/target"));
// kerbyServer.setInnerKdcImpl(new NettyKdcServerImpl(kerbyServer.getKdcSetting()));
kerbyServer.init();
// Create principals
String zookeeper = "zookeeper/localhost@kafka.apache.org";
String kafka = "kafka/localhost@kafka.apache.org";
String client = "client@kafka.apache.org";
kerbyServer.createPrincipal(zookeeper, "zookeeper");
File keytabFile = new File(basedir + "/target/zookeeper.keytab");
kerbyServer.exportPrincipal(zookeeper, keytabFile);
kerbyServer.createPrincipal(kafka, "kafka");
keytabFile = new File(basedir + "/target/kafka.keytab");
kerbyServer.exportPrincipal(kafka, keytabFile);
kerbyServer.createPrincipal(client, "client");
keytabFile = new File(basedir + "/target/client.keytab");
kerbyServer.exportPrincipal(client, keytabFile);
kerbyServer.start();
}
Aggregations