The Depart of Defense Secretary in the United States is a political appointee confirmed by the Senate and part of the civilian control of the military, but the Defense Department is obviously part of the Armed Forces. Therefore is the Secretary part of the chain of command under the President related to him being the Chief Executive or is it Commander in Chief of the Armed Forces?
Wikipedia covers it. The answer is, "both", depending one which version of CoC (operational or not) is exercised.
The President and the Secretary of Defense exercise authority and control of the Armed Forces through two distinct branches of the chain of command. One branch (10 U.S.C. § 162) runs from the President, through the Secretary of Defense, to the Combatant Commanders for missions and forces assigned to their commands. The other branch, used for purposes other than operational direction of forces assigned to the combatant commands, runs from the President through the Secretary of Defense to the Secretaries of the Military Departments, i.e., the Secretary of the Army (10 U.S.C. § 3013), the Secretary of the Navy (10 U.S.C. § 5013), and the Secretary of the Air Force (10 U.S.C. § 8013). The Military Departments, organized separately within the Department, operate under the authority, direction, and control of the Secretary of that Military Department. The Secretaries of the Military Departments exercise authority through their respective Service Chiefs (i.e., Chief of Staff of the Army, Commandant of the Marine Corps, Chief of Naval Operations, and Chief of Staff of the Air Force) over forces not assigned to a Combatant Command. The Service Chiefs, except as otherwise prescribed by law, perform their duties under the authority, direction, and control of the Secretaries of their respective Military Departments, to whom they are directly responsible.
In the Goldwater-Nichols Department of Defense Reorganization Act of 1986, Congress clarified the command line to the combatant commanders and preserved civilian control of the military. The Act states that the operational chain of command runs from the President to the Secretary of Defense to the Combatant Commanders. The Act permits the President to direct that communications pass through the Chairman of the Joint Chiefs of Staff from the Secretary of Defense, and to the Combatant Commanders. This authority places the Chairman in the communications chain. Further, the Act gives the Secretary of Defense wide latitude to assign the Chairman oversight responsibilities for the activities of the Combatant Commanders.
Among other changes, Goldwater–Nichols streamlined the military chain of command, which now runs from the President through the Secretary of Defense directly to combatant commanders (CCDRs, all four-star generals or admirals), bypassing the Service chiefs. The Service chiefs were assigned to an advisory role to the President and the Secretary of Defense as well as given the responsibility for training and equipping personnel for the unified combatant commands.
Less relevant to your main question, here's the legalese surrounding SecDef:
10 U.S.C. United States Code, 2015 Edition Title 10 - ARMED FORCES Subtitle A - General Military Law PART I - ORGANIZATION AND GENERAL MILITARY POWERS CHAPTER 2 - DEPARTMENT OF DEFENSE Sec. 113 - Secretary of Defense From the U.S. Government Publishing Office, www.gpo.gov
§113. Secretary of Defense
(a) There is a Secretary of Defense, who is the head of the Department of Defense, appointed from civilian life by the President, by and with the advice and consent of the Senate. A person may not be appointed as Secretary of Defense within seven years after relief from active duty as a commissioned officer of a regular component of an armed force.
(b) The Secretary is the principal assistant to the President in all matters relating to the Department of Defense. Subject to the direction of the President and to this title and section 2 of the National Security Act of 1947 (50 U.S.C. 3002) he has authority, direction, and control over the Department of Defense.
and shall function under the direction, authority, and control of the Secretary of Defense; to provide for their unified direction under civilian control of the Secretary of Defense
(b)Chain of Command.—Unless otherwise directed by the President, the chain of command to a unified or specified combatant command runs—
(1) from the President to the Secretary of Defense; and
(2) from the Secretary of Defense to the commander of the combatant command.