As I have posted in another question (Is confessing to a priest the only way to be forgiven?Is confessing to a priest the only way to be forgiven?):
There are several Bible verses that back confession.
Jesus Christ granted the Apostles His Authority to forgive sins:
John 20:21 - Since Christ was sent to forgive sins, and he sent the Apostles out to forgive Sins.
John 20:22 - When the Lord "Breathes" on someone, a significant transformation takes place. See the reference in Genesis.
John 20:23 - Jesus says, "If you forgive the sins of any, they are forgiven. If you retain the sins of any, they are retained." In order for the apostles to exercise this gift of forgiving sins, the penitents must orally confess their sins to them because the apostles are not mind readers. The text makes this very clear.
Matt. 9:8 - Demonstrates that the Apostles can forgive. Where in Scripture is the gift of authority to forgive sins taken away from the apostles or their successors?
2 Cor. 2:10
2 Cor. 5:18
1 Tim. 2:5
Lev. 5:4-6; 19:21-22
The Necessity and Practice of Orally Confessing Sins
1 Tim. 6:12
1 John 1:9
2 Sam. 12:14
1 John 5:16-17
There is also tradition in the Early Church Fathers.
See here for more Commentary: Jesus Christ Granted the Apostles His Authority to Forgive Sins.
Since there is Scriptural evidence going all the way back to the Old Testament, confession is necessary.