The paper presents a survey and analysis on the current status and concerns of Internet of things (IoT) security. The IoT framework aspires to connect anyone with anything at anywhere. IoT typically has a three layers architecture consisting of Perception, Network, and Application layers. A number of security principles should be enforced at each layer to achieve a secure IoT realization. The future of IoT framework can only be ensured if the security issues associated with it are addressed and resolved. Many researchers have attempted to address the security concerns specific to IoT layers and devices by implementing corresponding countermeasures. This paper presents an overview of security principles, technological and security challenges, proposed countermeasures, and the future directions for securing the IoT.