Every federal employee knows about the Hatch Act, which dates back to 1939:
You can Google the following searches to find out more about the Hatch Act:
hatch act site:gov
hatch act site:org
There are specific ethics rules for the Executive Branch:
“Standards of Ethical Conduct for Employees of the Executive Branch
Certain political activities should also be analyzed under the Standards of Ethical Conduct for Employees of the Executive Branch. For example, campaign activities trigger the teaching, speaking, and writing restrictions of 5 C.F.R. § 2635.807. An employee may not use his official Government title or position to identify himself in connection with a speaking activity, unless the title or position is one of many biographical details.” [Link to USOGE for more.]
See also:
2018: Conway HA-18-0966 Final Report
2019: Report of Prohibited Political Activity Under the Hatch Act OSC File Nos. HA-19-0631 & HA-19-3395 (Kellyanne Conway)