An Investigation of Cyber-Attacks and Security Mechanisms for Connected and Autonomous Vehicles