Would that hold up in court if the person were willing to challenge it? That seems a clear cut violation of that person's speech, but I guess anything for "national security".
US secrecy laws hold up in court. Just ask any contractor who accidentally brought home a classified document or three (and their name doesn't rhyme with Bonald Bump).