Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Sun, 14 Jun 2020 03:01:00 +0000 ldapauthn - Webhook OpenLdap server for k8s written in go #authn #k8s #kubernetes #webhook <pre style="overflow-wrap: break-word; white-space: pre-wrap;"> <h2>LdapAuthn</h2> <h3>Description</h3> LdapAuthn is a simple go web server that integrates with your OpenLDAP instance to handle k8s webook `TokenReview` requests <h2>Specifications</h2>LdapAuthn can run as binary or in a docker container and exposes on the port `8082` the following endpoints (more details on <a href="https://github.com/almartino/ldapauthn">https://github.com/almartino/ldapauthn</a>): </pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;"> <ul><li>/ (webhook endpoint)</li> <li>/health (health endpoint)</li> </ul></pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;"> <h4>Details for Webhook endpoint</h4> When a `TokenReview` hits the webhook endpoint by default the following error responses can occurs (details of status codes on <a href="https://github.com/almartino/ldapauthn">https://github.com/almartino/ldapauthn</a>): <br></pre><pre><ul style=""><li style="white-space: pre-wrap;">400 | BadRequest </li><li style="white-space: pre-wrap;">401 | Unauthorized </li><li style="">403 | Forbidden</li><li style="">405 | MethodNotAllowed</li><li style="">406 | NotAcceptable</li><li style="">500 | InternalServerError</li> </ul><h5>Env</h5>LdapAuthn is docker ready. I choosed to configure the application via env variables.</pre><pre><i>See <a href="https://github.com/almartino/ldapauthn" style="font-size: 15.6px;">https://github.com/almartino/ldapauthn</a> for the complete list of env variables.</i></pre><pre> <h4>Init</h4> <h5><i>Direct</i></h5>```bash LDAP_URL='ldap://LDAP_HOST:389' \ LDAP_ADMIN_DN='cn=admin,dc=example,dc=org' \ LDAP_ADMIN_PASSWORD='PASSWORD' LDAP_BASE_DN='dc=example,dc=org' \ LDAP_USER_PREFIX='ou=people,ou=users' \ LDAP_UID_ATTR='uid' authn ```</pre><pre><br> <h5><i>Docker</i></h5> ```bash docker run -e LDAP_URL='ldap://LDAP_HOST:389' \ -e LDAP_ADMIN_DN='cn=admin,dc=example,dc=org' \ -e LDAP_ADMIN_PASSWORD='PASSWORD' LDAP_BASE_DN='dc=example,dc=org' \ -e LDAP_USER_PREFIX='ou=people,ou=users' \ -e LDAP_UID_ATTR='uid' almartino/ldapauthn:latest ```</pre><pre> <h5><i>Helm</i></h5><br></pre><pre>Coming soon ...</pre> 3 points posted by hankmartinez https://github.com/almartino/ldapauthn 4378 Sat, 13 Jun 2020 15:28:00 +0000