مطالب
لینک‌های هفته‌ی اول بهمن

وبلاگ‌ها ، سایت‌ها و مقالات ایرانی (داخل و خارج از ایران)

Visual Studio


ASP. Net


طراحی و توسعه وب


اس‌کیوال سرور


سی شارپ


عمومی دات نت


ویندوز


مسایل اجتماعی و انسانی برنامه نویسی


متفرقه

اشتراک‌ها
دقیقا چه اتفاقی برای Parler رخ داد؟

Parler relied on several external services for security; but when those services were yanked away (due to Parler hosting neo-nazi and insurrectionist content), their code took the absence of such services as a reason to approve whatever action the user was trying to take. It’s the equivalent of your house security system letting everyone in if the phone-line goes down. There’s so much more to the Parler hack, from the lack of rate-limiting to the ability for people to pull down 60-70TBs of information from Parler’s AWS hosted storage, which — to add insult to injury, results in a massive egress bill from AWS to Parler, on top of AWS no longer hosting Parler. 

دقیقا چه اتفاقی برای Parler رخ داد؟
اشتراک‌ها
gRPC + ASP.NET Core به عنوان جایگزینی برای WCF در NET Core.

gRPC + ASP.NET Core as a Migration Path for WCFs in .NET Core 

Feature WCF ASP.Net Core + gRPC
Platforms Windows Windows, Linux, MacOS
Protocols LRPC/Named Pipes/HTTP/TCP/MSMQ Binary (GRPC) + HTTP2

(TCP/Named Pipes/LRPC)

.AddProtocol(“ncacn_ip_tcp”, “8080”)

.AddProtocol(“ncacn_np”, @”\pipe\MyService”)

.AddProtocol(“ncalrpc”, “MyService”)

By removing the ASP.NET Core stack and just using .NET Core

Injected Aspects Behaviors ASP.NET Core DI Middleware/ gRPC interceptors
Distributed Transactions *Yes – [TransactionFlow], transactionscopes, and supported bindings *No
Transport Security SSL/TLS SSL/TLS
Message Security Certificates/credentials Certificates/credentials

https://docs.microsoft.com/en-us/aspnet/core/grpc/authn-and-authz?view=aspnetcore-3.0

Windows Authentication Kerberos/NTLM AAD Sync/ASFS + ASP.NET Core middleware
Proxies/Contracts Service Contracts/Data Contracts Protocol Buffers
Proxy-less Communication WCF Channel Factory † Protobuf-Net.GRPC
gRPC + ASP.NET Core به عنوان جایگزینی برای WCF در NET Core.
اشتراک‌ها
معرفی اعتبارسنجی بدون پسورد استاندارد WebAuthn

For decades, passwords have been the common backbone (headache) of authentication and are well known to lack in security while being frustrating and difficult to use. As we continue to see daily data breaches, the reality of moving away from weak static credentials and killing the password is upon us. Join this session to learn how FIDO2 and WebAuthn open authentication standards, in conjunction with YubiKeys, are solving the elimination of passwords at scale. Hear how organizations like Microsoft have implemented these standards for a true passwordless experience and find out how your organization can follow suit. You'll gain a greater understanding of how to achieve a modern and flexible security architecture through the use of FIDO open standards and hardware authenticators. 

معرفی اعتبارسنجی بدون پسورد استاندارد WebAuthn
اشتراک‌ها
Visual Studio 2019 version 16.0.4 منتشر شد

Issues fixed in Visual Studio 2019 version 16.0.4

Security Advisory Notices

CVE-2019-0727 Diagnostics Hub Standard Collector Service Elevation of Privilege Vulnerability

An elevation of privilege vulnerability exists when the Diagnostics Hub Standard Collector Service improperly performs certain file operations. An attacker who successfully exploited this vulnerability could delete files in arbitrary locations. To exploit this vulnerability, an attacker would require unprivileged access to a vulnerable system. The security update addresses the vulnerability by securing locations the Diagnostics Hub Standard Collector performs file operations in. 

Visual Studio 2019 version 16.0.4 منتشر شد
اشتراک‌ها
1.Visual Studio 2017 15.7 منتشر شد

These are the customer-reported issues addressed in 15.7.1:

  • This release includes a fix that reduces memory usage and GC pressure during solution load.

Microsoft Security Advisory for .NET Core Denial Of Service Vulnerability

CVE-2018-0765

Microsoft is releasing this security advisory to provide information about a vulnerability in .NET Core and .NET native version 2.0. This advisory also provides guidance on what developers can do to update their applications to remove this vulnerability.

Microsoft is aware of a denial of service vulnerability that exists when .NET Framework and .NET Core improperly process XML documents. An attacker who successfully exploited this vulnerability could cause a denial of service against a .NET Framework, .NET Core, or .NET native application.

The update addresses the vulnerability by correcting how .NET Framework, .NET Core, and .NET native applications handle XML document processing.

If your application is an ASP.NET Core application, developers are also advised to update to ASP.NET Core 2.0.8. 

1.Visual Studio 2017 15.7 منتشر شد
نظرات مطالب
تولید هدرهای Content Security Policy توسط ASP.NET Core برای برنامه‌های Angular
یک نکته‌ی تکمیلی: دات نت 6 و hot reload آن

اگر برنامه‌های مبتنی بر دات نت 6 را به همراه فعال بودن Content Security Policy اجرا کنید، با خطای زیر در مرورگر مواجه خواهید شد:
Refused to connect to ws: because it violates the Content Security Policy directive
{
   "csp-report":{
      "document-uri":"http://localhost:5051/",
      "referrer":"",
      "violated-directive":"connect-src",
      "effective-directive":"connect-src",
      "original-policy":"default-src 'self' blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' ; font-src 'self'; img-src 'self' data: blob:; connect-src 'self'; media-src 'self'; object-src 'self' blob:; report-uri /api/CspReport/Log",
      "disposition":"enforce",
      "blocked-uri":"wss://localhost:52837",
      "line-number":234,
      "column-number":25,
      "source-file":"http://localhost:5051/_framework/aspnetcore-browser-refresh.js",
      "status-code":200,
      "script-sample":""
   }
}
برای رفع آن فقط کافی است تنظیم زیر را اضافه/ویرایش کنید:
connect-src 'self' wss://localhost:*
پاسخ به بازخورد‌های پروژه‌ها
مشکل در هدایت کاربر به صفحه لاگین
بهتر بود قبل ارسال بازخورد ، سرچ میزدم . ولی خب خالی از لطف نخواهد بود نتیجه به دست آمده .
برخلاف تصور بنده ، برای خود فریمورک همچین موردی را نیز در نظر گرفته اند . چند تاپیک را در این مورد مطالعه کردم  که یکی از آنها این تاپیک  است.راه حل به این صورت است :
 app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            LoginPath = new PathString("/Account/Login"),
            Provider = new CookieAuthenticationProvider
            {
                // Enables the application to validate the security stamp when the user logs in.
                // This is a security feature which is used when you change a password or add an external login to your account.  
                OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
                    validateInterval: TimeSpan.FromSeconds(0),
                    regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
            }
        });
در اینجا با تنظیم validateInterval با مقدار 0 ، لذا در هر درخواست SecurityStamp موجود در رکورد مربوط به کاربر در دیتابیس با مقدار ذخیره شده در کوکی او مقایسه میشود اگر تغییر نکرده باشد بازهم کوکی رفرش شده و ادامه ماجرا.. ولی اگر SecurityStamp موجود در دیتابیس تغییر کرده باشد  و با مقدار ذخیره شده در کوکی همخوانی نداشته باشد، کاربر LogOut شده و لازم است دوباره لاگین کند.
برای زمان بن کردن کاربر هم با فراخوانی متد 
await UserManager.UpdateSecurityStampAsync(userId);
میتوان دستی SecurityStamp مربوط به کاربر را ویرایش کرد تا هنگام مقایسه با مقدار موجود در کوکی به تناقض برسد و در نتیجه کاربر LogOut خواهد شد.
البته بازهم مشکل رفع نشده است!
اشتراک‌ها
تامین هویت مرکزی به کمک keycloak در برنامه‌های Web API
.NET Web API with Keycloak

In this article, we will explore the advantages of using Keycloak, an open-source identity and access management solution. With Keycloak, you can easily add authentication and authorization to your applications, benefiting from the robustness of a proven system instead of building your own. This allows you to avoid the complexities and security challenges of managing application access control on your own.
تامین هویت مرکزی به کمک keycloak در برنامه‌های Web API
اشتراک‌ها
سری 44 قسمتی بررسی مفاهیم طراحی سیستم‌ها

System Design Interview Questions
44 videos


Learn the key concepts and questions used in system design interview for software professionals. Like - Scalability, Caching, ACID properties, Partitioning, BASE Model, HTTPS, NoSQL databases, Security concerns etc. What is resiliency in software architecture?
What is language agnostic? What is the difference between vertical scaling and horizontal scaling? What is CAP theorem? How will you implement the optimistic locking? What are the different types of NoSQL databases? 

سری 44 قسمتی بررسی مفاهیم طراحی سیستم‌ها