There are two kinds of settlements in Judea and Samaria: the ones that are legal under Israeli law, and the ones that are not.
The illegal settlements, often called "outposts" because they are often tiny, are, under international law - legal!
Let me explain.
The entire reason any settlements are considered "illegal" under international law is because of a tortured reading of the Fourth Geneva Conventions, Article 49, paragraph 6:
The Occupying Power shall not deport or transfer parts of its own civilian population into the territory it occupies.
The argument that Jewish settlements are illegal comes from bizarre idea that people who choose voluntarily to live there are somehow being "transferred" by Israel. The arguments for that are very strained, to say the least. They are usually centered on how Israel supports the settlements it considers legal by building infrastructure or otherwise making life there any easier for its citizens, as if that fits the definition of "transfer."
But the people who choose to break Israeli law and build their own illegal settlements cannot by any stretch of interpreting Geneva be considered to be "transferred" - their decision to move is purely voluntary and not encouraged at all by the Israeli government.
Which means that these outposts that are illegal under Israeli law are legal under international law - no matter how you try to misinterpret Geneva Art. 49!
(This is all moot, despite all the NGOs that say that settlements violate Geneva. For an in-depth look at Article 49 and why it clearly doesn't apply to Jewish settlements, see here for the travaux préparatoires.)