This court decision linked ends up concluding that CBP doesn't need a warrant, but they do need reasonable suspicion- a much lower standard- before performing a search. More than no suspicion, which is what CBP etc were claiming.
Here's an explanation of reasonable suspicion in comic form (part of a larger chapter on 4th amendment law): https://lawcomic.net/guide/?p=1833