Trump has said that he will nominate retired Marine General James Mattis to be Secretary of Defense. Congress must pass a special waiver for the nomination to go through. The National Security Act of 1947 said that anyone “who has within ten years been on active duty as a commissioned officer in a Regular component of the armed services shall not be eligible as Secretary of Defense.” In 2008, Congress reduced the period to seven years, but Mattis retired only three years ago.
Congress has waived the law once. From the 1950 CQ Almanac:
The House and Senate Sept. 15 gave final approval to a special bill (HR 9646) which would allow Gen. George C. Marshall to be appointed as Secretary of Defense. The President signed the bill Sept. 18 and submitted Marshall's appointment to the Senate for confirmation. The Senate confirmed Marshall Sept. 20 (see p. 355).
The bill set aside a provision in the National Security Act (Unification Act) of 1947 barring from the post of Secretary of Defense any person who had served as an officer in the Armed Forces during the past ten years. The exemption applies only to Marshall. The bill fixed Marshall's pay as his Army retirement pay plus the amount over that figure ordinarily paid a Cabinet member.The bill passed, but of those GOP House members and senators who cast a yea or nay vote, a majority opposed the waiver.
In the Senate, Democrats supported the bill 37-1 while Republicans opposed it 10-20.
In the House, Democrats supported the bill 192-5, while Republicans opposed it 27-100.
Senator Robert A. Taft of Ohio, "Mister Republican," explained:
The Secretary of Defense should be a civilian. No one even disputes the fact that this basic principle of the unification act [The National Security Act of 1947] is right ... General Marshall, like anyone who has served all his life in the Army, has certain definite views to which he is committed. Human nature being what it is, he must always be in the position of defending and justifying the policies he has supported in the past. An officer of one of the services, such as the Army, must inevitably be more interested in its operation than in that of the other two forces, such as the Navy and the Air Force. This is one of the reasons why the Secretary should be a civilian.