A unified framework for risk and vulnerability analysis covering both safety and security