Summary
When multiple filters trigger a hit, they all share the same var_dump. This is causing problems, as public filters can have var_dumps with protected variables and privileged information the user may not have access to. We need to make the var_dumps contain only the protected variables used in the filter
Background and Technical notes
When multiple filters trigger a hit, they all share the same var_dump. This is causing problems, as public filters can have var_dumps with protected variables and privileged information the user may not have access to. We've been solving this problem by filtering out variable values based on view rights but as we add more granular controls around what rights can view what types of information, it makes more sense to control it at the time of write instead of time of display.
For instance:
- Given the following filters:
- Filter A is a public filter (action = 'edit')
- Filter B is a protected filter with no additional restrictions (as of writing, this is hypothetical and refers to IP Reputation variables)
- Filter C is a protected filter using user_unnamed_ip, which is additionally protected (user_unnamed_ip = '1.2.3.4')
- A user edits from IP 1.2.3.4, hitting all 3 filters (ids 1, 2, 3, corresponding to A, B, C)
- Filter C is updated to no longer use user_unnamed_ip (action = 'edit' - This is a duplicate of Filter A but as Filter C has been protected before, it remains protected now)
- A user edits, also hitting all 3 filters (ids 4, 5, 6)
We expect:
| Filter ID | Public View | Protected Var View | Protected Var + IP Access |
| 1 | ✅ | ✅ | ✅ |
| 2 | ❌ | ✅ | ✅ |
| 3 | ❌ | ❌ | ✅ |
| 4 | ✅ | ✅ | ✅ |
| 5 | ❌ | ✅ | ✅ |
| 6 | ❌ | ✅ | ✅ |
Right now, there is no good way to gate access to 3 as expected/wanted, as filter logs are associated to a filter id, not a filter revision. Ensuring that access to log 3 remains restricted as expected can only be done by either:
- Checking the blob store for the used variable and restricting view on a per-log basis
- Associating a filter revision w/the log and checking against variables used in that revision
Given that either will solve it, unique blobs will solve the product problem faster.
Acceptance criteria
- AbuseFilter logs use a var dump which contains only the protected variables used in the associated filter