This says that Congress and Federal Courts would have to be involved, but I'm thinking under a martial law declaration, that would probably not be necessary. Especially for a very limited amount of time.
10/30/18: "Article 1, Section 9 of the US Constitution states, "The privilege of the writ of habeas corpus shall not be suspended, unless when in cases of rebellion or invasion the public safety may require it."
"Trump's language might also influence the decision on whether to suspend habeas corpus. In a tweet on Monday, Trump said, "This is an invasion of our Country and our Military is waiting for you!" An "invasion," as Trump puts it, would justify Congress to enact a suspension of habeas corpus."
wxyz.com/news/national/what-is-habeas-corpus-and-can-the-president-suspend-it-to-arrest-caravan-migrants