Towards Fortifying The Safety And Security Of Iot Systems