There is nothing against the law about photographing federal buildings from public property. And yet, there have been plenty of stories about security guards and law enforcement trying to block photographers from taking those shots. There have been stories of seized cameras, demands to delete photos, etc., and the usual defense is that they're just "protecting against terrorism." However, after a settlement in a lawsuit concerning a guy who was arrested for videotaping outside the Federal courthouse in NY, Homeland Security has issued a notice to federal employees not to disrupt the photographing of federal buildings
. An excerpt from the now released document (which is fully embedded below):
For properties under the protective jurisdiction of FPS, there are currently no general security regulations prohibiting exterior photography of any federally owned or leased building, absent a written local rule or regulation established by a Court Security Committee or Facility Security Committee. Furthermore, it is important to understand that this regulation does not prohibit photography by individuals of the exterior of federally owned or leased facilities from publicly accessible spaces such as streets, sidewalks, parks and plazas.... Absent reasonable suspicion or probable cause, law enforcement and security personnel and (sic) must allow individuals to photograph the exterior of federally owned or leased facilities from publicly accessible space.
The report does say they can go speak to the photographer to determine the purpose of the photography if they believe it's warranted. However, unless they establish a higher bar of suspicion, they need to allow the photography to continue. They also are not allowed to seize cameras and cannot demand that a photographer delete the contents of the camera.