A couple of relevant posts from "Law and the Multiverse". (For those that aren't familiar with it, it's a long-running blog from an actual lawyer who's also a comic book nerd, so he likes to examine questions just like this from a (US) legal point of view.)
Superheroes and Alter Egos
Costumes and the Confrontation Clause
(The short form: it's not entirely clear -- of course not, it's law -- as courts can and have made exceptions to publically identifying witnesses. Such exceptions are rare, though. But one big loophole is that this is all only relevant if the super is giving testimonial evidence -- that is, they personally are testifying to criminal actions they observed from the supervillain, or whatever. Merely, say, capturing a bad guy and leaving him hanging an a web with an affadavit pinned to his chest for the police to pick up doesn't require testimony. And for witnesses that are testifying, you can only ask relevant questions. "What is your real name, Superman", might not be considered as relevant. But then, there's the exception to the exception -- the defense might want to establish identity for purposes of impeaching the super-witness, if they could show some personal bias or whatever.)