Ah, well, the IMO has come up with a method to do just this. All licensed mariners were required at one point to possess a TWIC card, a Transportation Workers Identification Credential. That card is issued by TSA, after completing a background check and security clearance. I have one, every licensed mariner has one. They cost the mariner $135 every 5 years. Readers are made for these TWICs, they are a chip encoded card, just like a chip credit card. The reader may be at the facility gate, it may be at the entrance to the engineroom, it may be at the gangway to the ship, it may be at the turnstile between the parking lot and the pier. It just depends on where in the IMO you fall where security is required. On SOLAS vessels, there is a TWIC reader on the door to the wheelhouse and the door to the engineering spaces.
At one time, not long after 9/11, all US passenger boats were going to have TWIC readers installed. Then the lobbying firms got involved, and now the only place a TWIC card is required in getting into a port where foreign-flagged ships dock.
But, the system is there and available for a watchman to insert his TWIC card every time (s)he makes rounds and a record is kept of what spaces were checked.
But it costs money.