I’m out of room for breakers in my main breaker box, so would like to add 6-breaker sub-panel to install mini-splits, an outdoor electrical outlet, lighting, etc. What’s the correct way to mount an exterior sub-panel on a house with lapped hardie-board siding?

I suppose the easiest thing would be to drill holes in the siding then attach the panel with screws to a stud and the exterior sheathing, but I don’t know if that’s a proper way to do things.

I also suppose I could somehow cut a rectangular hole in the siding and mount the subpanel directly on the sheathing. I’m not sure how to prevent water intrusion in that case (is some kind of flashing needed, or is just cock ok?). Seems like it would be hard to cut a clean rectangle in lapped fiber-cement siding on a vertical surface.