Spyderisk / domain-network

Network domain model
Apache License 2.0
1 stars 0 forks source link

More remote access inference torment #106

Open mike1813 opened 9 months ago

mike1813 commented 9 months ago

At present, when a text only remote access client (i.e., a terminal) could connect to a process that can't be run from the command line, the connection is made anyway.

This is done because the illegal connection can then be detected by a modelling error threat, giving a clear indication of the problem. If the illegal connection were not made, it may lead to a break in data flow, or a remote interactive process having no connection from a user, In either case, a different modelling error would then be found, but this will be at some distance from the unmade connection, making it very difficult to understand, let alone address.

A similar situation arises when the client is graphical (i.e., a remote desktop client), and the connection is via a login service that supports only command line/textual interactions.

The problem with this arrangement is that the illegal connection might not be asserted. For example, it may be inferred from connections to a reverse proxy. In that situation, the connection may be inadvertent. This leads to a different set of confusions. It is also possible for a connection to be inferred that is not illegal, but is unintended and may be inappropriate - and for this to create problems in the data flow inference sequence, e.g., due to this limitation.

There are lots of interesting issues raised by this situation. Some of these may merit elevation to a separate issue, in some cases for the system-modeller. For example:

Meantime, we need to resolve the situation to get the best outcome we can with minimal changes. Making major changes would not be desirable because of the complex interdependencies between this and the models used for client-service communication, authentication, and data flow inference.

mike1813 commented 9 months ago

Addressed at least for now in branch 85 by suppressing the addition of 'usesRemotely' links where:

Note that the remote access connection is not suppressed where the 'uses' relationship.

For most 'sensible' system models, this works quite well. It handles a few situations where a remote access client connects via a reverse proxy that also serves other processes, which was previously not handled at all. It handles many more situations where a proxy serves remote access clients only than was previously the case.

This will do for now.

Longer term, the simplest solution may be to introduce separate reverse proxy subclasses for specific types of clients (e.g., remote access clients, web clients, etc.). We could then add modelling errors to detect cases where a client connects to the wrong type of reverse proxy, forcing users to include different proxies for remote access and other traffic. This is similar to the current K8S model, where tha API Server subclass handles remote login, while the Ingress Proxy subclass handles user access to hosted services.

mike1813 commented 5 months ago

It may make sense to introduce further fixes for this issue on branch 107, as remote access to interactive processes does have some bearing on the model for user interactions with data (issue #107).

However, fixing these would add a lot of work, so changes to the model of proxies used for remote access can be deferred.

mike1813 commented 3 months ago

We could also have a situation where a rich client like a web browser is used to access a service providing access to a remote login service via (say) a JavaScript terminal emulator. I have seen that used in some open source firewall applications.

Should this be modelled as:

In the former case, we would be allowing a WebBrowser to act like a remote terminal or remote desktop client. In the latter case we would be allowing a user to interact with such a client via the WebBrowser process, and not directly (unless we use a pattern to add this as an inferred relationships).