↓ Skip to main content

Articles

Decentralised Data Management

Decentralised Data Management

·1 min
 (Avoid shared databases). When multiple services consume a shared data schema, it can create tight coupling at the data layer. To avoid tight coupling, each service should have its data access logic and separate data store. The development team is free to pick the data persistence method which best fit each service and nature of data.
Microservices Best Practices

Microservices Best Practices

·3 mins
API Gateway API Gateway acts as a single entry point for all clients with a more critical role as an edge service for exposing microservices to the outside world as managed APIs. It sounds like a reverse proxy, but also has additional responsibilities like simple load-balancing, authentication & authorization, failure handling, auditing, protocol translations, and routing. There are several ways in which the API Gateway can be deployed from a development perspective.
Microservices

Microservices

·4 mins
Microservices is a trending topic among software engineers today, why is this? In this post, I’ll endeavour to take the mystery and explain things in plain English so you can build genuinely modular, business agile IT systems with Microservices architectural style.
Docker – Basic Concepts, Components and Advantages

Docker – Basic Concepts, Components and Advantages

·10 mins
Docker’s containers allow for the immense economy of scale and have made development scalable, while at the same time keeping the process user-friendly. Let’s get to work and see what it is all about, we’ll go over the following:
Docker Containers

Docker Containers

·4 mins
What is Docker? It is a hot topic in cloud computing, one that people are finding ample job opportunities with skills in it. But what is Docker used for? What is Docker? Docker is an open-source technology used mostly for developing, shipping and running applications. With it, you can isolate applications from their underlying infrastructure so that software delivery is faster than ever. Docker’s main benefit is to package applications in “containers,” so they’re portable for any system running the Linux operating system (OS) or Windows OS. Though container technology has been around for a while, the hype around Docker’s approach to containers has moved this approach to the mainstream as one of the most popular forms of container technology. 
High-performance JSON API

High-performance JSON API

·2 mins
Raw System.Text.Json .NET Core 3.0, has shipped with the new System.Text.Json APIs, which provides built-in support for JSON, including reader/writer, read-only DOM, and serializer/deserializer. With the performance, the main improvement to the methods, check and see the typical speedups of up to 2x over Json.NET.
Async Streams

Async Streams

·1 min
The new feature Async Streams in C# has removed the scalar result limitation and allows the async method to returns multiple results. This change makes the async pattern more flexible so that you can retrieve data in lazy asynchronous sequence from a database or you can download data from an asynchronous sequence that returns the data in chunks when they become available.
Cross-Site Request Forgery (CSRF)

Cross-Site Request Forgery (CSRF)

·1 min
Description It is possible to trick a user into executing potentially dangerous actions against the target site due to a lack of Cross- Site-Request-Forgery (CSRF) protections. CSRF attacks are a class of confused deputy attacks that exploit the behaviour of browsers always sending authorization cookies in requests. The target site has no secure way of verifying the request was initiated from a link on a trusted domain.
Improper Certificate Validation

Improper Certificate Validation

·1 min
Description The SSL Certificate Details provide information about the certificate associated with the HTTPS server. This information describes important attributes of the certificate and should be reviewed for the correctness of the contact information, whether it is self-signed, and how soon it will expire. The Supported Ciphers provides information about each available encryption scheme available for each of the possible SSL/TLS protocols. Recommendations The expiration date for certificates should be monitored. New certificates should be available before the expiration date in order to maintain continuity of service and avoid downtime or displaying certificate expiration errors in users’ web browsers.
Server-Side Request Forgery (SSRF)

Server-Side Request Forgery (SSRF)

·2 mins
Description “Server Side Request Forgery” (a.k.a. SSRF) is a class of web-application vulnerability in which an attacker can cause a website to access unintended server-side resources, including the unauthorized reading, writing, or execution of server resources. Web-applications designed to pass URLs (references to server accessible content) or portions thereof, from the client browser to the application server using HTTP request parameters or HTTP request headers, are at risk for Server Side Request Forgery exploitation unless they protect against it. Server-side Request Forgery (SSRF) is related to another type of vulnerability called Open Redirects in the sense that they both rely on untrusted input to reference other web-resources. Strategies for avoiding and/or fixing Server-Side Request Forgery include: Design around it: Unless there is a reason why URL information must be passed, avoid the problem entirely by implementing an alternative design. Validation: When a URL value is received by the application, it must be white-list validated against the domain of possible legitimate values and rejected if it is not a member. Indirect References: In some cases, it may be possible to pass a (cryptographically strong) random value that represents the target URL and maintain a token: URL mapping on the server. Since URLs are never passed and the tokens are (practically) un-guessable, the vulnerability is eliminated. If URI is hard-coded, then the attacker cannot influence where the request is going, so it would look to be a false positive. However, although some scanning software is known for false positives, you need to be careful, as most scanning software are correct in their analysis. You need to check the whole source-to-sink trace that scanning software provides? If it is reporting only that one line as the source and sink, then yes it is a false positive. Useful links: https://www.owasp.org/index.php/Server_Side_Request_Forgery
Improper Neutralization of CRLF Sequences in HTTP Headers

Improper Neutralization of CRLF Sequences in HTTP Headers

·1 min
Description A function call contains an HTTP response splitting flaw. Writing untrusted input into an HTTP header allows an attacker to manipulate the HTTP response rendered by the browser, leading to cache poisoning and cross-site scripting attacks. Recommendations Remove unexpected carriage returns and line feeds from untrusted data used to construct an HTTP response. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. A simple string extension can resolve this issue: public static string CRLFRemoval(this string token) { return token.Replace("%0d", string.Empty, StringComparison.InvariantCultureIgnoreCase) .Replace("%0D", string.Empty, StringComparison.InvariantCultureIgnoreCase) .Replace("\r", string.Empty) .Replace("\n", string.Empty) .Replace("%0a", string.Empty, StringComparison.InvariantCultureIgnoreCase) .Replace("%0A", string.Empty, StringComparison.InvariantCultureIgnoreCase); } Links for reference: https://en.wikipedia.org/wiki/HTTP_response_splitting https://securiteam.com/securityreviews/5WP0E2KFGK https://www.owasp.org/index.php?title=Testing_for_HTTP_Splitting/Smuggling_(OTG-INPVAL-017)
ASP.NET Core – MongoDB Repository Pattern & Unit Of Work

ASP.NET Core – MongoDB Repository Pattern & Unit Of Work

·5 mins
The implementation of generic repositories and Unit Of Work are complex tasks in MongoDB. The lack of mechanisms in the component hinders its adoption. See how to implement this article. Unit of Work Unit Of Work is a standard used to group one or more operations (usually database operations) into a single transaction or “unit of work”, so that all operations are approved or disapproved as one.
DONE – when done means DONE

DONE – when done means DONE

·1 min
When is something done? What does DONE mean? In the teams of software development, here is a definition that can apply to this process: Definition of Done The meaning of done is an agreed upon list of the activities necessary to get product increment to a production ready state.
Multi-Tenancy

Multi-Tenancy

·10 mins
What Is Multi-Tenancy? “Software Multitenancy refers to a software architecture in which a single instance of a software runs on a server and serves multiple tenants. A tenant is a group of users who share common access with specific privileges to the software instance. With a multitenant architecture, a software application is designed to provide every tenant a dedicated share of the instance including its data, configuration, user management, tenant individual functionality and non-functional properties. Multitenancy contrasts with multi-instance architectures, where separate software instances operate on behalf of different tenants” (Wikipedia)
How to export all tables to csv by one export job

How to export all tables to csv by one export job

·1 min
If you just want to export all the tables in a SQL database in to separate CSV files, then this is a quick and easy way of doing it. Execute below query which generates BCP commands SELECT ‘bcp ‘ + st.NAME + ‘ out c:\Target\’ + st.NAME + ‘.csv -c -r -d ‘ + DB_NAME() + ‘ -U user@??????.database.windows.net -S tcp:?????.database.windows.net -P ?????? FROM sys.tables st Paste the result set into text file. Make batch file and schedule it. (It can also be run in CMD manually)
The best GIT GUI

The best GIT GUI

·1 min
I have tried a number of Git GUI’s and the best by far has to the Source Tree https://www.sourcetreeapp.com/ Why? It’s just so easy to use and displays what you need when you need it.
HTTP Status Codes

HTTP Status Codes

·2 mins
It is important that when writing RESTful API’s that the correct HTTP status code is returned, the best and only source of reference has to be: https://httpstatuses.com/ 1×× Informational 100 Continue 101 Switching Protocols 102 Processing 2×× Success 200 OK 201 Created 202 Accepted 203 Non-authoritative Information 204 No Content 205 Reset Content 206 Partial Content 207 Multi-Status 208 Already Reported 226 IM Used 3×× Redirection 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 305 Use Proxy 307 Temporary Redirect 308 Permanent Redirect 4×× Client Error 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 Request-URI Too Long 415 Unsupported Media Type 416 Requested Range Not Satisfiable 417 Expectation Failed 418 I’m a teapot 421 Misdirected Request 422 Unprocessable Entity 423 Locked 424 Failed Dependency 426 Upgrade Required 428 Precondition Required 429 Too Many Requests 431 Request Header Fields Too Large 444 Connection Closed Without Response 451 Unavailable For Legal Reasons 499 Client Closed Request 5×× Server Error 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported 506 Variant Also Negotiates 507 Insufficient Storage 508 Loop Detected 510 Not Extended 511 Network Authentication Required 599 Network Connect Timeout Error