security integration tests

Untested, not ready for merge.