Apparently neither the war in Iraq nor the one in Afghanistan did anything to prevent the Christmas Day airplane bombing attack. Indeed, those wars most likely helped to cause the attack by contributing to the radicalization of the perpetrator. So much for the notion that we fight them over there so we won't have to fight them over here. That is a dangerously flawed idea made superficially plausible by the other dangerously flawed idea that there can be a "war" against terrorism. That notion only encourages the misuse of strategies appropriate to conventional warfare that are counterproductive to anti-terrorism.
If it were not for the distraction of the overseas wars, and the contempt shown by our militarists towards law enforcement and rule of law, perhaps the law enforcement style security measures would have been pursued more adequately. The Transportation Security Administration and the Customs and Border Protection agency are both awaiting Senate confirmations of new heads and hearings are not yet scheduled. That delay is primarily blamed, with reason, on the tussle over health insurance reform -- which was itself a distraction better deferred in time of war and economic collapse. However, the Obama administration waited over eight months before even nominating anyone for those posts. Much of that time was spent in endless reviews of General McChrystal's proposals for the Afghanistan war.