{"action":"created","issue":{"url":"https://api.github.com/repos/govCMS/govCMS/issues/655","repository_url":"https://api.github.com/repos/govCMS/govCMS","labels_url":"https://api.github.com/repos/govCMS/govCMS/issues/655/labels{/name}","comments_url":"https://api.github.com/repos/govCMS/govCMS/issues/655/comments","events_url":"https://api.github.com/repos/govCMS/govCMS/issues/655/events","html_url":"https://github.com/govCMS/govCMS/issues/655","id":301607749,"number":655,"title":"Consideration for the availability of files attached to old revisions","user":{"login":"rooby","id":610162,"avatar_url":"https://avatars2.githubusercontent.com/u/610162?v=4","gravatar_id":"","url":"https://api.github.com/users/rooby","html_url":"https://github.com/rooby","followers_url":"https://api.github.com/users/rooby/followers","following_url":"https://api.github.com/users/rooby/following{/other_user}","gists_url":"https://api.github.com/users/rooby/gists{/gist_id}","starred_url":"https://api.github.com/users/rooby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rooby/subscriptions","organizations_url":"https://api.github.com/users/rooby/orgs","repos_url":"https://api.github.com/users/rooby/repos","events_url":"https://api.github.com/users/rooby/events{/privacy}","received_events_url":"https://api.github.com/users/rooby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-02T00:12:50Z","updated_at":"2018-03-02T02:48:09Z","closed_at":null,"author_association":"NONE","body":"Drupal has always had a potential issue with files attached to old revisions of content.\r\n\r\nThe problem is public files attached to old revisions of content that are still available by direct link and are still searchable in search engines.\r\n\r\nThis is potentially a big problem for government sites if the site is misconfigured or misused (either accidentally or maliciously) because you might have policy documents or other legal documents that are out of date but are still accessible on the website by anyone.\r\n\r\nThe technicalities of the problem are:\r\n\r\nWhen revisions are enabled, each individual revision of a node (or other revision enabled entity) counts as its own file usage. So if revisions are enabled and you replace a file on a file field with a new version of that file, the old version is retained because it is still used on that revision and it needs to be there in case the user wants to revert to that revision at some point.\r\n\r\nFiles in the public file system are always directly accessible if you know the URL. Generally people aren't required to guess the URL because Google or other search engines will find it for them. So if you have public files on an old revision they will stick around until that revision is deleted (and the file isn't used anywhere else on the site).\r\n\r\nUsing the private file system, Drupal will check that the user has access to view the file. For files attached to nodes, this means that node access rules will be checked and if the user doesn't have access to view unpublished revisions then they can't access the file. Since anonymous users will pretty much exclusively not have access to unpublished revisions this solves the problem (although it does add performance overheads to loading the file for uncached requests).\r\n\r\nSo any files where it might be an issue if a user can access old versions of that file should use the private file system.\r\n\r\nSo if the site builder is unaware of this behaviour (or just forgets about it when building a particular site) there could end up being a problem.\r\n\r\nThe next issue is that it is not necessarily easy to get an ideal configuration with the current version of GovCMS SaaS.\r\n\r\nUnless all the content editors of a site are very competent and knowledgable on how the system works it would be best to avoid any possibly confusion that might arise by allowing them to select public/private each time they upload a file. Plus even if they are competent and do know about it, it's not hard to make a mistake and select the wrong one. It's also more user friendly if the system can work it out for them.\r\n\r\nIt's easy to have a document field that specifically uses private files but it's not so easy to handle files added via the WYSIWYG. In that case you either make all files going into the WYSIWYG private, which is not ideal because of performance implications, or you allow the uploader to choose per file, which is not ideal because it is error prone and not user friendly.\r\n\r\nAnother possible solution is to be able to set the scheme per file type, so for example all documents are private but all images are not. I don't think it's currently possible in GovCMS to do that though. It also leaves open the possibility of unwanted images being visible from old revisions.\r\n\r\nProbably the safest way to handle it is to have all content related files in the private file system, so long as the performance trade-off is considered acceptable, which it might be due to the caching layers we have in place.\r\n\r\nWhatever is the preferred approach, this is an issue that site builders need to be aware of and I think it would be good for GovCMS to have a recommendation as to how it is to be set up and to set sensible defaults."},"comment":{"url":"https://api.github.com/repos/govCMS/govCMS/issues/comments/369803643","html_url":"https://github.com/govCMS/govCMS/issues/655#issuecomment-369803643","issue_url":"https://api.github.com/repos/govCMS/govCMS/issues/655","id":369803643,"user":{"login":"tobybellwood","id":4373945,"avatar_url":"https://avatars1.githubusercontent.com/u/4373945?v=4","gravatar_id":"","url":"https://api.github.com/users/tobybellwood","html_url":"https://github.com/tobybellwood","followers_url":"https://api.github.com/users/tobybellwood/followers","following_url":"https://api.github.com/users/tobybellwood/following{/other_user}","gists_url":"https://api.github.com/users/tobybellwood/gists{/gist_id}","starred_url":"https://api.github.com/users/tobybellwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobybellwood/subscriptions","organizations_url":"https://api.github.com/users/tobybellwood/orgs","repos_url":"https://api.github.com/users/tobybellwood/repos","events_url":"https://api.github.com/users/tobybellwood/events{/privacy}","received_events_url":"https://api.github.com/users/tobybellwood/received_events","type":"User","site_admin":false},"created_at":"2018-03-02T02:48:09Z","updated_at":"2018-03-02T02:48:09Z","author_association":"CONTRIBUTOR","body":"Thanks @rooby - dealing with how best to employ private FS is something we're currently grappling with."}}
{"actor":{"display_login":"tobybellwood"}}