Section 197(2) in The Code of Criminal Procedure, 1973
(2)No Court shall take cognizance of any offence alleged to have been committed by any member of the Armed Forces of the Union while acting or purporting to act in the discharge of his official duty, except with the previous sanction of the Central Government.