To my knowledge there is no law enacted by congress that dictates how SSN data is stored. Congress created the social security apparatus but day to day operations of said apparatus are in executive branch and executive branch ultimately carries the wishes of the president. So if president directs part of executive branch (DOGE) to audit another part of executive branch (social security) it's legal and works exactly as the constitution prescribed.