An airline pilot who posted a series of videos online that exposed shortcomings in airport security has been punished by the Transportation Security Administration, which included a visit to his home by federal agents and sheriff’s deputies.

Sound familiar? It does to me.

The videos, which have since been deleted, show that thousands of airport employees are allowed to skip security every day at San Francisco International Airport. Here’s the full report from the San Francisco ABC affiliate and the station that broke the story, News 10 in Sacramento.

The pilot, whose name was not given, had his gun confiscated and a deputy sheriff asked him to surrender his state-issued permit to carry a concealed weapon. The pilot’s status as a Federal Flight Deck Officer, a volunteer position, is being reviewed, he was told.

Among the security gaps the video exposed:

• The “irony” of flight crews being forced to go through TSA screening while ground crew who service the aircraft are able to access secure areas simply by swiping a card.

• The fact that pilots have access to a dangerous-looking ax on the flight deck — used for emergencies — once they’re done being screened by the TSA.

• Various elements of airports that are completely unscreened, such as luggage carts.

Perhaps the most disturbing part of the report comes when aviation consultant Ron Wilson, a former SFO employee, admits on camera that the whistleblowing pilot is right. All a terrorist needs to do to penetrate security is to get an ID, which is relatively easy, he suggests.

“I still have mine,” he says, brandishing his old ID.

The pilot’s attorney, Don Werno, says the feds sent six people to the pilot’s house to send a message.

“And the message was you’ve angered us by telling the truth and by showing America that there are major security problems, despite the fact that we’ve spent billions of dollars allegedly to improve airline safety,” he told ABC.

None of this should surprise you. We’ve already covered the many exceptions to TSA’s porous security, including the fact that airport volunteers can often slip right through the unguarded doors.

We also know that TSA’s response can be heavy-handed. Not only did an agent show up on my doorstep with a subpoena last year, but they also went after a colleague who had posted a security directive on his site and took his computer. (Both subpoenas were eventually withdrawn.)

The pilot who posted these videos did the right thing. The absurdities and flaws in airport security must be exposed in order to improve them, and, as is painfully obvious to anyone who covers aviation security, the current system isn’t working. It’s harming tourism and air travel, leaving passengers with a false sense of security, and paving the way for an inevitable re-run of 9/11.

There has to be a better way.

Update (7:30 p.m.): The pilot — still anonymous — speaks out.