Skip to content

Commit

Permalink
feat(tools): add validssclient for mutual tls auth
Browse files Browse the repository at this point in the history
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
  • Loading branch information
panchoh and nilp0inter committed Dec 21, 2020
1 parent 678a5a2 commit f25b7ee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tools/validsslclient
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

set -e

user=$(kapow get /ssl/client/i/dn)

#sed '/^#.*/d' | while read -r dn
while read -r dn
do
[ -z "$dn" ] && continue
if [ "$user" = "$dn" ]; then
kapow set /server/log/validsslclient "Found valid user: '$user'"
exit 0
fi
done

kapow set /response/status 403 # Forbidden
kapow set /server/log/validsslclient "Invalid user: '$user'"
exit 127

0 comments on commit f25b7ee

Please sign in to comment.