Embedding Security Monitors in Software Components