Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-10425

nifi.security.autoreload.enabled feature doesn't work with symlink

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-M1
    • None
    • None

    Description

       On a NiFi running on K8S. The certificates are provided by a secret to the pods, so to allow NiFi to reload them when they are updated, I set the nifi.security.autoreload.enabled flag to true. But the secret mounting mechanism makes that there is a set of symlink and the scanner that keeps track of the certificates considers that the certificates are deleted and not updated. Because instead of keeping track of the file through the symlink it keeps track of the file pointed by the symlink.  So when the secret is updated the certificates is deleted and created into another folder and the symlink is updated. But for the Scanner the file has been deleted. So it stops keeping track of it and does not reload the certificate.

      To illustrate my point:

      • At the start, the pyramid is like that: truststore.jks [Symlink] -> ..data/truststore.jks  [Symlink] -> ..2022_08_31_19_45_44.079808492/truststore.jks
      • After the update, the pyramid is like that:  truststore.jks [Symlink] -> ..data/truststore.jks  [Symlink] -> ..<NEW_TIMESTAMP>/truststore.jks

      The symlink still references a right file but as the "real" file changed of directory the scanner considers that the file has been deleted and therefore stop keeping track of it.

      The Scanner from Jetty will by default have the parameter reportRealPaths set to true. If set to true, the listener used by the Scanner are called with the real path of scanned files. So the parameter should be set to false.

      Attachments

        Issue Links

          Activity

            People

              emilio.setiadarma Emilio Setiadarma
              juldrixx Julien G.
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m