futpib / policeman

Firefox extention for cross-site requests control (kind of RequestPolicy clone)
https://addons.mozilla.org/en-US/firefox/addon/policeman/
142 stars 11 forks source link

Rules timestamping and maybe expiring #145

Open cehteh opened 9 years ago

cehteh commented 9 years ago

Store a timestamp with each rule when it was last triggered (lazy timestamping with daily granularity would suffice). Then provide a facility to delete/edit rules after a certain time unused.

Rationale: Websites change, when one wants to add fine grained rules they may become obsolete sooner or later. Cloud Instances have also dynamic host ID's which may change over time and render existing Rules inappropriate. Over time a lot unused/superseeded rules will become bitrot and its hard to clean them up without any statistics about their effectiviness.

futpib commented 9 years ago

I had this idea too, this may actually eliminate the need for temporary rules.

bastik-1001 commented 9 years ago

I like the idea of being able to see when a rule was last triggered.

@futpib Please do not automate the deletion of permanent rules without the users' consent.

When #89 (which might help with #126) gets implemented the date can be stored and updated in those files.

The basic would be to create a column in the preferences where the dates are shown. Since the columns can be sorted it is relatively easy to find and delete obsolete rules. You still can add filters (unused for more than 3 months, 6 months, etc.) and/or provide a button to click to get rid of obsolete rules.

If you think it's good to let Policeman check on its own if there are any obsolete rules, please notify the user that there are such rules and that he/she might wants to delete them. (After all it can have an impact on performance) Preferably with an option to turn off the notification, however the notification might look like.

Please don't retire temporary rules as they allow to override permanent rules. E.g. I don't allow any request to example.com (That does not even require me to create a permanent rule if the addon is in white-list mode), but want to temporarily allow scripts to be loaded from that domain. (After a restart the temporary rule is gone, without waiting for it to expire or having to remove the rule.)