Implementation of Security Interceptor 

Ported from 2.2.2 to HEAD