Based on Article 51 of the UN Charter, UNGA 2625, and the arguments of Akande and Tzanakopoulos, the Palestinians have a legitimate right to self-defense against the Israeli occupation, especially since this occupation is considered illegal under international law.
As an occupying power, Israel does not have the right to use military force under the pretext of self-defense against the Palestinian population.