Distribution automation systems represent the new generation of power distribution systems in response to the growing interest in smart grids along with the integration of information and communication technologies (ICT). Distribution automation systems leverage advanced ICTs to automate system operation for delivering electrical energy to consumers. With the use of ICT comes the need to protect distribution automation systems from cyberattacks that could impact the operation of such systems, mainly power availability. In this thesis, the main objective is to assess the security aspect of distribution automation systems. As such, we design and implement a security monitoring platform that allows assessing the dynamics of these systems. In this regard, a digital twin testbed is designed and implemented to simulate smart power distribution systems in near real-time. Moreover, a proposed security monitoring platform is designed and implemented on top of the previously mentioned digital twin testbed. The platform can help monitor the impacts of different occurring incidents and allows executing implemented cyberattacks against the modeled power systems. In addition, it employs AI techniques to detect these attacks. The specific contributions of this thesis are: (i) the design and implementation of a cosimulation testbed for distribution automation systems using open source software packages; (ii) the design and implementation of an AI-based security analytics framework for distribution automation systems; and (iii) the implementation of cyberattacks targeting distribution automation applications. Various machine and deep learning models are implemented to detect the attacks and different performance evaluation metrics are used to compare different models. The obtained results are competitive and they validate the usefulness of the models in detecting attacks. The co-simulation platform is able to simulate power distribution systems in near real-time, along with an emulation of the IEC 60870-5-104 communication protocol. Also, the platform is capable of simulating big distribution test cases, e.g., the IEEE 123-bus and the IEEE 8500-nodes systems. The proposed platform allows power utilities to assess the security of their power distribution systems without affecting power availability and quality.