简体   繁体   中英

ASP.NET Web.Config referencing config file outside web root

I'm having a dispute over a web config layout from a security point of view.

Our app.config is including a key which references two files containing the security settings (db name, password, AD root, a valid user and password to authenticate against, etc). Those two files are outside the web root, and plain text. Somehow i feel that's plainly wrong. That's what web.config is for, to hold configs, and since it can be encrypted, and IIS would never serve a .config file, it should be safe enough.

Is it really a bad practice? Can anyone point me in the right direction? thanks in advance.

Best practice is to keep any security settings in web.config file and access them in your code behind. Besides you can encrypt and transform your config security settings in web.config as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM