MySQL without granting root access (1 Viewer)

Guzzi

Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,159
    750
    1.
    If you "don't trust" MP (or any other software, like Windows, App1, App2, etc.), you should NOT install it - noone can tell you, what an installer does - what backdoors are included in a software (are you sure there is none in your systems?) or what harm it might do to whatever exists. With open source, you have the advantage to not completely relying on "trust", but can check the underlying code itself, if you want.
    But as said - if you don't trust it, don't install it!
    2.
    Yes, you can install MP manually and install DB manually and use any local or remote MySQL or MSSQL DB - also existing ones - and administer them as you like - but the majority of the standard users can't and don't want to do such things - and would not even thinking of sharing the DB with other stuff.
    And I probably wouldn't mix up my HTPC / tvDB with my SAP database engine anyway ;-) ...
     
    Last edited:

    davidf

    Retired Team Member
  • Premium Supporter
  • April 3, 2006
    796
    348
    Scotland
    Home Country
    Scotland Scotland
    @cubemon - It's open source, write the installer the way you want to and submit your changes... or even just publish it so that those who do administer their own databases at home have the choice of implementations.
     

    The_Stig

    Retired Team Member
  • Premium Supporter
  • April 5, 2005
    2,175
    428
    You don't seem to understand; giving root access gives the possibility to delete or corrupt all other databases on the server.
    I understand perfectly fine. And no-one did say that you're not having a point here. But just repeating your opinion isn't constructive at all. Especially when not willing to accept other opinions/suggestions (e.g. thats its not a very common user case you have so other things in MP are more priorized by the devs and that you can manually set your security settings).
     

    JimCatMP

    Documentation Group
  • Team MediaPortal
  • April 1, 2010
    654
    285
    Leeds
    Home Country
    United Kingdom United Kingdom
    Everyone contributing to this thread knows EXACTLY what it means to give root access in DB terms.

    You don't seem to understand the most basic of security principals - security has NO inherent value, it's the ASSET your are protecting that has value and as such sets the benchmark for the security investment (time, effort, code, hardware.... do you rate your DB's as important enough to invest in two factor authentication for admin access - yes/no - doesn't matter which as long as your investment matches your risk profile).

    My TV Server is a TV Server - one function, it matters not that the DB corrupted due to root access or disk failure due to cat having a crafty crap behind the sofa and blocking fan - the same function is compromised, it's only the clean up that's different.

    You are NOT the sort of person MePo is aimed at, it's target audience is generally computer literate, single or limited function devices NOT core DB servers supporting several projects in real project space - that not that you can't use or can't contribute, you surely could, but your base argument simply does not indicate any willingness to do either.

    The only reason for needing root access is that Mediaportal contains malware that is trying to harm your data.

    .

    Given the above was your starting point, you've already lost the case where you plead

    Pointing out bugs and design flaws are a very important part of software development. I wouldn't call that "nothing constructive".

    If your intention was to be constructive, would it not have been better not to label MePo dev as lazy Malware artists, make the point that in a multi-service environment the default IS a risk [and a risk by error NOT malign intent] and if you had the level of interest, recommendation on safer path or leave it at that, DavidF provided base info for anyone with the likely skill level on how to progress.

    JCMP
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,257
    2,533
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Seriously, I find this very odd.

    Giving a program root access is like giving a stranger keys to your house, your atm cards and all the PIN numbers just so he can shovel the snow off your driveway.

    The only reason for needing root access is that Mediaportal contains malware that is trying to harm your data.

    There is absolutely no legitimate reason to have a program like this having root access to a database.
    Well reasoned argument :rolleyes:

    First off lets be clear that root access was a bad decision a long time ago and have never been updated. MP does not need (and should not be using) root access to the database.

    Lets put this in context though....

    Your analogy to house keys is pretty poor, it is more akin to locking your fridge, leaving the keys on the table in front room inside a locked house and not tellilng anyone that the keys are lying around o_O . I would imaging that something like 99.9% of users have a MySQL database purely for MP. They do not understand databases and it was just installed when MP was and they have never touched it since. So MP has free access to MP data, in this use case there is little difference to running as a limited user. The database is going to be on an internal network, no-one is going to be invited in...

    The remaining 0.1% of users are already maintaining a database so should be able to setup a second instance or add a new user (or decide that MP is not for them)

    Security is about risk. You have connected your computer on the internet and visited a website thus exposing your machine to risk. You took that decision that the risk was worth it and probably have some mitigation in place (NAT firewall, AV software...).

    Just tried this and it and it has only taken a few minutes to check this works (or at least appears to).
    Installed MySQL then as root:
    Code:
    create user 'MP'@'HOST' identified by 'MP';
    create database MPTVDB;
    grant all on MPTVDB.* to 'MP'@'HOST';
    grant select on mysql.* 'MP'@'HOST';
    Install MP (choose advanced installation and existing SQL database)
    You will be prompted for details as above
    Not entirely sure why the SELECT is needed on mysql database but this is far better than root access to all databases. So MP running against a MySQL database without connecting as a root user.

    Just to re-iterate though this is not ideal and should be changed. I am not advocating the access as a good thing but it is no where near as bad as you are making out.

    As you feel so strongly about this there are a few options:
    • Do nothing. Stop trolling here and don't look at this again.
    • Setup a user as above and have MP access your MySQL instance not as root
    • Help out. Develop the necessary changes to remove the use of root and supply the details as a patch / git pull request
    Which of these do you feel fits best with Open Source software? :D
     
    Last edited:

    cubemon

    New Member
    February 25, 2013
    5
    0
    Home Country
    Antarctica Antarctica
    First off lets be clear that root access was a bad decision a long time ago and have never been updated. MP does not need (and should not be using) root access to the database.

    Thank you. Finally someone understands.

    Security is about risk. You have connected your computer on the internet and visited a website thus exposing your machine to risk.

    Except, if you don't run your web browser as root (which you shouldn't), then only your user data is compromised, not your whole system.

    Just tried this and it and it has only taken a few minutes to check this works (or at least appears to).
    ...
    So MP running against a MySQL database without connecting as a root user.

    When I had created the database with all the rights, the installer still insisted it needed access to MySQL's mysql (the one storing users and other stuff) database. I found no way to continue without granting root access.

    Just to re-iterate though this is not ideal and should be changed. I am not advocating the access as a good thing but it is no where near as bad as you are making out.

    As you feel so strongly about this there are a few options:
    • Do nothing. Stop trolling here and don't look at this again.
    • Setup a user as above and have MP access your MySQL instance not as root
    • Help out. Develop the necessary changes to remove the use of root and supply the details as a patch / git pull request
    I appreciate finally reaching someone who appreciates the security angle of the case. While most people may not even understand why this is important and don't want to deal with it, it's the same attitude that allows spammers to run huge bot networks and personal information to be stolen. If you run everything as root, you are asking for trouble, simply put.

    I was simply the messenger. I was trying to point out a design flaw that prevents people from using your software. Considering that, it's a bit harsh to start berating me and calling me a troll. Why would I want to put in time to fix things, when the community is like this?

    I might have been repeating myself, but that was because people didn't understand the security viewpoint of things, or they just didn't care enough to find out, what this was all about.

    I still hope this issue gets fixed in a future version of your software.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I was simply the messenger. I was trying to point out a design flaw that prevents people from using your software. Considering that, it's a bit harsh to start berating me and calling me a troll. Why would I want to put in time to fix things, when the community is like this?

    Isn't it a bit harsh to call all people who devote lot of their free time for free to lazy? If it is not harsh in your opinion it will be at least a great way to demotivate people to look into the proposed change.

    I might have been repeating myself, but that was because people didn't understand the security viewpoint of things, or they just didn't care enough to find out, what this was all about.

    People did understand, you failed to understand the why it is not a risk for the 99.5% of the MP users.

    I still hope this issue gets fixed in a future version of your software.

    If there will be a patch then it certainly will be fixed, otherwise it will get prioritized quite low since the affected user base is quite minimal. There is no security issue for people who use MySQL / MS SQL only for MediaPortal itself.

    Granting root access to the database is not giving any root access to the OS itself - only the data in DB is "at risk" if MP would be maliculous or buggy (for 99.5% of the MediaPortal users it will mean that it is MP data alone that is at risk - the same data that is at the risk even if no root DB access is given).
     

    Users who are viewing this thread

    Top Bottom