Refactored module to apply rules either based on source ip or local user
uid so it can be extended to protect ssh jump hosts. I refactored some
of the code to clean it up and improve readability