Internet of Things (IoT) technology is used to enhance the safety of the elderly living in smart home environments and to help their caregivers. The daily behaviour of the elderly people is collected using IoT sensors and then evaluated to detect any abnormal behaviour. This research paper analyzes the smart home based anomaly detection system from a security perspective, to answer the question whether it is reliable and secure enough to leave elderly people alone in their smart homes. In this direction comparative analysis of literature is done to identify the potential security breaches on all layers of an IoT device. Further, this paper proposes a secure smart home model, built using Cisco Packet Tracer to simulate a network of IoT devices in a smart home environment. Consequently, a list of security countermeasures is proposed to protect the IoT devices from the identified attacks. .