"Ensuring Civilian control of the military, an individual may NOT be appointed as Secretary of Defense within 7 years after relief from active duty." General Matthis retired May 2013.
A waiver was signed before for General George Marshall. Many decades ago.