From 2014 to 2017, Iraqi Kurdistan was one of the most secure places in the world, despite sharing a thousand-kilometer-long border with ISIS in Iraq and Syria.