And because of people like you, only trusted individuals at the national security agency will be allowed to develop browsers. They will provide statically liked binarys to licensed internet users.
After way too many meetings, they'll decide that in order to prevent people from reading the application binary (which obviously contains the address or every government employee in plain text), the user must boot into a secure bespoke operating system that will just be a vnc client to a VM which only has the application running without any desktop environment or any way to launch a terminal
I guess we have to get rid of anything that reads HTTP responses, the only devices we can keep are the ones where the sole purpose of connecting to the internet is to send analytics
I spent yesterday putting 3 different controllers that did basically the same thing into a single controller so it's organized and significantly more efficient. If I do that, I should absolutely fix this.
Imagine customer asking to change password feature. Now you gotta recompile program each time user decides to change their password (or better download source code to user device and compile it there then swap with original executable).
Class, actually, and it is. I haven't fixed it. I was planning on asking my instructor how to fix that because it's crap and I don't actually know. Do you have any links I can check out, because it's been like this all semester and I keep forgetting about it.
Then if you can change it in your deployment by adding an environment variable, in this case it would be ConnectionStrings__DefaultConnection with the connection string for your deployment's database.
If you want to store secrets, there is a dotnet tool called user-secrets. It's like appsettings, but it's only kept on your local machine, so it won't be present in your VCS. (reference)
Edit: reference for the order of the configuration
Not generally an issue, as someone with access to the directory containing the app settings already has access to the server.
There are other options, however.
Many companies choose to use integrated credentials so the connection is authicated as the user the application is running as, that prevents the need to store credentials in a file. This is probably my favorite in terms of security, but it can make user account management and testing a bit of a bitch.
You can also store the password in the credential manager on Windows. I do that for most of my deployment applications.
Alternatively you can lock the app settings file down so that it's only accessible to the application user, and anyone who needs to edit it.
I suppose if you really wanted to, you could also store the password in the registry and lock that down to the application user as well. Technically the same security as having it sit on disk, just not as obvious where it's stored.
Don't use XML. It's a horrible language for config files. YAML or JSON, or even a simple INI file. Though, for a file that just needs to store a password, you could use htpasswd with bcrypt and a suitable work factor.
Another option would be reading configs from environment with addition of .env file support. So secrets could be more easily injected in containerized environments.
And here my employer (1/2 billion $ revenue) is committing all their api keys, service secrets, DB connection strings...etc for test & prod, into source control...
And literally no one besides me seems to care.
Consequentially, everyone with access to source control also has full access to the prod DBs.
"The database is behind a VPN"
:|
It's full connection string (And for every other piece of software infrastructure or 3rd party service) is on every devs device, past & present.
It should be noted that there is text after each = symbol, but it is covered by blue scribbles. Peaking through the scribbles, one can see a quotation mark and a semicolon in the usual spots for declaring a string
somewhere I used to work, we had powershell files with username and password in cleartext (don't remember what the scripts did)
I was told not to put the files on the desktop of the server it was running on, but apparently anywhere else was fine
so I guess we just secured the login from any "hacker" who opened an RDP to this server who is also too lazy to check any files that aren't on the desktop
446
u/CopperyMarrow15 Dec 01 '21
yeah but it's
privateso no one can hack it :)42
u/[deleted] Dec 02 '21
Open committed file in Github>show blame>look for line>read name>fire right away lol
14
u/wholl0p Dec 02 '21
No one is ever going to fix the nonsense
53
u/[deleted] Dec 02 '21
Imagine customer asking to change password feature. Now you gotta recompile program each time user decides to change their password (or better download source code to user device and compile it there then swap with original executable).
135
u/novemberdobby Dec 01 '21
91
u/Lonemasterinoes Dec 01 '21
"Now, we shall both surely fix this", the intern said.
"lol", said the developer. "plz".
25
u/Cloakknight Dec 02 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
7
u/Si3rr4 Dec 02 '21
Oh I think this is my legacy actually
6
u/g_hi3 Dec 02 '21
somewhere I used to work, we had powershell files with username and password in cleartext (don't remember what the scripts did)
I was told not to put the files on the desktop of the server it was running on, but apparently anywhere else was fine
so I guess we just secured the login from any "hacker" who opened an RDP to this server who is also too lazy to check any files that aren't on the desktop
5
u/Player_X_YT Dec 02 '21
// TODO and then you can ignore the TODOs in eclipse on porpuse instead of by accident
3
u/[deleted] Dec 02 '21
You fixed it when you drew the lines through it
3
u/BenderBendingU22 Dec 02 '21
To be fair, that does look like a secure password :)
2
u/xdjiijii Dec 02 '21
Got the same at work but for production database. Nobody bothers with some config file, naahhh that's too hip. Plain text is the only solution.
3
u/timleg002 Dec 02 '21
Most intelligent asp.net programmer
-6
u/Knuffya Dec 02 '21
As long as it's a private file i think it's kinda ok