Reinforcement Learning-Assisted Virtualized Security Framework for CAVs