The US & allied invasion of Afghanistan after 9/11 is a pretty non-controversial case of legitimate self defence amongst international law scholars. There are some contrarians who dispute it, but it's not a mainstream view.
That's quite different from the 2003 invasion of Iraq which was on much shakier grounds.