International Law: To what extent can citizens be punished for the acts of their government?

Obviously, in the past, there have been incidents where civilians have been killed in war. Also, in the past, some countries have sent “enemy nationals” to concentration camps during wartime.

Nowadays, under current international law, to what extent is it possible to punish civilian citizens for the acts of their government?

E.g. if North Korea commits some violation of international law, could the US start imprisoning North Koreans present in the US?

Perhaps not quite on point, but what about the international boycott of athletes from South Africa during the apartheid period (eg: Zola Budd)? Seems like punishing individuals for the actions of their government, albeit not by imprisonment or other direct governmental action.

I would guess no, since the Fourth Geneva convention seems to address this issue:

Article 33:

Article 34:

The US imprisoned “Japanese” (scare quotes because they included anyone–including natural born Americans by any definition–of Japanese ancestry) during WWII. They also confiscated and never returned their property.

Countries can ban entry by persons of a certain nationality, correct? If the US decided to prohibit entry by anyone from Iran, that would certainly amount to punishing civilians because of their government.

I think the State Department is even required by law to stop granting visas to citizens of countries that don’t cooperate when the US tries to deport their citizens.