Derby
  1. Derby
  2. DERBY-5363

Tighten permissions of DB files to owner with >= JDK7

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.9.1.0
    • Component/s: Miscellaneous, Services, Store
    • Labels:
      None
    • Issue & fix info:
      Release Note Needed
    • Bug behavior facts:
      Security

      Description

      Before Java 6, files created by Derby would have the default
      permissions of the operating system context. Under Unix, this would
      depend on the effective umask of the process that started the Java VM.

      In Java 6 and 7, there are methods available that allows tightening up this
      (File.setReadable, setWritable), making it less likely that somebody
      would accidentally run Derby with a too lenient default.

      I suggest we take advantage of this, and let Derby by default (in Java
      6 and higher) limit the visibility to the OS user that starts the VM,
      e.g. on Unix this would be equivalent to running with umask 0077. More
      secure by default is good, I think.

      We could have a flag, e.g. "derby.storage.useDefaultFilePermissions"
      that when set to true, would give the old behavior.

      1. permission-5.diff
        19 kB
        Dag H. Wanvik
      2. permission-5.stat
        1 kB
        Dag H. Wanvik
      3. z.sql
        1 kB
        Rick Hillegas
      4. permission-6.diff
        35 kB
        Dag H. Wanvik
      5. permission-6.stat
        2 kB
        Dag H. Wanvik
      6. derby-5363-basic-1.diff
        78 kB
        Dag H. Wanvik
      7. derby-5363-basic-1.stat
        3 kB
        Dag H. Wanvik
      8. property-table.png
        53 kB
        Dag H. Wanvik
      9. derby-5363-basic-2.diff
        70 kB
        Dag H. Wanvik
      10. derby-5363-basic-2.stat
        2 kB
        Dag H. Wanvik
      11. derby-5363-basic-3.diff
        68 kB
        Dag H. Wanvik
      12. derby-5363-basic-3.stat
        2 kB
        Dag H. Wanvik
      13. derby-5363-server-1.diff
        4 kB
        Dag H. Wanvik
      14. derby-5363-full-1.diff
        106 kB
        Dag H. Wanvik
      15. derby-5363-full-1.stat
        3 kB
        Dag H. Wanvik
      16. derby-5363-full-2.diff
        106 kB
        Dag H. Wanvik
      17. derby-5363-full-2.stat
        3 kB
        Dag H. Wanvik
      18. releaseNote.html
        5 kB
        Dag H. Wanvik
      19. releaseNote.html
        5 kB
        Dag H. Wanvik
      20. releaseNote.html
        5 kB
        Rick Hillegas
      21. releaseNote.html
        5 kB
        Dag H. Wanvik
      22. derby-5363-full-3.diff
        107 kB
        Dag H. Wanvik
      23. derby-5363-full-3.stat
        3 kB
        Dag H. Wanvik
      24. derby-5363-full-4.diff
        102 kB
        Dag H. Wanvik
      25. derby-5363-full-4.stat
        3 kB
        Dag H. Wanvik
      26. derby-5363-full-5.diff
        101 kB
        Dag H. Wanvik
      27. derby-5363-full-5.stat
        3 kB
        Dag H. Wanvik
      28. derby-5363-followup.diff
        1 kB
        Dag H. Wanvik
      29. derby-5363-limit-to-java7.diff
        2 kB
        Dag H. Wanvik
      30. derby-5363-limit-to-java7.stat
        0.1 kB
        Dag H. Wanvik
      31. releaseNote.html
        5 kB
        Dag H. Wanvik
      32. derby-5363-followup-linux.diff
        18 kB
        Dag H. Wanvik
      33. derby-5363-followup-linux.diff
        25 kB
        Dag H. Wanvik
      34. derby-5363-limit-to-java7b.diff
        2 kB
        Dag H. Wanvik
      35. derby-5363-limit-to-java7b.stat
        0.1 kB
        Dag H. Wanvik
      36. releaseNote.html
        6 kB
        Dag H. Wanvik
      37. derby-5363-followup-unix.diff
        17 kB
        Dag H. Wanvik
      38. derby-5363-followup-unix.stat
        1 kB
        Dag H. Wanvik
      39. derby-5363-followup-unix.diff
        17 kB
        Dag H. Wanvik
      40. releaseNote.html
        6 kB
        Rick Hillegas

        Issue Links

        There are no Sub-Tasks for this issue.

          Activity

          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-6521 [ DERBY-6521 ]
          Gavin made changes -
          Workflow jira [ 12624028 ] Default workflow, editable Closed status [ 12802476 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-6258 [ DERBY-6258 ]
          Kathey Marsden made changes -
          Link This issue relates to DERBY-6209 [ DERBY-6209 ]
          Kathey Marsden made changes -
          Link This issue relates to DERBY-6160 [ DERBY-6160 ]
          Rick Hillegas made changes -
          Attachment releaseNote.html [ 12527499 ]
          Kim Haase made changes -
          Link This issue is related to DERBY-5442 [ DERBY-5442 ]
          Kathey Marsden made changes -
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Dag H. Wanvik made changes -
          Link This issue incorporates DERBY-5492 [ DERBY-5492 ]
          Dag H. Wanvik made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Issue & fix info Release Note Needed,Patch Available [ 10101,10102 ] Release Note Needed [ 10101 ]
          Resolution Fixed [ 1 ]
          Dag H. Wanvik made changes -
          Issue & fix info Release Note Needed [ 10101 ] Patch Available,Release Note Needed [ 10102,10101 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-followup-unix.diff [ 12498075 ]
          Attachment derby-5363-followup-unix.stat [ 12498076 ]
          Attachment derby-5363-followup-unix.diff [ 12498077 ]
          Dag H. Wanvik made changes -
          Attachment releaseNote.html [ 12497819 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-limit-to-java7b.diff [ 12497816 ]
          Attachment derby-5363-limit-to-java7b.stat [ 12497817 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-followup-linux.diff [ 12497741 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-followup-linux.diff [ 12497735 ]
          Dag H. Wanvik made changes -
          Summary Tighten default permissions of DB files with >= JDK7 Tighten permissions of DB files to owner with >= JDK7
          Dag H. Wanvik made changes -
          Summary Tighten default permissions of DB files with >= JDK6 Tighten default permissions of DB files with >= JDK7
          Dag H. Wanvik made changes -
          Attachment releaseNote.html [ 12497492 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-limit-to-java7.diff [ 12497483 ]
          Attachment derby-5363-limit-to-java7.stat [ 12497484 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-followup.diff [ 12497183 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-followup.diff [ 12497182 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-followup.diff [ 12497182 ]
          Dag H. Wanvik made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Kathey Marsden made changes -
          Link This issue relates to DERBY-5434 [ DERBY-5434 ]
          Dag H. Wanvik made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info Patch Available,Release Note Needed [ 10102,10101 ] Release Note Needed [ 10101 ]
          Resolution Fixed [ 1 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-full-5.diff [ 12496501 ]
          Attachment derby-5363-full-5.stat [ 12496502 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-full-4.diff [ 12496061 ]
          Attachment derby-5363-full-4.stat [ 12496062 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-full-3.diff [ 12495270 ]
          Attachment derby-5363-full-3.stat [ 12495271 ]
          Dag H. Wanvik made changes -
          Attachment releaseNote.html [ 12495269 ]
          Rick Hillegas made changes -
          Attachment releaseNote.html [ 12495238 ]
          Dag H. Wanvik made changes -
          Attachment releaseNote.html [ 12495141 ]
          Dag H. Wanvik made changes -
          Attachment releaseNote.html [ 12495139 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-full-2.diff [ 12494601 ]
          Attachment derby-5363-full-2.stat [ 12494602 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-full-1.diff [ 12494321 ]
          Attachment derby-5363-full-1.stat [ 12494322 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-server-1.diff [ 12493264 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-server-1.diff [ 12493263 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-server-1.diff [ 12493263 ]
          Dag H. Wanvik made changes -
          Comment [ Uploading version #3 of the basic patch, which addresses Knut's comments, and also simplifies interrupt handling. More analysis showed its probably OK to ignore the remaining checked exceptions at the lowest level.
          The new version, if on Java 7, tries to use Posix fiel attribues view if present and do the restrictions through the ACL interface. This makes the patch not reliant on the platform, e.g an NFS share on Windows should work ok too.
          Rerunning regression tests. ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-basic-3.stat [ 12493094 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-basic-3.diff [ 12493095 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-basic-3.diff [ 12493095 ]
          Attachment derby-5363-basic-3.stat [ 12493096 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-basic-3.diff [ 12493093 ]
          Attachment derby-5363-basic-3.stat [ 12493094 ]
          Dag H. Wanvik made changes -
          Component/s Miscellaneous [ 11400 ]
          Component/s Services [ 11415 ]
          Component/s Store [ 11412 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Release Note Needed] [Patch Available, Release Note Needed]
          Dag H. Wanvik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-basic-2.diff [ 12492566 ]
          Attachment derby-5363-basic-2.stat [ 12492567 ]
          Dag H. Wanvik made changes -
          Attachment property-table.png [ 12492141 ]
          Dag H. Wanvik made changes -
          Attachment derby-5363-basic-1.diff [ 12492129 ]
          Attachment derby-5363-basic-1.stat [ 12492130 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Release Note Needed, Patch Available] [Release Note Needed]
          Dag H. Wanvik made changes -
          Attachment permission-6.diff [ 12490019 ]
          Attachment permission-6.stat [ 12490020 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Release Note Needed] [Patch Available, Release Note Needed]
          Rick Hillegas made changes -
          Attachment z.sql [ 12489853 ]
          Dag H. Wanvik made changes -
          Field Original Value New Value
          Attachment permission-5.diff [ 12489777 ]
          Attachment permission-5.stat [ 12489778 ]
          Dag H. Wanvik created issue -

            People

            • Assignee:
              Dag H. Wanvik
              Reporter:
              Dag H. Wanvik
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development