Self-defense does not apply in the case of israel in relation to the Palestine Occupied Territories. ICJ (2004) (see image below)
"Under Int'l Law, Israel has the right to PROTECT itself, not to WAGE WAR (i.e., self-defense under art 51 UN Charter) against the people it has kept under belligerent occupation since'67. Gaza IS "occupied" given Israel's effective control, regardless of Hamas' existence."
(Francesca Albanese, UN Special Rapporteur on the Palestinian Territories)