Using a pi camera module with HA (on same rpi)

is there any software that would allow me to connect a pi camera to my RPI 3 or 4 and record video on an attached usb ssd drive or the Micro sdcard?

Yes, but it does depend in part on how you installed Home Assistant.

If you’re using Raspbian or Hassbian then you’ve got the Motion project

I use the RPi-Cam-Web-Interface, but with it’s own pi zero.
Works without issues, with a proper power supply.