On November 3, 2021, President Joe Biden nominated Rubin to serve as a United States district judge of the United States District Court for the District of Maryland. Biden nominated Rubin to the seat being vacated by Judge Ellen Lipton Hollander, who will assume senior status upon confirmation of a successor. On December 15, 2021, a hearing on her nomination was held before the Senate Judiciary Committee. On January 3, 2022, her nomination was returned to the President under Rule XXXI, Paragraph 6 of the United States Senate; she was renominated the same day. On January 20, 2022, her nomination was reported out of committee by a 13–9 vote. On March 16, 2022, the Senate invoked cloture on her nomination by a 52–45 vote. On March 23, 2022, her nomination was confirmed by a 51–46 vote. She received her judicial commission on March 30, 2022. She was sworn in on April 6, 2022.
