It's purpose-built for that, and they even have a rackmount chassis for it, though you could design your own too. Power for the drives requires a separate power supply though.
The other option right now is the Radxa Taco (https://radxa.com/products/io-board/taco/), but availability has been scarce. I've ordered one and will hopefully test it again soon, with the CM5!
(That is, if you're wanting to go down the Pi NAS route—there are certainly other options out there!)
For some reason I thought that Radxa is about to deprecate the Taco but I might be mistaken.
The one issue I found that without a heat-sink, fan and any drives just idling on a 12V supply the board got really hot. So I have my questions about the efficiency of the board. I've been thinking about testing the power usage of it so maybe a good time to follow through on it.
Which one are you using right now? There's some brands out there that are considered really bad by the community.
https://www.amazon.de/ICY-BOX-Externes-Festplatten-Aluminium...
https://www.amazon.de/ICY-BOX-Externes-Festplatten-Aluminium...
I'm using mine as an OpenWRT router with a dual 10 Gbe ethernet card in the PCIe slot ever since I got 10 Gbit internet at home and consumer 10 Gbit routers are expensive and leave a bit to be desired