There are resolutions against Iran missile program. Are these resolutions legal? Or is an article specifically preventing Iran? Doesn't any country have the right to develop their own defense system?
International politics are not governed by laws, so no action by a state can be definitely legal or illegal. It's in the subjective opinion of each government which actions by other governments they condone or support. International politics is basically anarchy. No country is bound to any rules they didn't agree to. You can claim that when a country breaks an agreement they signed they are breaking common law tradition, but I am not aware of any international agreements which guarantee Iran the right to own weapons of mass destruction.
When you look at the list of UN resolution concerning Iran, then these resolutions are "legal" simply because they went through the normal UN processes and weren't vetoed by any of the veto-powers. Still, they are only effective as long as all the UN members enforce them.