The noun threat may take either a prepositional phrase (PP) headed by to or a verb phrase (VP) headed by a marked infinitive as a complement—or both:
... the global threat [PP to our security]
... Britain's threat [PP to France] [VP to stifle its trade]
The PP names the recipient of the threat: the person or entity against whom Britain directs the threat. The VP names the action which Britain says it will perform.
So may the noun duty:
... our duty [VP to act]
... our duty [PP to our society] [VP to pay taxes]
The PP names the person to whom the duty is owed, or who imposes the obligation. The VP names the action which we are obliged to perform.
Note, however, that in your second example the second marked infinitive, to eliminate it, is an infinitive of purpose naming the purpose which our ‘acting’ is intended to achieve; it is not a complement of duty, but a constituent of the VP headed by the verb act:
... our duty [VP [VP to act] [VP to eliminate it] ]
How you parse to eliminate it is ambiguous. Some might regard it as a complement of act, others as an adverbial adjunct modifying act.