Giter VIP home page Giter VIP logo

nifi-file-identity-provider-bundle's Introduction

Build Status

NiFi File Identity Provider

An identity provider for Apache NiFi 1.0.0 or later, providing authentication of users based on username/password credentials. Credentials are stored in a local file with Bcrypt-hashed passwords. This may be suitable for environments without LDAP or Kerberos, or when X.509 client certificates are impractical.

Use

To install and use this provider you must complete the following steps:

  1. Build the provider NAR file
  2. Deploy the provider NAR file to your NiFi installation
  3. Configure NiFi for HTTPS
  4. Configure the File Authorization Provider login-identity-providers.xml
  5. Identity of the File Authorization Provider must be set in nifi.properties
  6. Users and their Bcrypt-hashed passwords must be added to login-credentials.xml

Build

Build this package with:

mvn clean package

You will need to deploy the resulting NAR file from the nifi-file-identity-provider-nar/target directory (NAR file will look like nifi-file-identity-provider-nar-1.0.0.nar).

Deploy

The provider NAR file should be deployed to your NiFi's lib directory.

Configure NiFi for HTTPS

NiFi must be configured for HTTPS, including at least the following settings in nifi.properties:

  • nifi.web.https.port
  • nifi.security.keystore
  • nifi.security.keystoreType
  • nifi.security.keystorePasswd
  • nifi.security.keyPasswd
  • nifi.security.truststore
  • nifi.security.truststoreType
  • nifi.security.truststorePasswd

Please see the NiFi Administration Guide for more information on secure access configurations.

Configure the File Identity Provider

The following Login Identity Provider configuration should be added to login-identity-providers.xml:

<provider>
    <identifier>file-identity-provider</identifier>
    <class>com.batchiq.nifi.authentication.file.FileIdentityProvider</class>
    <property name="Credentials File">conf/login-credentials.xml</property>
    <property name="Authentication Expiration">12 hours</property>
</provider>

Configure NiFi to Use the File Identity Provider

After the provider itself is configured, reference this provider in nifi.properties.

nifi.security.user.login.identity.provider=file-identity-provider

Initialize User Credentials

User credentials must be initialized in the credentials store file conf/login-credentials.xml. This is an XML file with the following format:

<!--
    This file contains users and their hashed passwords. Please see the
    com.batchiq.nifi.authentication.file.CredentialsStore for details.

    User Format:
    name - must match the "identity" in authorized-users.xml
    passwordHash - hashed passwords in Bcrypt 2a format / 10 rounds, looks
      like "$2a$10$24wB0UAUsRbOXz4KRZ5KlenzcEddnhIyXMyPkpTnS/29Tt12jfJJW"
-->
<credentials>
    <!--
    <user name="admin" passwordHash="(reset to populate)" />
    -->
</credentials>

Generating Bcrypt-hashed Passwords

Any tool capable of generating Bcyrpt type 2a hashed passwords may be used. This package includes a simple command-line utility in the PasswordHasherCLI class (see below). Additional known compatible tools and APIs include:

CLI Tool

This package includes a command-line tool for simple operations on users and passwords. Use of this tool is not required, it is possible to administer users with a text editor and any tool capable of generating Bcrypt 2a hashes.

The JAR file nifi-file-identity-provider-1.0.0-cli.jar is output in the nifi-file-identity-provider/target directory.

Add a user, you will be prompted for a password:

>java -jar nifi-file-identity-provider-1.0.0-cli.jar add credentials.xml jane
Password for jane: ****
Added user jane

Reset password, you will be prompted for password:

>java -jar nifi-file-identity-provider-1.0.0-cli.jar reset credentials.xml jane
New Password for jane:
Password reset for user jane

List users

>java -jar nifi-file-identity-provider-1.0.0-cli.jar list credentials.xml
john
jane
frank

Delete user

>java -jar nifi-file-identity-provider-1.0.0-cli.jar remove credentials.xml frank
Removed user frank

License

Apache License 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.