Monitoring and detecting runtime security risks and threats