The Department of Homeland Security's primary mission is to prevent terrorist attacks within the United States, and in the event one does occur, to minimize damage and carry out swift recovery.
Literal
Department-of-Homeland-Security [attributive-の] main duties [topic-は], US-domestic [attributive-の] terror-attacks [object-を] beforehand prevent-[ren'yōkei-ぎ], in-the-unlikely-event-万一, occurred case [topic-は], damage [object-を] minimum-[at-に]-hold-back, swift [attributive-な] recovery [object-を] implement [thing-こと] [at-にある].
Formal bureaucratic/policy prose. 未然に防ぐ ('to prevent beforehand, to forestall') is a set phrase. 万一 ('in the unlikely event, should X happen') is a classical-origin adverbial. ~にある ('lies in, is located in') is used for abstract 'lies in X' constructions about mission, essence, purpose.