A method for monitoring an execution system of a programming logic controller, the method comprising: accessing, by a security module executable by a processor, the PLC execution system; dividing, by the security module, the code and data of the PLC execution system into a plurality of program modules based on at least one of: a functional structure of the PLC execution system by segregating each functionally complete segment of code and data of the PLC execution system into at least one module, and segregating the rest of the code and data of the PLC execution system into another module, a threat to the security of the PLC execution system, wherein a segment of code and data of the execution system which contains a vulnerability is segregated into at least one module, and the rest of the code and data of the PLC execution system is segregated into another module, or a criticality of the code and data of the PLC execution system by segregating each portion of code and data of the PLC execution system which controls a critical object into at least one module, and segregating the rest of the code and data of the PLC execution system into another module; modifying, by the security module, data exchange interfaces of the program modules used for the interaction between the program modules and the resources of an operating system of the PLC execution system such that said interaction occurs through the security module, while a format of the data being exchanged complies with a format specified by the security module; and monitoring, by the security module, the execution of the PLC execution system, including monitoring the interaction of the program modules of the PLC execution system with each other and with the resources of the operating system. accessing, by a security module executable by a processor, the PLC execution system; dividing, by the security module, the code and data of the PLC execution system into a plurality of program modules based on at least one of: a functional structure of the PLC execution system by segregating each functionally complete segment of code and data of the PLC execution system into at least one module, and segregating the rest of the code and data of the PLC execution system into another module, a threat to the security of the PLC execution system, wherein a segment of code and data of the execution system which contains a vulnerability is segregated into at least one module, and the rest of the code and data of the PLC execution system is segregated into another module, or a criticality of the code and data of the PLC execution system by segregating each portion of code and data of the PLC execution system which controls a critical object into at least one module, and segregating the rest of the code and data of the PLC execution system into another module; a functional structure of the PLC execution system by segregating each functionally complete segment of code and data of the PLC execution system into at least one module, and segregating the rest of the code and data of the PLC execution system into another module, a threat to the security of the PLC execution system, wherein a segment of code and data of the execution system which contains a vulnerability is segregated into at least one module, and the rest of the code and data of the PLC execution system is segregated into another module, or a criticality of the code and data of the PLC execution system by segregating each portion of code and data of the PLC execution system which controls a critical object into at least one module, and segregating the rest of the code and data of the PLC execution system into another module; modifying, by the security module, data exchange interfaces of the program modules used for the interaction between the program modules and the resources of an operating system of the PLC execution system such that said interaction occurs through the security module, while a format of the data being exchanged complies with a format specified by the security module; and monitoring, by the security module, the execution of the PLC execution system, including monitoring the interaction of the program modules of the PLC execution system with each other and with the resources of the operating system.