Post 2013 all long gun sales are cash and carry so the state would have to have access to 4473 forms or sales invoices from FFL holders (if store bought). The state has no basis in law to do that without a legitimate law enforcement purpose...and a fishing expedition ain't one). There would be no way the state would know about face-to-face sales between individuals.
For any member of law enforcement to come to your door and start asking to see what you own, they can certainly be within the law to ask...you would not be required to give any information beyond being polite and declining to provide answers. Beyond that, they would need probable cause and a search warrant.
Gun Guy has an excellent You Tube video about this. He is in CA which unfortunately is like MD.