Generally speaking (not specific to OpnSense, @Vilhonator pointed to the OpnSense specific configuration manual entry) - when you're running public-facing services, you want to also take in consideration what's leaving your server (as a best rule practice, and part of the defense in depth strategy). Sometimes and for specific scenarios, a drop-all on both ingress and egress sides (while allowing only necessary inbound and outbound connections) is the best strategy, although it takes time and patience to configure correctly (and even so it might not protect you against data exfiltration via not blocked protocols, such as DNS). If you have an exposed web service, perhaps a waf of some sort (modsecurity, coraza, or the more expensive commercial ones) would help in addition to a firewall.
"