Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Discussion: utility of references to related rulesets #14449

Closed

Description

@Hainish

Type: other

Expaliner

Many of our rulesets have references to other, related rulesets. Just one exmaple:

Other Facebook rulesets:
- Facebook.net.xml
- Facebook_Studio.xml
- Facebook_ccTLDs.xml
- Fb.com.xml
- Fb.me.xml
- FbCDN.net.xml
- Messenger.com.xml
- PrivateCore.com.xml
- FacebookCoreWWWi.onion.xml

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

For other GitHub coverage, see Github.xml.
), were not covered.

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?

Related discussions: #13657 #13732

Activity

  1. jeremyn commented on Jan 26, 2018

    @jeremyn
    Contributor

    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.com targets 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.xml ruleset tag might have this:

    <ruleset name="AOL.com (partial)" group="aol">
    ...
    </ruleset>

    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.

  2. Bisaloo commented on Jan 27, 2018

    @Bisaloo
    Collaborator

    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).

  3. J0WI commented on Jan 27, 2018

    @J0WI
    Contributor

    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.

    grep in the rules folder

    That's already done by the make-trivial-rule script btw.
    https://github.com/EFForg/https-everywhere/blob/master/src/chrome/content/rules/make-trivial-rule#L38

  4. jeremyn commented on Jan 27, 2018

    @jeremyn
    Contributor

    Side note, but git grep is probably preferable to regular grep for simple searching through any git repository.

    For @Bisaloo 's point:

    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.

  5. wonderchook commented on Mar 6, 2018

    @wonderchook
    Contributor

    @Hainish do you feel like you got the information you needed? If so could you close this?

  6. jeremyn commented on Mar 6, 2018

    @jeremyn
    Contributor

    I'd like to know, if possible, what action might be taken based on this discussion, if any, before the issue is closed.

  7. cschanaj commented on Jun 22, 2018

    @cschanaj
    Collaborator

    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.

  8. Hainish commented on Sep 27, 2018

    @Hainish
    MemberAuthor

    Closing due to inactivity, but if people are still interested in discussing this I can re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions