You can translate this in an active form. AT: "God has written on their hearts what the law requires them to do" or "God has shown them what the law requires" (See: [[rc://en/ta/man/translate/figs-activepassive]])
Here "bears witness" refers to the knowledge they gain from the law that God has written in their hearts. AT: "tells them if they are disobeying or obeying God's law" (See: [[rc://en/ta/man/translate/figs-idiom]])