A Machine Learning Approach For Securing Autonomous And Connected Vehicles