Last modified: 2014-11-19 17:48:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T75206, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 73206 - File upload area resorts to 0777 permissions to for uploaded conent
File upload area resorts to 0777 permissions to for uploaded conent
Status: NEW
Product: Wikimedia Labs
Classification: Unclassified
deployment-prep (beta) (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Nobody - You can work on this!
:
: 73309 (view as bug list)
Depends on:
Blocks: 73229
  Show dependency treegraph
 
Reported: 2014-11-09 18:21 UTC by Bryan Davis
Modified: 2014-11-19 17:48 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Davis 2014-11-09 18:21:54 UTC
(Bryan Davis from <https://bugzilla.wikimedia.org/show_bug.cgi?id=73102#c3>)
> Ran `chmod -R =rwX /data/project/upload7` to fix all file permissions.

(Marc A. Pelletier from <https://bugzilla.wikimedia.org/show_bug.cgi?id=73102#c4>)
> Be aware that doing so has given write permission to any authenticated user.
> This may not be a catastrophe in practice, but it has security impact.

(Bryan Davis from <https://bugzilla.wikimedia.org/show_bug.cgi?id=73102#c5>)
> (In reply to Marc A. Pelletier from comment #4)
> > Be aware that doing so has given write permission to any authenticated user.
> > This may not be a catastrophe in practice, but it has security impact.
> 
> This has been the fix for this particular issue as long as I've been helping
> in beta. I agree that chmod 0777 is a lame solution, but the uid/gid
> mismatches and NFS4 acls are a bit of a blocker to proper management of the
> shared file permissions.

(Marc A. Pelletier from <https://bugzilla.wikimedia.org/show_bug.cgi?id=73102#c6>)
> NFSv4 doesn't actually require UID concordance so long as the user /name/
> exists on the NFS server do that it doesn't fall back to numerical IDs - the
> proper solution to this is to make certain that any user or group that owns
> files in the shared filesystem exist on the NFS servers.
> 
> In the general Labs case, this is done through LDAP - but users and groups
> coming from Debian packages need to either be added (before installation) to
> LDAP or added to the NFS servers.
Comment 1 Bryan Davis 2014-11-09 18:33:03 UTC
It should be sufficient for the MediaWiki runtime user (apache) to have read/write for the files and directories under the /data/project/upload7 NFS share. All hosts in the beta cluster should be made to agree on the uid of the apache user. This would probably involve creating an apache user in ldap, fixing all beta hosts to use that user instead of a local user and then fixing the shared file ownership to be 0775 apache:apache.
Comment 2 Antoine "hashar" Musso (WMF) 2014-11-10 08:26:01 UTC
We had system users created in LDAP already, bug 66575 for cxserver and bug 63329 for parsoid.

Maybe we need to create in LDAP an apache user with uid 48 and a group with gid 48.
Comment 3 Antoine "hashar" Musso (WMF) 2014-11-12 14:19:33 UTC
*** Bug 73309 has been marked as a duplicate of this bug. ***
Comment 4 Antoine "hashar" Musso (WMF) 2014-11-12 14:20:33 UTC
Per duplicate bug 73309, this blocks Bug 73229 - beta labs: "error while storing the file in the stash.'
Comment 5 Sam Reed (reedy) 2014-11-15 09:51:44 UTC
root@deployment-bastion:/home/reedy# add-ldap-group --gid=48 apache
Traceback (most recent call last):
  File "/usr/local/sbin/add-ldap-group", line 120, in <module>
    main()
  File "/usr/local/sbin/add-ldap-group", line 38, in main
    ldapSupportLib.setBindInfoByOptions(options, parser)
  File "/usr/local/lib/python2.7/dist-packages/ldapsupportlib.py", line 80, in setBindInfoByOptions
    self.binddn = self.getLdapInfo('USER', '/etc/ldap/.ldapscriptrc')
  File "/usr/local/lib/python2.7/dist-packages/ldapsupportlib.py", line 103, in getLdapInfo
    for line in f:
UnboundLocalError: local variable 'f' referenced before assignment




What do you give for a pub key?

add-ldap-user --ui=48 --guid=48 apache ?????
Comment 6 Gilles Dubuc 2014-11-15 10:30:24 UTC
Glancing at the source code of add-ldap-group, it seems to expect the existence of the /etc/ldap/.ldapscriptrc file, which would include the credentials to connect to LDAP. There are other options to provide the credentials.
Comment 7 Antoine "hashar" Musso (WMF) 2014-11-15 11:06:29 UTC
Sam, that needs to be done on the whole labs LDAP. We probably don't have any credential there.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links