[Issue #1962] Refactoring security policy to use assertion macros to DRY up cleanup code