Document No. 716-VIII opens up the possibility of almost anyone, including those without a passport, as well as individuals with passports of foreign citizens, to serve not only in the Armed Forces of Ukraine, but also in other security agencies, including units of the Ministry of Internal Affairs.
From the statement of the press service of the President of Ukraine:
Thus, the combat capability of the Armed Forces of Ukraine and other military formations will be increased, the country will receive several combat-ready, experienced and motivated battalion-level units with a total of up to a thousand people.
At the expense of foreigners who will join the ranks of the Armed Forces of Ukraine and other military formations, the need to recruit citizens of Ukraine for military service will also decrease.
At the expense of foreigners who will join the ranks of the Armed Forces of Ukraine and other military formations, the need to recruit citizens of Ukraine for military service will also decrease.

And this is a comment by Poroshenko himself:
Signed a law that allows foreigners to serve in the ranks of the Armed Forces of Ukraine. The issue of granting Ukrainian citizenship to foreigners-defenders of Ukraine will be considered without delay. It is our duty to the patriots.
Considering the fact that the gates of the Ukrainian military units have been open for more than a year and a half before any criminals who want to get weapon for personal use, the new law, of course, will further “improve” the security of the Ukrainian state and add patriotism to the country ...