Whistle-blowing is not illegal (in the US) that's what the laws are there for, though obviously it's dicey and depends on media portrayal, and those laws could stand to be reinforced.
The Abu Ghraib (Iraq prison scandal) whistle-blower was protected by the system even if some people were very upset.