You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Discussion: utility of references to related rulesets #14449
Historically, this has been useful for contributors to see how rulesets are related to one another, and to help guide them to the right place when they want to contribute.
Problem
Over time, as the rulesets have expanded, keeping track of all the references has become an intractable problem. Many of the references referred to files that had been removed, or 'dangling references'. Since an informal convention prevailed as to the format of these references, many of them could be removed programmatically, as was done in #13657. A new test ensures that ruleset PRs which follow this convention do not contain dangling references: #13732. However, since the convention was informal, certain references (such as
Are ruleset references useful at all? Should we formalize the conventions around these references, and perhaps move them out of the comments section? Can utilities be developed that would help new contributors enumerate related rulesets?
Rulesets can be related for one of two reasons: real world relationships, or technical relationships.
Real world relationships are relationships between two rulesets because they are owned by a common organization, or one redirects to the other, or one is a CDN for the other, or something like that. In this case the domains in each ruleset are technically distinct and can stand on their own.
Technical relationships between rulesets are for cases where we really should have one ruleset, but we've split them up due to some technical limitation or detail of the extension. An example is MIT.xml, MIT-complex.xml, MIT-mismatches.xml etc. You might have the same target in each ruleset, with different rules or exclusions.
In #13732 (comment)@Hainish wrote this in defense of what I'm calling real world relationship references:
For instance, if someone discovers a new subdomain for fbcdn.net which should be covered, they may not know that a ruleset file exists for that specific scope. If they open Facebook.xml and it does not reference FbCDN.net.xml, they're likely to miss it and simply add that subdomain to the wrong file.
This envisions a situation where a contributor is making a judgment call about where to put fbcdn.net, with the implication that if FbCDN.net.xml exists, the contributor should see a reference to it, so they can do the same thing as a previous contributor and put the fbcdn.net subdomain into this file.
However I've been pushing for a while now away from complicated multidomain rulesets, to more simple one-domain rulesets where the filename matches the domain. With this new system, it's already wrong to include a fbcdn.net domain in the Facebook.xml ruleset, because Facebook.xml is for facebook.comtargets and a fbcdn.net subdomain doesn't belong there. (In fact if I were reviewing Facebook.xml as a new ruleset, I would have it named Facebook.com.xml.) The contributor should already be looking for a FbCDN.net.xml ruleset, and find it without needing to be told about it.
I guess that the large majority of references are for real world relationships, not technical relationships. I think we can get rid of real world relationship references. They might have some value to some people, but the maintenance burden is high and I don't think it's worth it.
We do need to mark technical relationships, so we need to keep some mechanism for marking references. The key is that references need to be enforceable in the XML schema. In #13657 (comment) I proposed this mechanism:
However, if there is a need or if people just like keeping this information for some reason, then I propose that we instead add a group attribute to the ruleset tag with a unique identifier that is shared by all the members of that group. So for example the AOL.xmlruleset tag might have this:
and all of the rulesets I linked above would also have group="aol". A small script could be written to generate a list of all related rulesets based on this. This would avoid the entire "obsolete reference" problem discussed here. It would also avoid the need to choose a "primary" ruleset which may not be clear. Yet another advantage is being able to assign multiple groups, if for some reason someone wanted to do that.
and I still support this basic approach, though of course we don't need to call the attribute group, or maybe instead we should use a group tag, or whatever else people prefer.
First of all, thank you @Hainish for opening this issue.
@jeremyn pretty much summarized my opinion on this. I agree that a ruleset should only focus on a single domain so we don't need to point out related rulesets to contributors. They have no reason to visit Facebook.xml if they want to secure fbcdn.net.
Also, as far I as know, three main methods can be used to get more info about coverage of domain in HTTPS Everywhere:
HTTPS Everywhere atlas
GitHub search
grep in the rules folder
All those methods will direct contributors to FbCDN.net.xml if they want to work on fbcdn.net.
Another point is ruleset maintainability. Even if those references had some minor use, they are adding a disproportionate maintenance load. Something as simple as deleting a ruleset requires to delete the dangling reference, then quite often, whitelist the main ruleset because the comment update modified the hash and tests aren't passing anymore. I think reviewers can also attest that contributors often forget about dangling reference. This means reviewers have to ask for it, wait for contributors to be available to make the changes,... Given the daily number of new PR in this repo, this slows things down quite a bit. Not to mention that sometimes we are not even sure whether we should keep the references or not (#14282).
However I've been pushing for a while now away from complicated multidomain rulesets, to more simple one-domain rulesets where the filename matches the domain.
I prefer a singe "multidomain" ruleset for hosts with different aliases (like a site with .biz, .com and .net TLDs, all having the same behavior) or if there is only a single target on another domain, which is not worth to create a seperate file for it. Ruleset references would be too much overhead here.
Historically reference lists have also been growing in the past because of the ongoing split of huge rulesets (e.g. the amazon, ebay or Verwaltung_Online.xml rules).
Keeping those references is also useful for maintenance, since a change in the ebaystatic rule affects other hosts like ebay.ca or ebay.com. So I'm able to check some of the referenced sites before accepting any changes.
And if there is a major change in ebay.ca, you can also try to adopt these changes for ebay.com (remember the switch to https on amazon.*).
But it's hard to formulate a clear guideline for this. While amazon is a quite simple case, ebay already have many other domains/companies that are all somehow related. Or e.g. StatusPage.io.xml is now part of Atlassian.xml, but the references have not been updated. A guideline should not force us to maintain them.
Not to mention that sometimes we are not even sure whether we should keep the references or not (#14282).
I agree with this. I don't like us being in a position of saying two domains are related, when we usually can't know for sure. In extreme cases this can be a security problem, for example if we are tricked into saying some .onion site is related to some other site, when it's actually not.
The single-domain/multi-domain ruleset situation is analogous to other programming best practices like small functions/large functions, simple classes/complex classes, loose coupling/tight coupling, and we should prefer single-domain rulesets for similar reasons.
There is no technical problem with having a ruleset for one trivial target. It is not really any more difficult to review. The only reason it is a problem is because contributors often don't do that to start with, so we either have to have some discussion with them, or just let it go.
There is no way for us to reliably know that some example.com and example.org always have the same behavior.
In most cases a change in ebaystatic will not affect ebay.com. Maybe there are CORS problems. However if we simplified the reference system, using my tagging approach or something else, I would be more open to keeping more references.
I don't like us being in a position of saying two domains are related, when we usually can't know for sure.
I agree that we shouldn't be in the position of saying two domains/ rulesets are related without obvious evidence, the same issue exists for a group attribute approach. It seems to me that the maintenance burden (e.g. the problem of dangling references) sometimes outweighed its benefits for most contributors.
The idea in #13732 is that, if there is existing reference and a contributor would like to keep it, he/she should make sure they are not obsolete; else it is up to the contributor to decide whether or not to include (even to remove) the references.
Activity
jeremyn commentedon Jan 26, 2018
Rulesets can be related for one of two reasons: real world relationships, or technical relationships.
Real world relationships are relationships between two rulesets because they are owned by a common organization, or one redirects to the other, or one is a CDN for the other, or something like that. In this case the domains in each ruleset are technically distinct and can stand on their own.
Technical relationships between rulesets are for cases where we really should have one ruleset, but we've split them up due to some technical limitation or detail of the extension. An example is
MIT.xml,MIT-complex.xml,MIT-mismatches.xmletc. You might have the sametargetin each ruleset, with differentrules orexclusions.In #13732 (comment) @Hainish wrote this in defense of what I'm calling real world relationship references:
This envisions a situation where a contributor is making a judgment call about where to put
fbcdn.net, with the implication that ifFbCDN.net.xmlexists, the contributor should see a reference to it, so they can do the same thing as a previous contributor and put thefbcdn.netsubdomain into this file.However I've been pushing for a while now away from complicated multidomain rulesets, to more simple one-domain rulesets where the filename matches the domain. With this new system, it's already wrong to include a
fbcdn.netdomain in theFacebook.xmlruleset, becauseFacebook.xmlis forfacebook.comtargets and afbcdn.netsubdomain doesn't belong there. (In fact if I were reviewingFacebook.xmlas a new ruleset, I would have it namedFacebook.com.xml.) The contributor should already be looking for aFbCDN.net.xmlruleset, and find it without needing to be told about it.I guess that the large majority of references are for real world relationships, not technical relationships. I think we can get rid of real world relationship references. They might have some value to some people, but the maintenance burden is high and I don't think it's worth it.
We do need to mark technical relationships, so we need to keep some mechanism for marking references. The key is that references need to be enforceable in the XML schema. In #13657 (comment) I proposed this mechanism:
and I still support this basic approach, though of course we don't need to call the attribute
group, or maybe instead we should use agrouptag, or whatever else people prefer.Bisaloo commentedon Jan 27, 2018
First of all, thank you @Hainish for opening this issue.
@jeremyn pretty much summarized my opinion on this. I agree that a ruleset should only focus on a single domain so we don't need to point out related rulesets to contributors. They have no reason to visit
Facebook.xmlif they want to securefbcdn.net.Also, as far I as know, three main methods can be used to get more info about coverage of domain in HTTPS Everywhere:
grepin therulesfolderAll those methods will direct contributors to
FbCDN.net.xmlif they want to work onfbcdn.net.Another point is ruleset maintainability. Even if those references had some minor use, they are adding a disproportionate maintenance load. Something as simple as deleting a ruleset requires to delete the dangling reference, then quite often, whitelist the main ruleset because the comment update modified the hash and tests aren't passing anymore. I think reviewers can also attest that contributors often forget about dangling reference. This means reviewers have to ask for it, wait for contributors to be available to make the changes,... Given the daily number of new PR in this repo, this slows things down quite a bit. Not to mention that sometimes we are not even sure whether we should keep the references or not (#14282).
J0WI commentedon Jan 27, 2018
I prefer a singe "multidomain" ruleset for hosts with different aliases (like a site with
.biz,.comand.netTLDs, all having the same behavior) or if there is only a single target on another domain, which is not worth to create a seperate file for it. Ruleset references would be too much overhead here.Historically reference lists have also been growing in the past because of the ongoing split of huge rulesets (e.g. the
amazon,ebayorVerwaltung_Online.xmlrules).Keeping those references is also useful for maintenance, since a change in the
ebaystaticrule affects other hosts likeebay.caorebay.com. So I'm able to check some of the referenced sites before accepting any changes.And if there is a major change in
ebay.ca, you can also try to adopt these changes forebay.com(remember the switch to https onamazon.*).But it's hard to formulate a clear guideline for this. While
amazonis a quite simple case,ebayalready have many other domains/companies that are all somehow related. Or e.g.StatusPage.io.xmlis now part ofAtlassian.xml, but the references have not been updated. A guideline should not force us to maintain them.That's already done by the
make-trivial-rulescript btw.https://github.com/EFForg/https-everywhere/blob/master/src/chrome/content/rules/make-trivial-rule#L38
jeremyn commentedon Jan 27, 2018
Side note, but
git grepis probably preferable to regulargrepfor simple searching through any git repository.For @Bisaloo 's point:
I agree with this. I don't like us being in a position of saying two domains are related, when we usually can't know for sure. In extreme cases this can be a security problem, for example if we are tricked into saying some
.onionsite is related to some other site, when it's actually not.The single-domain/multi-domain ruleset situation is analogous to other programming best practices like small functions/large functions, simple classes/complex classes, loose coupling/tight coupling, and we should prefer single-domain rulesets for similar reasons.
There is no technical problem with having a ruleset for one trivial
target. It is not really any more difficult to review. The only reason it is a problem is because contributors often don't do that to start with, so we either have to have some discussion with them, or just let it go.There is no way for us to reliably know that some
example.comandexample.orgalways have the same behavior.In most cases a change in
ebaystaticwill not affectebay.com. Maybe there are CORS problems. However if we simplified the reference system, using my tagging approach or something else, I would be more open to keeping more references.wonderchook commentedon Mar 6, 2018
@Hainish do you feel like you got the information you needed? If so could you close this?
jeremyn commentedon Mar 6, 2018
I'd like to know, if possible, what action might be taken based on this discussion, if any, before the issue is closed.
cschanaj commentedon Jun 22, 2018
I agree that we shouldn't be in the position of saying two domains/ rulesets are related without obvious evidence, the same issue exists for a
groupattribute approach. It seems to me that the maintenance burden (e.g. the problem of dangling references) sometimes outweighed its benefits for most contributors.The idea in #13732 is that, if there is existing reference and a contributor would like to keep it, he/she should make sure they are not obsolete; else it is up to the contributor to decide whether or not to include (even to remove) the references.
Hainish commentedon Sep 27, 2018
Closing due to inactivity, but if people are still interested in discussing this I can re-open.