The truth in a nutshell from Mark Steyn discussing piracy and "distractions" for the anointed one.
Most wealthy nations lack the means to defend themselves. Those few that do, lack the will. Meanwhile, basket-case jurisdictions send out ever bolder freelance marauders to prey on the civilized world with impunity.
And if those wealthy nations do demonstrate "the will" to protect the civilized world, that will soon diminishes into ridiculous notions of "nation building" and they get tied up in what they can and can't do with legal jargon and rules of engagement that even brilliant lawyers find hard to interpret let alone your average squaddie.
Go in, kick arse, get out.
That's all you need to do. Whether that is Afghanistan, Iraq or Somalia is irrelevant. Leave them to figure it out for themselves -and if they get it wrong again - go in, kick arse, get out. Repeat as necessary. Eventually they will get the point and leave you alone.