From the Star Wars: Aftermath trilogy, set directly after Return of the Jedi
Ex Imperial loyalty officer who fled the Empire, now the neighborhood drunk
Loyalty officers were responsible for discovering trespassers to the Empire and keeping any potential insubordination in line through force and or intimidation. They worked for the Imperial Security Bureau, an intelligence agency of the Empire.
Might be going by the name Markoos Cozen to pose as a member of the New Republic and save his hide. Yes that name is goofy and yes he made it up on the spot.
I generally set his canon point after the first book of the trilogy where he is currently a member of a New Republic crew of misfits tasked with finding Imperial war criminals and bringing them to trial.