For this reason, experts like Schneier [1] have long advocated that the NSA be broken up so that these two missions do not fall under the same agency.
[1] https://www.schneier.com/blog/archives/2014/02/breaking_up_t...
Responsibility (issue advisories) for unclassified, commercial, non-defense internet is a confusing mess split between Commerce (NIST, https://csrc.nist.gov/about), DHS (CISA, https://www.cisa.gov/cybersecurity), Energy (CESER, https://www.energy.gov/ceser/cybersecurity if it is related to energy infrastructure), etc.
Throw in other agencies like DISA (https://disa.mil/About/Our-Work) as appropriate.
NSA's defensive mission is about securing National Security Systems. These have a fairly specific definition, and are not running in the average business.