There is another question on a micro level. How many people who are not about to kill you can you kill in self-defence to save how many people?
While in theory, every human life is as important and valued as another we do often in practice allow some movement morally.
The third question is immediacy. Are you allowed to kill someone in self-defence if you know they will kill you tomorrow? Is it just current action, and how far current stretches.
But while those are simplified questions on the philosophy of ethics in these situations they don't entirely apply to Israel and Palestine. That is because they ignore the power imbalance.
Why are your citizens somehow more valuable than any other citizens? I am not even saying do nothing. I am saying killing people indiscriminately is not OK.
Second, if these are unprovoked attacks I have no idea what in your world constitutes provoked. I don't think attacks being provoked makes them right but they didn't come out of nothing. Israel is not an innocent party here. Neither is Palestine.