Part of NAVFITOnline project navfit99-js and navfit99-server
- Install Go.
- Get code with
git clone https://github.com/ansonl/client-cert-auth.git
orgo get github.com/ansonl/client-cert-auth
. - Create system user with no login to run the program.
useradd -r -s /bin/false liusystem
- If needing Redis auth token capability, create shell script
./setEnvVar.sh
containingexport REDIS_URL=XXX
. XXX is the Redis connection URL. - Run
./grantCapabilityAndRun.sh
. The script does the following:
- Compile and install client-cert-auth according to your Go setup.
- Run
./setEnvVar.sh
to set $REDIS_URL. - Run
setcap
to set port binding capability on program executable. - Run client-cert-auth as the created system user.
acme/autocert
integrated to use Let's Encrypt certificates for machine.- Displays the verified certificate chain when presented with client certificate.
- OCSP checking (commented out)
- Redirect to URLs based on
- No client certificate presented
- Invalid client certificate presented (failed verification)
- Verified client certificate presented
- Generates random UUID on user request and stores in a REDIS database using the client certificate Subject.CommonName as user unique identifier.
- You can find the most up to date DoD root and intermediate certificates at DISA IASE tools as PKI CA Certificate Bundles: PKCS#7.
https://github.com/jcbsmpsn/golang-https-example https://github.com/alexmullins/ocspchecker