The verb いる/いります(5だんどうし, or consonant-root verb which means "need") and the na-adjective ひつようだ(necessary) take the particle が to mark what is needed. This verb is not to be confused with いる/います(1だんどうし, or vowel-root verb which means "be; exist").
外国へ 行く時、パスポートが いります。
You need a passport when you go abroad.
外国へ 行く時、パスポートが ひつようです。
You need a passport when you go abroad.