Category Archives: C#

Docker cribsheet

Build

Build an image from the Dockerfile in the current directory and tag the image

docker build -t myimage -f Dockerfile .

List all images that are locally stored with the Docker Engine

docker ps -a

Delete an image from the local image store

docker image rm CONTAINER_NAME

You may want to remove all orphaned images, you can do this with dandling field

docker rmi $(docker images -f dangling=true -q)
Continue reading Docker cribsheet →

NET Microservices Architecture for Containerised NET Applications

I came across this guide as it is an introduction to developing microservices-based applications and managing them using containers. It discusses architectural design and implementation approaches using .NET Core and Docker containers. To make it easier to get started with containers and microservices, the guide focuses on a reference containerized and microservice-based application that you can explore. The sample application is available at the eShopOnContainers GitHub repo.

Continue reading NET Microservices Architecture for Containerised NET Applications →

Async Streams

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.  

Continue reading Async Streams →

Cross-Site Request Forgery (CSRF)

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.

Continue reading Cross-Site Request Forgery (CSRF) →

Improper Certificate Validation

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.