Armed guards stand at the gates. IDs are needed to pass through electronic barriers. And uniformed members of the American military — well-trained and battle-tested — are everywhere, smartly saluting as they come and go.
And yet, twice in less than four years, a person with permission to be there passed through the layers of protection at a U.S. base and opened fire, destroying the sense of security at the installations that embody the most powerful military in the world.
"It is earth-shattering. When military bases are no longer safe, where is safe if that even doesn't exist anymore?" said Col. Kathy Platoni, a reservist who keeps a gun under her desk after witnessing the shooting at Fort Hood in Texas in 2009, when Army psychiatrist Maj. Nidal Hasan killed 13 people.
In the wake of this week's deadly rampage at the Washington Navy Yard, Defense Secretary Chuck Hagel ordered the Pentagon to review security at all U.S. defense installations worldwide and examine the granting of security clearances that allow access to them.
"We will find those gaps and we will fix those gaps," Hagel vowed on Wednesday.
After Fort Hood, the military tightened security at bases nationwide. Those measures included issuing security personnel long-barreled weapons, adding an insider-attack scenario to their training, and strengthening ties to local law enforcement, said Peter Daly, a vice admiral who retired from the Navy in 2011. The military also joined an FBI intelligence-sharing program aimed at identifying terror threats.
Then, on Monday, Aaron Alexis, a 34-year-old former Navy reservist who held a security clearance as an information technology employee at a defense company, used a valid pass to get into the Washington Navy Yard and killed 12 people before dying in a gun battle with police.
The attack has raised questions about the adequacy of the background checks done on government contractors who hold security clearances.
Hagel acknowledged "a lot of red flags" may have been missed in the background of the gunman, who had a history of violent behavior and was said to be hearing voices recently.
Many of the security improvements adopted after 9/11 and Fort Hood were created largely with terrorism in mind, not unstable individuals with no apparent political agenda. Those threats can be more difficult to detect.
Daly, who directs the U.S. Naval Institute in Annapolis, Md., said the military needs to review its procedures for vetting people for access to installations.
"Once you're inside that hardened line of defense, that is the most difficult scenario," he said. "We need to look at how these clearances are granted to contractors and subcontractors and to make sure once someone is granted clearance, that we come back and check again."
Some of the shock and sudden sense of vulnerability caused by Fort Hood and the Navy Yard attack may have stemmed from the mistaken belief that military personnel are armed when they are on domestic installations.
Most personnel are, in fact, barred from carrying weapons onto a base, and Hasan and Alexis probably knew it. Another little-known fact is that many searches are random. Not all vehicles or packages are checked.
In Southern California, Marine Capt. Aaron Meyer said it would be impossible to eliminate all threats without making military operations too costly or inefficient.
In 2010, he said, his parents were let in through the main gate at Camp Pendleton after guards checked only his father's driver's license, even though his mother was a passenger in the car.
"My mom was pretty shocked," Meyer said. But he said it would not be feasible to inspect every vehicle and trunk for weapons.
John Barney, owner of Tri-Star Commercial, an Austin, Texas, security company that has put cameras and card access systems in several military installations, said that after Fort Hood, the Pentagon mostly responded by increasing the armed police presence, but added few electronic measures.
But he admitted electronic security is not necessarily enough.
Just recently, he said, he was in a military warehouse area near San Antonio and entered without showing any identification or encountering military police. In one building, he came across an open metal cage stacked with M-16 rifles that anyone could have walked off with, he added.
"I've noticed gaps and holes that make me concerned," Barney said.
In the San Diego area, Karen Archipley, the wife of a retired Marine, visits Marine bases regularly for her work with an organic farm that trains veterans in agriculture. She said her sense of security has not been shaken.
"It's now happened twice in the past five years, but I would tell you that those are individual incidents. It wouldn't matter where those people were. They could have been at a post office," she said. "If somebody is unstable, unsteady, it doesn't matter."
Plushnick-Masti can be followed on Twitter at https://twitter.com/RamitMastiAP
Associated Press writers Melissa Nelson-Gabriel in Pensacola, Fla., and Julie Watson in San Diego contributed to this report.