WASHINGTON (AP) — President Barack Obama will propose new legislation Tuesday aimed at fostering increased sharing between government agencies and the private sector to help improve cybersecurity.

The legislation would encourage the private sector to share cyber threat information with the Department of Homeland Security’s National Cybersecurity and Communications Integration Center, according to a White House fact sheet. Companies would qualify for targeted liability protection, but would have to comply with certain privacy restrictions.

Sen. John McCain, chairman of the Senate Armed Service panel and a member of the Homeland Security and Governmental Affairs committee, said Tuesday he was “glad the administration is coming forward with a proposal.” Legislation will need to strike a balance between “the right of privacy and the need for national security,” the Arizona Republican told CNN.

But, he added, “I am guardedly optimistic we can come up with legislation that we can work with the administration on.”

Tuesday’s push comes after the Twitter and YouTube accounts for U.S. Central Command were taken over by hackers who claimed to be working on behalf of Islamic State militants on Monday, and in the wake of last month’s hacking at Sony Pictures Entertainment, which the White House blamed on North Korea. Other recent hackings at retailers including Target, Home Depot and Neiman Marcus have exposed the lack of uniform practices for alerting customers in the event of a breach.

Obama will give a speech Tuesday afternoon at the National Cybersecurity and Communications Integration Center in Arlington, Virginia.

On Monday, Obama proposed strengthening laws against identity theft by requiring notification when consumer information is hacked and protecting students’ private data.

The White House will host a Summit on Cybersecurity and Consumer Protection at Stanford University on February 13.