Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14271

Validate PEM files are not world readable

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Security
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Today, we validate that the security key file is not world readable. We should add similar checks to the PEM key file, and other private secrets.

      See src/mongo/db/auth/security_key.cpp for an example.

      #if !defined(_WIN32)
              // check permissions: must be X00, where X is >= 4
              if ((stats.st_mode & (S_IRWXG|S_IRWXO)) != 0) {
                  log() << "permissions on " << filename << " are too open" << endl;
                  return false;
              }
      #endif
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: