The Prophet ﷺ said regarding the saying of Allah Most High, "Allah keeps firm those who believe with the firm word in the worldly life and in the Hereafter" [Ibrahim 14:27], "This refers to the grave, when he is asked, 'Who is your Lord? What is your religion? Who is your Prophet?'"
حدثنا محمود بن غيلان حدثنا أبو داود حدثنا شعبة أخبرني علقمة بن مرثد قال سمعت سعد بن عبيدة يحدث
عن النبي ﷺ في قول الله تعالى {يثبت الله الذين آمنوا بالقول الثابت في الحياة الدنيا وفي الآخرة} قال في القبر إذا قيل له من ربك وما دينك ومن نبيك
Agreed upon [by Bukhari and Muslim]. Bukhari narrated it in the Book of Funerals, the chapter on what has been said about the punishment of the grave, no. 1369, and Muslim, no. 2871, both from the hadith of Shubah with this wording, and it is also in Musnad Abu Dawud Tayalisi, no. 745.