https://en.wikipedia.org/wiki/Posse_Comitatus_Act
In 2006, Congress modified the Insurrection Act as part of the 2007 Defense Authorization Bill (repealed as of 2008). On September 26, 2006, President George W. Bush urged Congress to consider revising federal laws so that U.S. armed forces could restore public order and enforce laws in the aftermath of a natural disaster, terrorist attack or incident, or other condition. These changes were included in the John Warner National Defense Authorization Act for Fiscal Year 2007 (H.R. 5122), which was signed into law on October 17, 2006.[6]
Section 1076 is titled "Use of the Armed Forces in major public emergencies." It provided that:
The President may employ the armed forces… to… restore public order and enforce the laws of the United States when, as a result of a natural disaster, epidemic, or other serious public health emergency, terrorist attack or incident, or other condition… the President determines that… domestic violence has occurred to such an extent that the constituted authorities of the State or possession are incapable of maintaining public order… or [to] suppress, in a State, any insurrection, domestic violence, unlawful combination, or conspiracy if such… a condition… so hinders the execution of the laws… that any part or class of its people is deprived of a right, privilege, immunity, or protection named in the Constitution and secured by law… or opposes or obstructs the execution of the laws of the United States or impedes the course of justice under those laws.[7]
In 2008, these changes in the Insurrection Act of 1807 were repealed in their entirety, reverting to the previous wording of the Insurrection Act.[8] It was originally written to limit presidential power as much as possible in the event of insurrection, rebellion, or lawlessness.
In 2011, President Barack Obama signed National Defense Authorization Act for Fiscal Year 2012 into law. Section 1021(b)(2) extended the definition of a "covered person", i.e., someone possibly subject to detention under this law, to include:
A person who was a part of or substantially supported al-Qaeda, the Taliban, or associated forces that are engaged in hostilities against the United States or its coalition partners, including any person who has committed a belligerent act or has directly supported such hostilities in aid of such enemy forces.[9]
Section 1021(e) purports to limit the scope of said authority with the text, "Nothing in this section shall be construed to affect existing law or authorities relating to the detention of United States citizens, lawful resident aliens of the United States, or any other persons who are captured or arrested in the United States."[10]