There isn't a whole lot of grey in this one. Rosen, a journalist, was named in a search warrant application as an aider, abettor and/or co-conspirator to violations of the Espionage Act for receiving classified information. It is extraordinarily unlikely that Rosen would be prosecuted as such and that the purpose of naming him as an aider, abettor or co-conspirator was to circumvent restrictions on obtaining journalist work product, but that's what happened. And it's wrong. Very wrong.
Basically, the government is prohibited from gaining access to "search for or seize any work product materials possessed by a person reasonably believed to have a purpose to disseminate to the public a newspaper, book, broadcast, or other similar form of public communication, in or affecting interstate or foreign commerce." However, there is an exception to this rule where "there is probable cause to believe that the person possessing such materials has committed or is committing the criminal offense to which the materials relate," which includes the receipt or dissemination of classified material,
So, yes, the government complied with all the legal formalties and didn't do anything "above the law," but the law is fucked and the government shouldn't be naming journalists as aider/abettors/co-conspirtors with leakers, even though they maybe technically are.