The infrastructure of and processes involved in a microgrid electrical system require advanced technology to facilitate connection among its various components in order to provide the intelligence and automation that can benefit users. As a consequence, the microgrid has vulnerabilities that can expose it to a wide range of attacks. If they are not adequately addressed, these vulnerabilities may have a destructive impact on a country’s critical infrastructure and economy. While the impact of exploiting vulnerabilities in them is understood, research on the cybersecurity of microgrids is inadequate. This paper provides a comprehensive review of microgrid cybersecurity. In particular, it (1) reviews the state-of-the-art microgrid electrical systems, communication protocols, standards, and vulnerabilities while highlighting prevalent solutions to cybersecurity-related issues in them; (2) provides recommendations to enhance the security of these systems by segregating layers of the microgrid, and (3) identifies the gap in research in the area, and suggests directions for future work to enhance the cybersecurity of microgrids.