Skip to content

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 Entity based 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 System requests the Entity to perform (optional)

Data elements

  • data (: Data) the unfiltered data
  • filtered_data (: Data) transformation of data after filtering elements not allowed by the policy
  • id (: Data) identifies the (type of) policy that should be used to filter the data. This may identify a specific policy known by the System or indicate a type of policy, e.g. that the intended recipient is an (un)privileged entity.
  • policy (: Data) the actual policy applied by the Filter

Behaviour

  1. The System provides the data to be filtered along with an identifier of the (type of) policy to the Filter.
  2. The Filter requests the actual policy from the Policy provider.
  3. The Policy provider looks up the required policy and returns it to the Filter.
  4. The Filter filters elements in the data that are no not allowed according to the policy and returns the filtered data to the system for further processing.
  5. The System sends the filtered data, possibly as part of an action request, to the Entity.

Output is filtered before sending it to the entity

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


  1. 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/ ↩

  2. P. Silva, ‘OWASP API Security Top 10 2019 - The Ten Most Critical API Security Risks’. [Online]. Available: https://owasp.org/www-project-api-security/ ↩


Last update: February 11, 2022