De Koster joined the Dutch resistance against the German occupiers in 1940 and led the resistance cell Peggy. Following the end of World War II De Koster worked as a Attaché at the League of Nations in from 1945 until 1946. De Koster worked as a corporate director for the flour company De Koster & Co from 1946 until 1967. De Koster also worked as a trade association executive for the Industry and Employers' association (VNO) from 1956 until 1967 and served as Vice Chairman from 12 March 1958 until 18 May 1961 and as Chairman from 18 May 1961 until 12 June 1967. De Koster also served as President of the Confederation of European Business, serving from 1 May 1962 until 12 June 1967. De Koster was elected as a Member of the House of Representatives after the election of 1967, taking office on 23 February 1967. Following the cabinet formation of 1967 De Koster was appointed as State Secretary for Foreign Affairs in the Cabinet De Jong, taking office on 12 June 1967. After the election of 1971 De Koster returned as a Member of the House of Representatives, taking office on 11 May 1971. Following the cabinet formation of 1971 De Koster was appointed as Minister of Defence in the Cabinet Biesheuvel I, taking office on 6 July 1971. The Cabinet Biesheuvel I fell just one year later on 19 July 1972 and continued to serve in a demissionary capacity until it was replaced by the caretaker Cabinet Biesheuvel II with De Koster continuing as Minister of Defence, taking office on 9 August 1972. After the election of 1972 De Koster again returned as a Member of the House of Representatives, taking office on 1 February 1973 but because he couldn't serve a dual mandate and was still a Minister he resigned as Member of the House of Representatives on 1 May 1973. Following the cabinet formation of 1973 the Cabinet Biesheuvel II was replaced by the Cabinet Den Uyl on 11 May 1973 and De Koster once again returned as a Member of the House of Representatives, taking office on 28 May 1973. De Koster also served as President of the Benelux Parliament, serving from 1 January 1975 until 1 January 1976. In March 1977 De Koster announced his retirement that he would not stand for the election of 1977 and he continued to serve until the end of the parliamentary term on 8 June 1977.
De Koster remained in active politics and was elected as a Member of the Senate following the Senate election of 1977, taking office on 20 September 1977. In December 1977 De Koster was nominated as President of the Parliamentary Assembly of the Council of Europe, serving from 1 January 1978 until 1 January 1981. In April 1980 De Koster was nominated as Extraordinary Member of the Council of State, he resigned as a Member of the Senate the day he was installed as a Member of the Council of State, serving from 16 May 1980 until 16 May 1985.
Hans de Koster graduated from Higher Civic School and earned his bachelor's degree in economics in Amsterdam. He then continued his studies abroad.
He worked at Koster & Co in Leiden, a flour mill renamed in 1928 as N.V. De Sleutels (now Meelfabriek).
World War II
During World War II, de Koster led the espionage group "Peggy". He promoted plans to assist the Dutch population and for Dutch economic recovery and he was in clandestine communication with Britain.
De Koster was friends with the Dutch royal family and especially with Prince Bernhard.
In 1946 he became director at N.V. De Sleutels, like his grandfather. In 1964, Keys was acquired by Meneba, and for three years de Koster was a board member.
In the De Jong cabinet (1967-1971), he was State Secretary for Foreign Affairs on behalf of the People's Party for Freedom and Democracy (Dutch: Volkspartij voor Vrijheid en Democratie, VVD). He was subsequently defence minister in two Biesheuvel cabinets (1971-1972 and 1972-1973).
In 1972 de Koster presented the Rijckevorsel Commission report which proposed changes in the Dutch armed forces, including a major reduction in the army and transfer of Air Force roles to NATO partners. , build a training area at Ter Apel and the first step towards a volunteer professional army.
After his time as minister, he was a member of the Dutch House of Representatives and spokesman on Foreign Affairs of the VVD (1973-1977) and from 1977 to 1980 he was a member of the Dutch Senate. From 1978 to 1981 he was Chairman of the Consultative Assembly of the Council of Europe.
From his personal archives, released in 2005, it was revealed that he breached the confidentiality of the private fixed Parliamentary Committee for Defence in June 1975, and the prince was informed about the developments. He also knew through a filibuster during a meeting of the committee to avoid research into the prince.