There's a big list of allowed Internet activity between the US and Iran.[2] It is explicitly US policy to not cut off Iran from the Internet. The State Department wants people in Iran to get info from the outside world. However, the US does not allow US domain registrations or web hosting "for or on behalf of the Government of Iran".
The Office of Foreign Assets Control can be queried for case by case info. That's appropriate here.
[1] https://www.ecfr.gov/current/title-31/subtitle-B/chapter-V/p...
[2] https://www.ecfr.gov/current/title-31/subtitle-B/chapter-V/p...
They should interpret the law to mean "We will treat every request from Iran as a non-paying customer, and won't offer anything outside the free-tier"
Even if that isn't the way was written, it is plain that it falls within the intent of the law, and is beneficial to US businesses.
You de-risk your enterprise significantly by cutting Iran out completely, and you only lose the handful of dollars this would’ve translated into down the road.
Some customers aren’t worth having.
I would argue that for unpaid services (for example serving up web content), we should not be applying sanctions. Those specific sanctions are so easy for the iranians to work around (VPN), and so damaging to our businesses (no worldwide service).
No judge will send a google employee to prison because someone located in Iran managed to download a copy of the docker image to Alpine Linux from the google/amazon container registry...
You never know such things when you are in US though...
How do you know that if the only thing you see on the receiving side is an IP address, which is marked as Iranian?
As a company, this means BSTS (better safe than sorry) CYA (cover your ass) measures for good or worse.
Edit: it also wouldn't surprise me if hacker news blocks traffic from Iran.