Umm actually, collective punishment is a war crime. It's written in the Geneva convention. It states, "Collective punishment is a punishment or sanction imposed on a group for acts allegedly perpetrated by a member of that group," (https://casebook.icrc.org/a_to_z/glossary/collective-punishments paragraph 4.)