  Given a quasi-projective variety X with only Kawamata log terminal
singularities, we study the obstructions to extending finite \'etale covers
from the smooth locus $X_{\mathrm{reg}}$ of $X$ to $X$ itself. A simplified
version of our main results states that there exists a Galois cover $Y
\rightarrow X$, ramified only over the singularities of $X$, such that the
\'etale fundamental groups of $Y$ and of $Y_{\mathrm{reg}}$ agree. In
particular, every \'etale cover of $Y_{\mathrm{reg}}$ extends to an \'etale
cover of $Y$.
  As first major application, we show that every flat holomorphic bundle
defined on $Y_{\mathrm{reg}}$ extends to a flat bundle that is defined on all
of $Y$. As a consequence, we generalise a classical result of Yau to the
singular case: every variety with at worst terminal singularities and with
vanishing first and second Chern class is a finite quotient of an Abelian
variety. As a further application, we verify a conjecture of Nakayama and Zhang
describing the structure of varieties that admit polarised endomorphisms.
