Quick search by citation:

5 U.S. Code § 7324 - Political activities on duty; prohibition

(a) An employee may not engage in political activity—
(1)
while the employee is on duty;
(2)
in any room or building occupied in the discharge of official duties by an individual employed or holding office in the Government of the United States or any agency or instrumentality thereof;
(3)
while wearing a uniform or official insignia identifying the office or position of the employee; or
(4)
using any vehicle owned or leased by the Government of the United States or any agency or instrumentality thereof.
(b)
(1)
An employee described in paragraph (2) of this subsection may engage in political activity otherwise prohibited by subsection (a) if the costs associated with that political activity are not paid for by money derived from the Treasury of the United States.
(2) Paragraph (1) applies to an employee
(A)
the duties and responsibilities of whose position continue outside normal duty hours and while away from the normal duty post; and
(B) who is—
(i)
an employee paid from an appropriation for the Executive Office of the President; or
(ii)
an employee appointed by the President, by and with the advice and consent of the Senate, whose position is located within the United States, who determines policies to be pursued by the United States in relations with foreign powers or in the nationwide administration of Federal laws.
Editorial Notes
Prior Provisions

A prior section 7324, Pub. L. 89–554, Sept. 6, 1966, 80 Stat. 525; Pub. L. 93–268, § 4(a), Apr. 17, 1974, 88 Stat. 87, prohibited Executive agency employees and employees of the District of Columbia from influencing elections or taking part in political campaigns, prior to the general revision of this subchapter by Pub. L. 103–94.