A friend of mine took a job as a "sales representative" for a company that makes microchips to be used in missiles.
Her duties were to respond to people who contacted her to ask about pricing. This meant determining who they were and what company they represented, and checking them against a list of known customers. Or, if they weren't already a known customer, verifying the existence of their company. In either case, she'd inform them of the price and then have to record the steps taken, the fact that a price was released, and the company the price was released to.
What I found slightly surreal about all this was the fact that, despite the intense paperwork requirements, there was only one price (per product). Everyone got the same price. It is not obvious to me why so much effort is devoted to maintaining the secrecy of a uniform price, especially when strangers are allowed to contact you and learn the price.
(Also of note, my friend was trained by her predecessor that, because it was so much work to verify incorporation papers, it was fine to just release the price to an unknown customer and do the verification when and if the customer actually wanted to make a purchase.)
There's no open source firmware for any of this because you're in the image processing badlands, where everything is proprietary, triply patented and only available under quintiplicately signed NDA. The closest thing would be a Raspberry Pi with the HQ camera, since the necessary blobs are made available through the RPi Foundation. In terms of image quality in low light that will be more than a full order of magnitude worse than a 230 $ 4K Dahua with an 1/1.2" IMX485 (e.g. IPC-Color4K-X/T / DH-IPC-HFW5849T1-ASE-LED). The 5442 Dahua models are even cheaper (though accordingly worse than the models with the larger sensors; these have the same pixels). Planning a good CCTV system that actually fulfills the requirements (you do want to have an idea what you want to achieve with it) is not as simple as buying a kit of four ultra-wide wifi cameras and slapping them on the outside of the house.
All consumer CCTV cameras are useless crap in comparison to these; no known exceptions.