Who is the aggressor in the case of Ukraine is, again, subjective. The UN charter allows for preemtive military action to forestall an imminent attack. That is exactly the justification Russia used to invade Ukraine, Article 51 of the UN charter.
Russia claims, with evidence, that Ukraine was about to roll over the Donbas. 3x increase in shelling in a few days and 60k (IIRC) troops massing on the border to the Donbas. Russia says if they didn't go in, the people of the Donbas would have been wiped out.
It is a subjective call if that justification is "legal" according to international law.