Germany is to investigate all military recruits amid fears ISIS terrorists are trying to join its armed forces.