Social Security is not earned income (such as W-2 income or self-employed income.)
The IRS calls it "taxable compensation".
The maximum IRA contributions for 2020 is $6,000, or $7,000 if you’re age 50 or older by the end of the year; or your taxable compensation for the year which ever is less.
(Taxable compensation is generally wages that you worked for - W-2 or net self-employed income minus the deductible part of the SE tax, but can include commissions, certain alimony and separate maintenance, and nontaxable combat pay ).
See IRS Pub 590A "What is compensation" for details: