Electrical problem

We have a 1998 Subaru Outback. Just now as we started up the car we heard the auto locks on it lock for no reason. Then we started the car but a clicking started. It is intermittent, sometimes clicking sometimes not. No pattern to it. We disconneted the battery, thought that might reset something but it didn’t work. Seems to be coming from a black box that is at the firewall. Any ideas? Thanks schucks123