Yes! You can create security groups for your instances.
Using security groups, you can create stateless or stateful rules dropping or allowing incoming traffic from specific sources. You can then create your private infrastructure by disabling the public IPs of your servers. To create security groups, refer to our official documentation.
Important: If you create a stateful security group, it cannot be attached to a bare-metal server. In addition, if you already have a stateless security group attached to a bare-metal server, you will get an error while trying to switch that security group to stateful.