A lightweight security solution is proposed for the Internet of Things (IoT) systems. In fact, this proposed solution is called TrioSec, and can ensure the basic security requirements such as Authentication/Authorization, Intrusion Detection System (IDS), and System Monitoring with minimum computation and resources overhead. The proposed solution uses optimized open source software agents that can be implemented in the Gateway node of the IoT network layer. In fact, several recent interesting security solutions were being presented in the literature to tackle these security requirements. However, there is not yet any complete security solution for IoT systems that integrates multiple software agents. The advantage of the proposed solution is its ability to combine the best existing and customized security tools to reach a maximum level of security with a minimum overhead level in terms of computation and resources.