If you are not a citizen you can almost never be employed
directly by the Government. Getting a Top Security Clearance
too is very difficuilt.
However if you work for a defence contractor, and you dont need TS clearance, then you have nothing to worry. I know people
doing programming jobs (dont know the level of security ), working in secure buildings that are on ***H1*** visas. So its also a matter of who you work for (direct govt employee or thru contractor)