The application of microgrids in critical infrastructures has grown considerably due to the power supply reliability and resilience, and the island operation possibility of providing independence from the main grid. However, the necessity of intense information exchange between the devices that compose the microgrid to their proper operation, and the communication infrastructure required to realize that, makes the system vulnerable to cybersecurity threats. In this context, the case study presented in this paper raises two important subjects of discussion in the Brazilian electrical sector context, which are microgrids and cybersecurity in critical infrastructures of the electrical sector. Therefore, this paper presents the practical challenges related to these two subjects by reporting the development, implementation, and commissioning of a new microgrid controller, and the solutions found to accelerate the development by reducing costs, mitigating risks, and optimizing the commissioning time.