JDBC security

Discussion in 'Plugin Development' started by Kamisoyokaze, Sep 28, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Kamisoyokaze

    Ok so basically for the next feature in my minecraft bukkit plugin i need everyone plugins to send data to my database, this is all well and goo except how do i stop people fucking with my database, or knowing my password? I don't have a server to run a client off to receive everything and validate it, i have a webhost and that is all, i really need a way to do this, any ideas?
     
  2. You cant really hide the password anywhere. Even if you dont give out the source, people can just decompile it.
     
  3. Offline

    Kamisoyokaze

    I know... That's the whole point of asking this question, there must be a way, lots of applications send info to their databases, how does mcbans work?
     
  4. Im not sure I understood everything, but you can
    a) Limit the privileges a certain user has to a database
    b) Try to hash the passwords
     
  5. This is the class it uses to send info.
     
  6. Offline

    Kamisoyokaze

    well, the thing is the privileges needed for the plugin to function is adding and editing, and people could abuse that pretty badly. I was thinking of doing it this way and then heavily moderating it but it doesn't seem practical.

    Hashing the passwords would require the passwords to be unhashed which i would normally do with a stand alone java app but that isnt possible without a server to run it on :/
     
  7. Offline

    sbeex

  8. Offline

    Belf

    IMO, best solution is indeed to make a WebService.
     
  9. Offline

    Kaikz

    Or use API keys. If your API key in your config isn't an admin one, reject the change.
     
  10. Offline

    alexanderpas

    nope.jpeg

    NEVER EVER send your password as part of a GET!!!

    instead, if you're sending passwords over the line, use something like Digest access authentication or take some hints from it when creating API keys ;)

    Yes, a webservice is the best way to control access to your database.

    All you need to be able to run a basic webservice is a host that allows a scripting language (like PHP) and a database (like mySQL) and some scripts that verify the input and keys. Also use prepared statements (Like PDO) to protect against obvious attacks (note that you're still vulnerable for DDOS so be sure to write your plugin properly.)
     
    Kamisoyokaze likes this.
  11. Offline

    Kamisoyokaze

    thanks for all the feedback, i guess i'll look into SOAP
     
Thread Status:
Not open for further replies.

Share This Page