FGT2 12.35
You will be able to google find many expert lawyers that can inform you of International Law as it pertains to "legally waging a war" and "seeking asylum"- as can we all..
Natasha Hausdorff is one commentator setting out her understanding of "international law", ie what circumstances are applicable to legitimately waging a war. For factual detail of what she said, including nuance and 'potential interpretations', not Youtube soundbites, see 6/3/26 "Is the War with Iran Legal? A top international lawyer explains' unwatchable.org.
Haussdorf dissects the legal realities of the ongoing conflict between Iran, Israel and the US and 'potential' interpretations of the law. There are many such commentators that have given competing understandings of the application of international war to the US/Israel Strike The nuance is in the detail. .You are welcome to your view that the Iran strike by US/Israel IS legal- there are many, many lawyers and others on the world stage who do not share your view.
At the end of the day the legalities of waging war are tested through international humanitarian law (IHL) primarily through the Geneva Conventions and Huge Conventions. The International Criminal Court (ICC) is one tribunal designed to prosecute individuals for war crime , genocide and crimes against humanity. In November 2024 the ICC issued arrest warrants against Netanyahu on charges of war crimes and crimes against humanity. Netanyahu chooses not to cooperate. Netanyahu is no moral crusader when it comes to war crimes and genocide.
Regarding your understanding "what is illegal is boats bringing migrants". The law is much more nuanced than you state. Yes it is the case that the previous Conservative Government introduced a UK law that 'Entering the UK without prior permission (leave) is a criminal offence under UK immigration law, which includes arriving by boat via unapproved routes". However this UK legal situation can not supersede or ignore "International Law".
That is most people who arrive by boats across the channel are seeking 'asylum" under International Law as set out in the 1951 Refugee Convention. Under this International Law, asylum seekers are protected from penalty for their 'irregular entry', provided they present themselves to the authorities and their primary purpose is to seek protection. By law their claims must be considered by the UK government and they are allowed to stay in the country whist their claim is being considered. Thus asylum seekers of course are not prosecuted as the government would fail in their prosecution bid if they have presented as asylum seekers. They are only prosecuted when there are 'aggravating factors' such as breaking UK law during the period of processing their claims.
The same International Law pertaining to asylum seekers in the UK applies to all EU countries.