Output filter¶
Name¶
Output filter
Summary¶
Before providing data to an entity, e.g. as a response to a query, the system filters any data to which the receiving entity should not have access. For example, records containing sensitive information may be removed from the response if an unprivileged entity performed requested the query.
Parent¶
None
Problem¶
Solution¶
The solution proposed here essentially consists of removing all data elements that an entity does not need or should not have access to before they are transmitted. For example, instead of serialising and transmitting an object as a whole one extracts only the features the entity, e.g. a client application, actually needs. Which elements are exactly is filtered and which not is highly application dependent and is defined using one or more policies.
Note that the system can perform further operations on the filtered data before transmission. But in such cases care should be taken not to reintroduce data elements that should not be transmitted to the entity.
Roles¶
- Entity (: Entity) receives data from the system, possibly as part of an action request
- System (: Entity) provides data to the
Entity - Filter (: Decision point) decides which data elements can be provided to the
Entitybased on the relevant policy - Policy provider (: Entity) keeps track of the relevant policies
Actions¶
- filter (: Action) the provided data based on the identified policy
- get_policy (: Action) retrieve the relevant policy
- action (: Action) the
Systemrequests theEntityto perform (optional)
Data elements¶
- data (: Data) the unfiltered data
- filtered_data (: Data) transformation of
dataafter filtering elements not allowed by thepolicy - id (: Data) identifies the (type of) policy that should be used to filter the data.
This may identify a specific policy known by the
Systemor indicate a type of policy, e.g. that the intended recipient is an (un)privileged entity.- Tags: Untampered
- policy (: Data) the actual policy applied by the
Filter- Tags: Untampered
Behaviour¶
- The
Systemprovides the data to be filtered along with an identifier of the (type of) policy to theFilter. - The
Filterrequests the actual policy from thePolicy provider. - The
Policy providerlooks up the required policy and returns it to theFilter. - The
Filterfilters elements in the data that are no not allowed according to the policy and returns the filtered data to the system for further processing. - The
Systemsends the filtered data, possibly as part of an action request, to theEntity.

Role considerations¶
Policy management (Policy provider)¶
The Filter relies on the policies provided by the Policy provider to correctly filter outgoing data.
Consequently, care should be taken only authorised entities can successfully request actions from the Policy provider.
For example, only authorised entities should be able to add new policies or modify existing ones.
In the likely case that the policy is stored additional measures might be warranted to ensure the integrity of policies.
Separate Filter and Entity¶
The filtering of data should always be performed before actually sending it to the Entity and one should never rely on the Entity to filter the received data.1 2
For example, if the Entity is a mobile client it should only receive the data the user is actually allowed to receive.
The server should not send unnecessary data elements and expect the client to select the data it actually needs or is allowed to use.
Data considerations¶
id¶
The identifier is used to obtain the correct policy to filter the data.
Consequently, if an attacker can influence this identifier the data might be incorrectly filtered before it is sent to the Entity.
If the id is transmitted over an uncontrolled channel additional measures to protect it against tampering are necessary.
policy¶
The policy determines how data is filtered, thus any unauthorised changed to a policy might result in an incorrect filtering.
If the policy is transmitted over an uncontrolled channel and/or if it is stored by the Policy provider extra measures should be taken to prevent and/or detect unauthorised changes.
Implementations¶
None
References¶
TODO
-
I. Arce et al., ‘Avoiding the Top 10 Software Security Design Flaws’, IEEE, 2014. [Online]. Available: https://cybersecurity.ieee.org/blog/2015/11/13/avoiding-the-top-10-security-flaws/ ↩
-
P. Silva, ‘OWASP API Security Top 10 2019 - The Ten Most Critical API Security Risks’. [Online]. Available: https://owasp.org/www-project-api-security/ ↩