The Messenger of Allah ﷺ said, "Allah has set forth a parable. There is a straight path, and on both sides of the path are two walls in which there are open doors, and over the doors are hanging curtains. At the entrance of the path stands a caller who says, 'People, enter the path all together and do not deviate.' And there is another caller who calls from above the path. Whenever a person wishes to open one of those doors, this caller says, 'Woe to you, do not open it, for if you open it, you will pass through.'The path is Islam, the two walls are the limits set by Allah, the open doors are the things Allah has forbidden, the caller at the head of the path is the Book of Allah, and the caller from above the path is the admonisher of Allah in the heart of every Muslim."
عن رسول الله ﷺ قال: ضرب الله مثلا صراطا مستقيما، وعلى جنبتي الصراط سوران، فيهما أبواب مفتحة، وعلى الأبواب ستور مرخاة، وعلى باب الصراط داع يقول: يا أيها الناس ادخلوا الصراط جميعا، ولا تتعرجوا، وداع يدعو من فوق الصراط، فإذا أراد أن يفتح شيئا من تلك الأبواب قال: ويحك، لا تفتحه، فإنك إن تفتحه تلجه. والصراط الإسلام، والسوران حدود الله، والأبواب المفتحة محارم الله، وذلك الداعي على رأس الصراط كتاب الله، والداعي من فوق الصراط واعظ الله في قلب كل مسلم.
Ahmad (17634), Tahawi in Sharh Mushkil (2142), and Hakim (1/73) all narrated it through routes going back to Muawiya bin Salih, that Abdul-Rahman bin Jubayr told him, from his father, from Nawas bin Saman, and he related it. Its chain of transmission is sahih. Hakim said, "Sahih according to the criterion of Muslim, and I know of no defect in it." Tirmidhi (2859), Ahmad (17636), and Tahawi in Sharh Mushkil (2143) all narrated it through the route of Baqiya bin Walid, who said, Buhayr bin Saad told me, from Khalid bin Madan, from Jubayr bin Nufayr, from Nawas, and he related something similar. Baqiya was a mudallis, but he explicitly stated that he heard it directly, though some scholars allowed for his narrations from Buhayr bin Saad even without such explicit statement. Tirmidhi said, "This is a hasan gharib hadith."