问题
I am new to cloud computing. Sorry if this is a silly question. I have created a VM from azure portal. My requirement is not to allow the user using the VM to access public website. Can anyone help me how to achieve this functionality?
Thanks
回答1:
You probably have a Network Security Group that was created when you created the VM. In there you can specify rules for inbound and outbound data traffic.
Find the NSG and add a rule that blocks all outbound traffic from the VM. You should still be able to connect to the VM, it just can't connect anywhere. You can also make the rule only block traffic bound to the internet if you still wish for it to have access to other machines in the same virtual network.
Network Security Groups documentation: https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-nsg
回答2:
My requirement is not to allow the user using the VM to access public website.
According to your description, you just want user can't access the public website, as we know website common listen on 80 and 443, so we can add outbound rules to deny port 443, 80 and port 8080 to achieve this functionality.
I deny port 80, 443 and 8080, then my VM can't access https://google.com and http://google.com.
Update:
来源:https://stackoverflow.com/questions/44357371/how-to-restrict-access-to-some-public-websites