The legal definition of war assumes that you have uniformed soldiers who line up on opposite sides of a field, and proceed to duke it out. Non-uniformed people who simply go and kill random innocents, or who conspire to do so are effectively just murderers, not soldiers. But this isn’t because they aren’t an armed force, waging a war, it’s because their modus operandi doesn’t match what was written when people went about codifying the legalities of warfare. They’re avoiding the battlefield, they’re avoiding presenting themselves as lawful soldiers, and they’re avoiding their enemy, despite the rules for how one goes about warmaking.
Overall, any question of what is or isn’t right is in a sort of limbo because there isn’t really any universal precedent. Countries like the UK, where terrorism has been a hobby for teens for the last century, not to mention the IRA, might have some sort of special legal basis for terrorists and how to deal with them, but the international world and the US don’t really. We’re just making it up as we go. Any mildly related law which can be applied can be met, by the Federal government, with the argument that they have their job to do and due to the way that terrorists operate, there simply isn’t any feasible way to do otherwise.
In general, the Supreme Court allows such a reasoning to pass – that if the government is duty bound to do something, and there’s only one way to do it, then other considerations go away. As example, I’m entitled to live my own life as I wish. But the government is required to protect the land, so if they need soldiers, they can pull me in and make me a soldier because protecting the land takes precedence over my right to choose my life.
Whether the World Court would follow the same line of reasoning, I can’t say.
In either case, you could make the argument that killing the enemy isn’t necessary. They could just arrest them. But then, you could make that argument for any war. But certainly you can make the argument that when it comes to terrorism, where exactly are you supposed to consider to be “the battlefield”? If the NSA was planning to hack into Russia’s computers and tell all their nukes to self destruct, Russia would consider itself to have full right to bomb the hell out of the NSA campus, despite that the NSA building is probably just a few buildings full of cubicles and computers – no different from Microsoft or Amazon – and despite that none of the workers are dressed in military uniforms. Modern warfare, where you bomb factories and use computer viruses, invalidates the whole idea of a battlefield. The new definition is that anything which can be called a war target is its own battlefield.