Тёмный
No video :(

How To Keep SECRET Strings REALLY SECRET in ASP.NET Core? 

Codewrinkles
Подписаться 27 тыс.
Просмотров 9 тыс.
50% 1

Опубликовано:

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@3rd_Century
@3rd_Century Год назад
Thank you Dan. On a side note. If you right mouse click on the project file, from the menu you can select "Manage User Secrets". Another way besides the command line. This is in VS 2022.
@Codewrinkles
@Codewrinkles Год назад
Thanks for the tip. I'll look if it's also available in Rider. I haven't noticed it.
@danielegiovanetti9258
@danielegiovanetti9258 Год назад
This is the information I need. Special thanks Dan. As always super clear explanation.
@Codewrinkles
@Codewrinkles Год назад
Glad it was helpful!
@MarllonVilano
@MarllonVilano Год назад
Thanks for providing exactly the knowledge I needed. I'm gonna combine this with Gitlab environment variables when deploying the application.
@Codewrinkles
@Codewrinkles Год назад
Glad it was helpful!
@xelaksal6690
@xelaksal6690 Год назад
Thanks for clear explanation and good examples!
@Codewrinkles
@Codewrinkles Год назад
Glad it was helpful!
@zephycz3537
@zephycz3537 Год назад
Very useful video, thanks 😉👍 . I got error "Could not find the global property 'UserSecretsId' in MSBuild project ...", but helped me call "dotnet user-secrets init" before calling " dotnet user-secrets set ...", then all was ok 🙂 .
@muradhossen2347
@muradhossen2347 Год назад
Thank you for teaching me something new.
@Codewrinkles
@Codewrinkles Год назад
My pleasure 😊
@doogiehowser1124
@doogiehowser1124 2 месяца назад
thanks for the video but i think there is a better way to encrypt/hide connection strings. Why use some other package like codewrinkles?
@erinh0201
@erinh0201 9 месяцев назад
Hi! Did you ever create a video that shows how to store keys in environment variables for production on an on-prem windows server? I know how to create the variables in Windows and deploy the app to IIS, but I would like to see a quick example in the .net core code of how to get it to reference those local environment variables. For instance, is there something we need to add to the program or something so that it knows to look in the local environmental variables? Thanks!
@renatoloefstop
@renatoloefstop 7 месяцев назад
me too!
@emllik2155
@emllik2155 4 месяца назад
For anyone still wondering about this, here's one way you can do it: Environment.SetEnvironmentVariable("DefaultConnection", "connection string value"); string connString = Environment.GetEnvironmentVariable("DefaultConnection"); This way the environment variable exists only for the duration of the running application process. You can just put this inside Program.cs if you like.
@booby163
@booby163 Год назад
I got this problem when hitting the controller "System.InvalidOperationException: The ConnectionString property has not been initialized."
@booby163
@booby163 Год назад
i just fixed, i was using docker lol i didnt realize docker doesn't have secrets.json its just a local file, god XD
@MihaiMoisei
@MihaiMoisei Год назад
Like always very good content, Thanks.
@Codewrinkles
@Codewrinkles Год назад
Thanks again!
@Pedro-il8kx
@Pedro-il8kx Год назад
Excellent, as always
@Codewrinkles
@Codewrinkles Год назад
Thanks for watching
@coding-gemini
@coding-gemini Год назад
wow good to know something new, So if the app in on prem and there's no CI/CD how do we switch between the user secrets based on environment ?
@dfcw
@dfcw 9 месяцев назад
You know how he uses "dev" to get the connection string. That "dev" could be a value stored in your appsettings.json per enviroment. i.e, different secrets for different enviroments.
@ayhamala3ma189
@ayhamala3ma189 Год назад
thanks so much
@Codewrinkles
@Codewrinkles Год назад
You're welcome!
@49riddickful
@49riddickful Год назад
Normally one can use the AzureKeyVault to store the connection strings etc. when deploying your application. Is that correct?
@Codewrinkles
@Codewrinkles Год назад
Yes, Azure Key Vault would be a go-to. There are other products/services that one could use, like Hashicorp.
@RoyZASTEROiD
@RoyZASTEROiD Год назад
big thanks
@Codewrinkles
@Codewrinkles Год назад
You're welcome!
@dharwal87
@dharwal87 Год назад
Environment variables and user secrets are not best practice for production. You should go for azure key vault.
@societysvillain
@societysvillain Год назад
Assuming the shop is running on Azure and not on-prem or something sure.
@dharwal87
@dharwal87 Год назад
@@societysvillain you can use key vault even if your app is not in azure. If you don't want to use azure key vault its better to use encrypted secrets in your config.
@Barto2You
@Barto2You Год назад
@@dharwal87 The encrypted secret should also be decrypted in your application. so if you don't want to use an env variable for storing your key for the decryption where do your store that key?
@dharwal87
@dharwal87 Год назад
@@Barto2You It is always recommended to use certificate-based encryption and decryption. During deployment, the certificate's public key is used to encrypt the configuration values, and then the application loads the certificate and uses its private key to decrypt them. The certificate should be installed on your web server and password-protected.
@Barto2You
@Barto2You Год назад
​@@dharwal87 thx, do you know perhaps a good example on the internet of how to achieve this?
Далее
.NET 7 Conditional Service Registration
0:44
Просмотров 3,5 тыс.
When I met the most famous Cristiano
01:03
Просмотров 21 млн
Coding Shorts: Stop Leaking Secrets in ASP.NET Core
14:19
Don't Use AutoMapper in C#! Do THIS Instead!
16:17
Просмотров 67 тыс.
Move appSettings.json values to User Secrets
19:03
Просмотров 1,9 тыс.
Don't throw exceptions in C#. Do this instead
18:13
Просмотров 256 тыс.
I've been using Redis wrong this whole time...
20:53
Просмотров 353 тыс.
How He Got $600,000 Data Engineer Job
19:08
Просмотров 24 тыс.