The Washington Navy Yard has a history of weak security, with past reports citing poor entrance controls, video dead spots, inadequate lighting, malfunctioning alarms and other problems.

Building 197, which houses the Naval Sea Systems Command headquarters, was the main site of the gunfire in which 13 people died, including the killer, identified by police as Aaron Alexis, 34, of Fort Worth, Texas.

James Atkinson, a former military intelligence officer who heads Granite Island Group in Gloucester, Mass., said the Navy hired his surveillance security firm in 2009 to test newly installed electronic security gates and other access controls inside Building 197.

The “controlled penetration” test revealed that a tamper sensor wasn’t working because of a design defect and that hardware-store-variety screws had been used to secure the main access-control panel instead of more expensive screws that could be loosened only with a specific screwdriver, Atkinson said.

“We found not only had people opened it up, but there were traces that somebody had placed a device inside that was recording data, so somebody could hoax the unit and claim to be a person they were not,” Atkinson said.

More broadly, in two dozen investigations over previous years, Atkinson’s firm found major security lapses throughout the facility, such as doors jammed open with pieces of cardboard, “crisscrossed” video cameras pointed at each other, too few cameras and bad lighting at night.

“The security there is extraordinarily poor,” Atkinson said. “They need more cameras, better door security, better lighting. The access controls were appalling. The Washington Navy Yard has security that is below the level of security you see at Harvard or MIT (the Massachusetts Institute of Technology) or Boston University or any other major campus.”

Mo Schumann, a Pentagon spokesman, declined to discuss security at the Washington Navy Yard, but said there have been broader security upgrades at military facilities.

A midlevel civilian employee who has worked at the Navy Yard for more than a decade said security upgrades are long overdue.

“They’ll check your badge and they’ll check your car to make sure it has a Naval District of Washington current sticker, but you can drive through the base with a bazooka in your trunk and they wouldn’t know,” said the employee, who spoke on the condition of anonymity in order to speak candidly.

“They don’t check inside the car,” he said. “You can drive in with a ham sandwich, a banana and a pistol in your lunch bag, and they don’t check. It’s pretty bad.”