Permanent green card residents have been sent to El Salvador prisons without trial in the recent stuff. This incident does say it was with a court behind it though.
That's the DHS authorization. It deals with immigration issues as a part of its investigations (for all federal agencies). But immigration action is not its primary role. They won't come looking for you because you broke immigration laws. But they will enforce them if it's found that you broke immigration laws while investigating something unrelated.