And that has been what the legal weapons blockade is there for. Some people say that the blockade is illegal, but if you read the international law of blockade, it is perfectly legal against a belligerent. Hamas definitely fits that description.
Belligerent means hostile, aggressive, or combative. It can describe a person, group, or country that is engaged in combat or waging war.