Aluminum Gas Line Through Masonry (Gas Fire Place)

Recently bought a home, and there is a gas fireplace. The fireplace is fed by a rigid aluminum line that runs through cinder block at the back of the fire box. HVAC tech said he wasn’t sure this was right or not… so here we are.
Is this acceptable? Should it be switched to the yellow flex pipe? Black iron pipe? Something else that I’m not thinking of?
Any thoughts would be welcome!
Thanks!!