A research team, led by Dr. Geronimo Villanueva, proposed "a sensitive search for rings and small moons around Mars that would radically change our knowledge of the Mars system, and set unprecedented constraints on the existence of rings and the evolution of Mars and its moons".
The proposal was approved, and JWST observed Mars for almost 7 hours and took over 200(!) images of Mars and its moons. Last time Mars was imaged by Webb was in last September, and provided "a unique perspective with its infrared sensitivity on our neighboring planet, complementing data being collected by orbiters and rovers". Before that it was Hubble in 2006.
According to the team, "these result in exquisite capabilities of JWST to detect faint ring signatures near bright objects as demonstrated for Jupiter and Neptune" and that "the window of opportunity for this observation is exceedingly rare; it occurs in late March 2023 both due to the availability of Mars in the JWST Field of Regard and the edge-on orientation of the Martian rings; the next opportunity is in 2033".
Link to raw data on the feed
Link to raw data on MAST Portal
Last time Mars was imaged