There are many opportunities to confess sin in public. The most effective is the “don’t do what I did” confession explaining the real consequences of one’s sin in counseling another. There are consequences within you always whether you are self aware or not; even beyond what society deals out if you are caught.
The rules of God are to keep one healthy and sane and on a larger scale, society the same. It’s better than whispering secrets to the Priest or even like minded congregations.
Or as one church elder I know says: Confession is good for your soul and bad for your reputation.