See the Hadoop documentation for setting up a secure Hadoop cluster http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SecureMode.html
Once you have a Hadoop cluster that is using Kerberos for authentication, you have to do the following to configure Knox to work with that cluster.
useradd -g hadoop knox
One way of doing this, assuming your KDC realm is EXAMPLE.COM, is to ssh into your host running KDC and execute kadmin.local
That will result in an interactive session in which you can execute commands.
ssh into your host running KDC
kadmin.local add_principal -randkey knox/knox@EXAMPLE.COM ktadd -k knox.service.keytab -norandkey knox/knox@EXAMPLE.COM exit
Add unix account for the knox user on Knox host
useradd -g hadoop knox
Copy knox.service.keytab created on KDC host on to your Knox host {GATEWAY_HOME}/conf/knox.service.keytab
chown knox knox.service.keytab chmod 400 knox.service.keytab
krb5.conf
at {GATEWAY_HOME}/conf/krb5.conf
on Knox hostYou could copy the {GATEWAY_HOME}/templates/krb5.conf
file provided in the Knox binary download and customize it to suit your cluster.
krb5JAASLogin.conf
at /etc/knox/conf/krb5JAASLogin.conf
on Knox hostYou could copy the {GATEWAY_HOME}/templates/krb5JAASLogin.conf
file provided in the Knox binary download and customize it to suit your cluster.
gateway-site.xml
on Knox hostUpdate conf/gateway-site.xml
in your Knox installation and set the value of gateway.hadoop.kerberos.secured
to true.
After you do the above configurations and restart Knox, Knox would use SPNEGO to authenticate with Hadoop services and Oozie. There is no change in the way you make calls to Knox whether you use curl or Knox DSL.