I've actually been thinking about this for quite a while when I saw your post pop up. The thing is, there seems to be a lot of misconception about organizations such as NASA or the US Air Force Space Command and other agencies. And that's fair and all, I don't expect most people to understand the mandates and internal practices of these organisations. And because some space programs fall under military jurisdiction, there can be very little information to even dig up if a person is interested.
But back to the topic at hand. Let's suppose there is a rogue asteroid that is on a collision course with Earth, and for whatever reason people want to keep it secret. How could they prevent word from getting out? Well, the fact is that most
major universities in the world (like my alma mater, the University of Edinburgh - shown below) all have various optical telescopes, radio telescopes, and other equipment which are constantly scanning the skies for all sorts of objects, both within our solar system and beyond.
And make no mistake, research teams there are in continuous contact with each other. On a weekly basis we would get calls and emails from other schools around the continent to confirm something they might be detecting. So we'll take a look ourselves and record what we're picking up and send the info back. And obviously, the more locations you can get confirming an object, the more accurate it becomes to plot and catalogue. So if people find something that others don't want to be made public, it's not a case of silencing one or two or even a dozen individuals in one location - you have to do it with multiple groups across multiple schools in multiple countries.
The thing is, when people think of stuff happening in space, they automatically assume it all falls under the authority of NASA and other government agencies (like the US Air Force Space Command or up here in the Great White North; the Canadian Space Agency). To be fair, these organizations are spearheading a lot of the planetary missions like Mars rovers and the recent fly-by of Pluto by New Horizons - but even then there are partnerships with various schools and research institutions where data is exchanged.
I feel like I'm going off on a tangent here and I apologize. I just love talking astronomy.
The point is, open space is a pretty big place for things to happen and observe. Now that said, planetary missions are a bit different and very few people will have direct access to the information coming from these probes and rovers. Hiding a discovery on a planet such as Mars would still be somewhat difficult, but not nearly as much as trying to hid something like an asteroid or planetoid - at least nothing of a size that would do significant damage to Earth.
EDIT: By the way, this doesn't mean to say that we've plotted every single NEO that could be a potential hazard. We think we have a good handle on larger ones that could cause global damage, but there are innumerable smaller and faster objects that could easily take out a sizable chunk of land - and people.
But one thing to remember is that even with billions of these objects moving around the solar system, space is still a very big place, and Earth is a relatively small target. Suffice it to say, impact scenarios certainly don't keep me up at night.
Now as for Gamma Ray Bursts...