It most certainly does. Russia recognized the two breakaway Oblasts as countries, and Article 51 allows nations, "the inherent right of individual or collective self-defence if an armed attack occurs against a Member of the United Nations, until the Security Council has taken measures necessary to maintain international peace and security."
The sticky part for Russia is that Luhansk and Donetsk were not yet (and still not) recognized by the UN.
The sticky part for the collective west is that the exact same Article 51 was used by NATO to recognize Kosovo in 1999 and then bomb the shit out of Serbia. This is worse for the West because NATO is not a member of the UN and Russia is.
The argument for Kosovo was that if no action was taken to defend them, then Serbia would have destroyed Kosovo before the UN could respond. No surprise, this is the exact same argument Russia used regarding the Donbas.
Again, I'm not a lawyer so I don't know how much leeway is given in such circumstances. Without more knowledge, I'd say they were both illegal.
That being said, there were no legal procedings taken against the NATO members who bombed Serbia (particularly the US that lead the bombing). Therefore the same legal response should be used to judge Russia, namely that what Russia did was OK legally.
My layman's take.