The Messenger of Allah ﷺ was asked about wealth received from the ruler. He said, "Whatever Allah brings to you of it without your asking for it or looking out for it, eat it and treat it as your own property."Hasan said, "There is no harm in it, as long as one does not journey to seek it or set his sights on it."
حدثنا أبو معاوية حدثنا هشام بن حسان القردوسي عن قيس بن سعد عن رجل حدثه
سئل رسول الله ﷺ عن أموال السلطان فقال ما أتاك الله منها من غير مسألة ولا إشراف فكله وتموله قال وقال الحسن لا بأس بها ما لم يرحل إليها أو يشرف لها
Its chain of transmission is daif, due to the anonymity of the narrator from Abu Darda, but the hadith is sahih, having previously appeared under 21596.