Sunan Ibn Majah, Book 7, Hadith 144 (Ibn Majah 1781)
It was narrated from Ibn ‘Abbas that:
The Messenger of Allah (ﷺ) said concerning the person observing I’tikaf. “He is refraining from sin and he will be given a reward like that of one who does all kinds of good deeds.”