Update security check to be smarter
Merge pull request #1579 from edx/cg/add_security_fixes

Update security check to be smarter