U.S. Customs and Border Protection's Powers and Limitations: A Brief Primer [December 9, 2020] [open pdf - 708KB]
From the Document: "U.S. Customs and Border Protection (CBP), a component of the Department of Homeland Security (DHS), enforces federal customs and immigration laws at or near the international border and at U.S. ports of entry. Congress has established a comprehensive framework enabling CBP officers to inspect, search, and detain individuals to ensure their entry and any goods they import conform to these governing laws. That authority is not absolute. The Fourth Amendment to the U.S. Constitution prohibits government searches and seizures that are not reasonable. While the government has broader latitude to conduct searches at the border than in the interior of the United States, these searches must still satisfy Fourth Amendment requirements. This Legal Sidebar briefly explains CBP's customs and immigration enforcement powers and the constitutional limitations to that authority."
CRS Legal Sidebar, LSB10559
Congressional Research Service: https://crsreports.congress.gov/