Security Considerations with Blazor/MAUI

by | Aug 12, 2022 | Blog, Dev Team

Security and privacy are major concerns for any organization and are likely to present an issue for many developers moving from older technology to .NET 6+. This is because the user experience is going to be rendered on a client device which may be insecure or compromised. Developers need to be very careful to send the minimum amount of data required by the user to complete the task in hand to the client. In older applications, there is frequently a lot of additional data sent to the user experience to support workflow and form building that wouldn’t be secure on a client device. In this blog, we summarize some of the key architectural decisions we made in building our trellispark platform with .NET 6 Blazor WASM client.

The trellispark user experience components are referred to as the “Dynamic Page Builder” which is split into both server-side and client-side components.

Server-Side Component (REST API)

The server-side component can access the underlying data system of record and determine the minimum user experience required to securely support each request. This includes:

  • Ensuring that the user actually has access granted to the specific records on a row by row basis.
  • That the record’s current state and the user’s assigned roles are taken into account when considering which fields should be displayed/enabled and which functionality should be available.
  • That any additional custom business rules can also be applied to further restrict available fields and functionality.
  • Each request made to the REST API will contain a Session/User GUID pair that must be authenticated on each request. This will ensure that any user experience will only ever have access to the records that can be seen by the user and only with that user’s permissions.
  • Funneling all requests through a single REST API makes it easy to apply auditing and other forms of API Management across all requests.
  • The REST API also makes it harder to penetrate the security around the data repositories reducing the vulnerability to ransomware threats.
  • The REST API is shared by all client-side components ensuring that a consistent set of security and privacy controls are implemented.

Overall this means that only the required data will ever be sent to the client improving security and privacy. It also means that all incoming data can be validated and checked to reduce the risk of compromising the organizations’ data repositories.

The trellispark REST API minimizes the required server infrastructure footprint and is shared by all client devices promoting best practices and enforcing standards.

Client-Side Components (Blazor, Blazor/MAUI Hybrid, MAUI)

The client-side components can be focused on rendering a responsive user experience on whatever device is being used. Different client-side components can be created for each type of supported client which makes best use of the device’s capabilities and features.

Since only the minimum data is being sent to the client device, the security of the user experience is significantly enhanced (even if the device has been hacked). There is never a need to send any secret/connection information to the client other than the address of the server-side component REST API used to access the back end data storage and workflow.

If a client device were to be compromised, simply removing the Session/User GUID from the list of active sessions would immediately disable all access from the device to the organization’s data.

Applying API Management to the service-side component REST API could automatically detect anomalous usage patterns and shut down further requests from suspect clients.

Our trellispark platform has been designed from the ground up to meet the most stringent security and privacy requirements of modern business applications. Using a component based design over a Data Agnostic Services architecture means that it is easy to redevelop and swap out user experience components as new technologies, services, threats or business requirements evolve. It is no longer necessary to rebuild your software applications to improve the security of your user experience.