Moscow-based Kaspersky Lab has denied that it works with Russia or any government to facilitate cyber espionage. WASHINGTON—President Biden’s Commerce Department is weighing an enforcement action under its online-security rules against Kaspersky Lab, a Russian cybersecurity company that has long faced accusations of posing a threat to the U.S., according to people familiar with the matter. The action—if it materializes—could become a test case for the Commerce Department’s growing role in policing threats online, according to some of the people, who said the U.S. might deploy the same online-security rules against Chinese-controlled technologies, possibly including TikTok.