Most spies don't go into forbidden places and physically dig up secrets themselves. It's infinitely easier to get to know someone who already knows those secrets and persuade them to tell.
https://en.wikipedia.org/wiki/Cambridge_Five
Or Aldrich Ames:
https://www.fbi.gov/history/famous-cases/aldrich-ames
Someone who manages spies is an intelligence officer.
While you're right that these folks aren't undercover in the sense that their identities are known, that those identities are linked to an intelligence gathering agency is not known. A lot does happen out in the open and it always has. Being a member of the diplomatic service gives them protection when they're operating in a foreign country. You operate out of an embassy and if you're arrested they usually trade you back to your home country, because diplomatic immunity.
A key thing to appreciate is that the women in this article, including Rebecca, are not spies. They are civil servants [1] working in a very sensitive area of government. None of them are undercover, or sneaking into Russian bases. It's a sensible precaution for them to keep quiet about what they do, but it's not like their ability to do their job depends on absolute secrecy.
By way of comparison, the US equivalent of Rebecca, who is the deputy to the chief of the service, would be the deputy director of the CIA. The identity of that person is not only public, he has a wikipedia page [2]!
[1] Well, diplomatic servants, but that's basically an alternative flavour of civil servant that exists for historical reasons
[2] https://en.wikipedia.org/wiki/David_S._Cohen_(attorney)