Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3200

Developer's Guide: Add examples showing use of SQL authorization with user authentication

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.4.1.3
    • 10.5.1.1
    • Documentation
    • None

    Description

      This is the followup to DERBY-1823 that Francois Orsini suggested.

      I've been experimenting and reading the Developer's Guide section on SQL authorization (User authorizations, cdevcsecure36595).

      It appears that the only use of SQL authorization mode is to restrict user access, not to expand it.

      For example, if you set the default connection mode to noAccess, a user with fullAccess can't grant any privileges to a user with noAccess. And presumably if the default connection mode is readOnlyAccess, a user with fullAccess can't grant any privileges beyond SELECT, which the user has anyway.

      Only if the default connection mode is fullAccess is SQL authorization mode meaningful. That means that a fullAccess user can use GRANT to restrict another user's privileges on a particular database that the user owns.

      I'm running into a problem at the end, though. At the beginning of the program, as nobody in particular, I was able to create several users, some of them with full access. But at the end of the program, it seems that even a user with full access isn't allowed to turn off those database properties:

      Message: User 'MARY' does not have execute permission on PROCEDURE 'SYSCS_UTIL'.'SYSCS_SET_DATABASE_PROPERTY'.

      This seems a bit extreme. I know that with SQL authorization on, "the ability to read from or write to database objects is further restricted to the owner of the database objects." But the ability to execute built-in system procedures? Can I log in as SYSCS_UTIL? How?

      I realize that having access to SYSCS_SET_DATABASE_PROPERTY would allow me to in effect delete myself – but that's essentially what I do at the end of the program that sets derby.connection.requireAuthentication but not derby.database.sqlAuthorization.

      The documentation does say that once you have turned on SQL authorization, you can't turn it off. But it doesn't say that you can't turn anything else off, either!

      I'll attach the program I've been using. Most of the stacktraces are expected, but I'm stumped by that last one.

      Attachments

        1. auth2.log
          5 kB
          Dag H. Wanvik
        2. AuthExampleClient1.java
          7 kB
          Camilla Haase
        3. AuthExampleClient1.java
          6 kB
          Camilla Haase
        4. AuthExampleClient1.java
          7 kB
          Camilla Haase
        5. AuthExampleClient1.java
          7 kB
          Camilla Haase
        6. AuthExampleClient1.java
          6 kB
          Camilla Haase
        7. AuthExampleClient2.java
          6 kB
          Camilla Haase
        8. AuthExampleClient2.java
          6 kB
          Camilla Haase
        9. AuthExampleClient2.java
          8 kB
          Camilla Haase
        10. AuthExampleClient2.java
          8 kB
          Camilla Haase
        11. AuthExampleClient2.java
          8 kB
          Camilla Haase
        12. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        13. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        14. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        15. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        16. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        17. AuthExampleClientSQLAuth1.java
          6 kB
          Camilla Haase
        18. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        19. AuthExampleClientSQLAuth1.java
          7 kB
          Dag H. Wanvik
        20. AuthExampleClientSQLAuth1.java
          7 kB
          Camilla Haase
        21. AuthExampleClientSQLAuth2.java
          10 kB
          Camilla Haase
        22. AuthExampleClientSQLAuth2.java
          10 kB
          Camilla Haase
        23. AuthExampleClientSQLAuth2.java
          11 kB
          Camilla Haase
        24. AuthExampleClientSQLAuth2.java
          11 kB
          Camilla Haase
        25. AuthExampleClientSQLAuth2.java
          11 kB
          Camilla Haase
        26. AuthExampleClientSQLAuth2.java
          10 kB
          Camilla Haase
        27. AuthExampleClientSQLAuth2.java
          10 kB
          Camilla Haase
        28. AuthExampleClientSQLAuth2.java
          12 kB
          Dag H. Wanvik
        29. AuthExampleClientSQLAuth2.java
          12 kB
          Camilla Haase
        30. AuthExampleEmbedded_dhw.java
          12 kB
          Camilla Haase
        31. AuthExampleEmbedded.java
          11 kB
          Camilla Haase
        32. AuthExampleEmbedded.java
          11 kB
          Camilla Haase
        33. AuthExampleEmbedded.java
          13 kB
          Camilla Haase
        34. AuthExampleEmbedded.java
          13 kB
          Camilla Haase
        35. AuthExampleEmbedded.java
          13 kB
          Camilla Haase
        36. AuthExampleEmbedded-dhw.java
          12 kB
          Dag H. Wanvik
        37. AuthExampleEmbeddedSQLAuth.java
          15 kB
          Camilla Haase
        38. AuthExampleEmbeddedSQLAuth.java
          15 kB
          Camilla Haase
        39. AuthExampleEmbeddedSQLAuth.java
          16 kB
          Camilla Haase
        40. AuthExampleEmbeddedSQLAuth.java
          16 kB
          Camilla Haase
        41. AuthExampleEmbeddedSQLAuth.java
          16 kB
          Camilla Haase
        42. AuthExampleEmbeddedSQLAuth.java
          15 kB
          Camilla Haase
        43. AuthExampleEmbeddedSQLAuth.java
          15 kB
          Camilla Haase
        44. AuthExampleEmbeddedSQLAuth.java.dhw
          16 kB
          Dag H. Wanvik
        45. DERBY-3200.diff
          60 kB
          Camilla Haase
        46. DERBY-3200.stat
          0.3 kB
          Camilla Haase
        47. DERBY-3200.zip
          20 kB
          Camilla Haase
        48. DERBY-3200-2.diff
          59 kB
          Camilla Haase
        49. DERBY-3200-2.zip
          20 kB
          Camilla Haase
        50. DERBY-3200-3.diff
          74 kB
          Camilla Haase
        51. DERBY-3200-3.zip
          21 kB
          Camilla Haase
        52. DERBY-3200-4.diff
          77 kB
          Camilla Haase
        53. DERBY-3200-4.zip
          22 kB
          Camilla Haase
        54. DERBY-3200-5.diff
          80 kB
          Camilla Haase
        55. DERBY-3200-5.zip
          21 kB
          Camilla Haase
        56. DERBY-3200-6.diff
          91 kB
          Camilla Haase
        57. DERBY-3200-6.zip
          22 kB
          Camilla Haase
        58. DERBY-3200-7.diff
          12 kB
          Camilla Haase
        59. DERBY-3200-7.stat
          0.2 kB
          Camilla Haase
        60. DERBY-3200-7.zip
          20 kB
          Camilla Haase
        61. DERBY-3200-8.diff
          15 kB
          Camilla Haase
        62. DERBY-3200-8.stat
          0.2 kB
          Camilla Haase
        63. DERBY-3200-8.zip
          22 kB
          Camilla Haase
        64. rdevcsecuresqlauthembeddedex.dita
          19 kB
          Camilla Haase
        65. sqlauthclient.txt
          5 kB
          Camilla Haase
        66. sqlauthclientshutdown.txt
          10 kB
          Camilla Haase
        67. sqlauthembedded.txt
          8 kB
          Camilla Haase
        68. sqlauthembedded.txt
          8 kB
          Camilla Haase

        Issue Links

          Activity

            People

              chaase3 Camilla Haase
              chaase3 Camilla Haase
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: