International law consists of treaties that have been bilaterally agreed to by several countries, in most cases including the US. Being treaties, they are US laws that are much more difficult for the US to amend than ordinary laws. US law/international law is a false distinction, when we speak of international law in the context of the US, we are generally referring specifically to treaties that the US is party to.
> it is selectively applied for national security.
This is true. The US gets creative when it wants to avoid adhering to the law. But international law is established through treaties, and the terms the US agrees to in treaties is US law.
This is true in this case, but in general complicated in the US. Since the executive branch is responsible for diplomacy, but only Congress can pass laws, there's a weird wiggle room where the Executive branch is completely on board with signing some treaty, but then when it comes time to actually implement it in any way that actually binds, Congress can refuse to do so.
It's one of the reasons why for a lot of the "everybody joins" treaties, a bunch of countries sign with a statement that they don't recognize the US as a signatory.
It is a can of worms indeed. Sadly, the President may be able to break the law without any repercussions. However, the same isn't true for the people under him.