A NASA post advertising a job opening for a new Planetary Protection Officer provided a field day for headline writers who apparently couldn't resist having a bit of fun at the agency's expense. Stories went viral by suggesting that NASA wants to hire someone to defend Earth from aliens -- and will pay them good money to do it.

While true in the broadest possible sense -- the "aliens" in question are microbes, not sentient beings -- the office is actually part of a long-standing program to make sure NASA spacecraft don't contaminate other planets with any earthly bugs and to ensure that any samples returned to Earth are properly isolated and pose no threat to our ecosystem.

Catharine "Cassie" Conley is the outgoing Planetary Protection Officer, the seventh to hold the post. She came on board in 2006 and, like her predecessors, reports directly to the NASA administrator.

Get Breaking News Delivered to Your Inbox

"As the Planetary Protection Officer for NASA, I am responsible for ensuring that the United States complies with Article IX of The Outer Space Treaty," she said in a NASA interview.

"Article IX specifies that planetary exploration should be carried out in a manner so as to avoid contamination of the bodies we are exploring throughout the solar system, and also to avoid any adverse effects to Earth if materials are brought back from outer space.

Catharine Conley, NASA's outgoing Planetary Protection Officer, holds a Ph.D. in plant biology. She's held the post since 2006. NASA

As she told The New York Times in a 2015 interview, "If we're going to look for life on Mars, it would be really kind of lame to bring Earth life and find that instead."

No matter. NASA's search for the agency's eighth Planetary Protection Officer -- at a salary of up to $187,000 per year -- was enough to trigger a flurry of stories.

"NASA has a job opening for someone to defend Earth from aliens – and it pays a 6-figure salary," Business Insider headlined its web story.

The piece included a graphic from the movie "Independence Day" showing a giant alien spaceship in the process of destroying New York City. The caption: "A typical day in the office for a planetary protection officer isn't this exciting."

The Independent in Britain headlined its story: "NASA offering six-figure salary for new 'planetary protection officer' to defend Earth from aliens."

Even former shuttle commander Mark Kelly got in on the fun, tweeting, "I nominate Bruce Willis."

I nominate Bruce Willis... what do all of you think? https://t.co/HUVpjCPSFs — Mark Kelly (@ShuttleCDRKelly) August 3, 2017

Followers chimed in with other suggestions, including "Men in Black" star Will Smith; Matt Damon of "Martian" fame; Peter Cushing, the evil "Star Wars" general; Jodie Foster, who met aliens in the movie "Contact;" Bill Pullman, who portrayed the president in "Independence Day;" and even the fictional Jack Bauer of the long-running series "24."

But planetary protection is serious business at NASA, guiding how missions are designed and implemented. Consider the agency's Cassini spacecraft now orbiting Saturn.

Now at the end of a 20-year mission -- the past 13 in orbit around Saturn -- Cassini is virtually out of fuel and without propellant, NASA cannot control the probe's orientation or change its trajectory.

Instead of simply letting the spacecraft die, leaving it at the mercy of unpredictable gravitational interactions, flight controllers earlier this year used most of the probe's remaining fuel to put it on a trajectory that will impact Saturn next month, ensuring its destruction.

That's because at least one of Saturn's moons, Enceladus, has a sub-surface ocean that could be an abode for life. If NASA simply let Cassini die, it eventually could crash into Enceladus, depositing microbes from Earth. And heat from the spacecraft's three plutonium-powered radioisotope thermoelectric generators, or RTGs.

The RTGs were built to withstand a launch pad explosion and all three likely would survive an impact on Enceladus where "more than likely (they would melt) through the ice shell, over time, and then you're in the sub surface," said Jim Green, director of planetary science at NASA headquarters. "It's going to be laying there, and it's going to end up in the ocean."

And that includes tens of thousands of microbes that hitched a ride to Saturn aboard Cassini.

"Human microbes can withstand all kinds of things, but having the right environment where heat is available is really the way they could multiply and grow," Green said in an interview Wednesday. "So, having that system in the ocean is not good. Even though it might be a remote chance, it's not zero."

NASA ended the Galileo Jupiter probe the same way, crashing it into the giant planet's atmosphere in 1995 to make sure it could not one day hit Europa, another moon with a sub-surface ocean, or any others that might be habitable.

The Juno probe currently in orbit around Jupiter faces the same fate when its mission ends as will the Europa Clipper, a spacecraft currently on the drawing board that will study the intriguing moon during multiple flybys in the 2020s.

Mars, of course, is a major concern when it comes to planetary protection, the target of multiple satellites, landers and rovers over several decades. No one yet knows whether some form of microbial life might exist at the red planet, either on or below the surface, and NASA scientists want to find out, if possible, before humans make the trip.

Once astronauts arrive, it's "game over," Green said. "It's then the clash of two potentially different ecosystems."

"For me as a scientist, I want to get in there and I want to understand the environment before we bring our environment with us," he said. "Answering the question is Mars alive today, is there a living population, is actually something that's very important for us to try to pull off. And that's very hard to do."

Astronauts, of course, will live in isolated habitats, "almost like they'll be quarantined," Green added. "So there will still be areas all over Mars that'll be very pristine and could maintain an ecosystem, you know, perhaps there's life in the aquifers, and it'll take maybe a couple of centuries before it's totally game over."

"This is the kind of thing we need to guard against, and getting in there and understanding the environment the best we can is the first thing we want to do."

Green and his fellow planetary scientists are equally concerned about making sure any Mars rocks returned to Earth are handled safely. When the Apollo astronauts brought rocks back from the moon, the samples -- and the astronauts -- were initially quarantined. Green said NASA is considering a variety of options to isolate Mars rocks.

"We're looking at either constructing or using an existing bio-level 4 facility," he said. "This is a facility that would be used for the most extreme virus or bacteria or something that could sweep the world and kill the population. There are facilities like that (and) we're going to have to either develop our own or tag onto something like that."

He said some researchers don't believe life currently exists on Mars and "they'd be delighted to just lift the top of every one of the rock tubes and that would make them publicly available if they didn't die the next day!"

"But that's not how it's going to work," he said. "We're going to bring them in and examine the heck out of them. (Even) if it had zero biological contamination associated with it, is going to be a number of years before anybody will be able to analyze the samples outside that facility."