Skip to content

[Merged by Bors] - Add support for LDAP authentication #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from

Conversation

sbernauer
Copy link
Member

@sbernauer sbernauer commented Jul 8, 2022

Description

Doesn't make to much sense without authZ, but that is another story. Trying to split that to keep PRs small.

TODOs:

  • Release operator-rs
  • Watch AuthenticationClass

I tried using multiple LoginIdentityProvider as follows but NIFI failed to start up

        <provider>
            <identifier>login-identity-provider</identifier>
            <class>org.apache.nifi.authentication.single.user.SingleUserLoginIdentityProvider</class>
            <property name="Username">sbernauer</property>
            <property name="Password">sbernauer</property>
        </provider>
        <provider>
            <identifier>login-identity-provider</identifier>
            <class>org.apache.nifi.ldap.LdapProvider</class>
            <property name="Authentication Strategy">{authentication_strategy}</property>

            <property name="Manager DN">xxx_ldap_bind_username_xxx</property>
            <property name="Manager Password">xxx_ldap_bind_password_xxx</property>

            <property name="Referral Strategy">THROW</property>
            <property name="Connect Timeout">10 secs</property>
            <property name="Read Timeout">10 secs</property>

            <property name="Url">{protocol}://{hostname}:{port}</property>
            <property name="User Search Base">{search_base}</property>
            <property name="User Search Filter">{search_filter}</property>

            <property name="TLS - Client Auth">NONE</property>
            <property name="TLS - Keystore">/stackable/keystore/keystore.p12</property>
            <property name="TLS - Keystore Password">secret</property>
            <property name="TLS - Keystore Type">PKCS12</property>
            <property name="TLS - Truststore">/stackable/keystore/truststore.p12</property>
            <property name="TLS - Truststore Password">secret</property>
            <property name="TLS - Truststore Type">PKCS12</property>
            <property name="TLS - Protocol">TLSv1.2</property>
            <property name="TLS - Shutdown Gracefully">true</property>

            <property name="Identity Strategy">USE_DN</property>
            <property name="Authentication Expiration">7 days</property>
        </provider>

Startup error

│ nifi 2022-07-27 13:52:22,343 INFO [NiFi logging handler] org.apache.nifi.StdOut Caused by: org.apache.nifi.authentication.exception.ProviderCreationException: The Authentication Expiration must be specified.                          │
│ nifi 2022-07-27 13:52:22,343 INFO [NiFi logging handler] org.apache.nifi.StdOut     at org.apache.nifi.ldap.LdapProvider.onConfigured(LdapProvider.java:79)

Which doesn't make any sense

Review Checklist

  • CRD change approved
  • Code contains useful comments
  • (Integration-)Test cases added (or not applicable)
  • Documentation added (or not applicable)
  • Changelog updated (or not applicable)
  • Cargo.toml only contains references to git tags (not specific commits or branches)
  • Helm chart can be installed and deployed operator works (or not applicable)

Once the review is done, comment bors r+ (or bors merge) to merge. Further information

@sbernauer sbernauer marked this pull request as ready for review July 8, 2022 08:16
@sbernauer sbernauer requested a review from a team July 8, 2022 09:41
@maltesander maltesander self-assigned this Jul 11, 2022
Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. One bigger thing, the create_reporting_task_job fails when using LDAP (because of the missing single user credentials):

cat: /stackable/adminuser/username: No such file or directory                                                   
cat: /stackable/adminuser/password: No such file or directory                                                   
usage: create_nifi_reporting_task.py [-h] -n NIFI_API_URL -u USERNAME -p                                        
                                     PASSWORD -v NIFI_VERSION -c CERT -m                                        
                                     METRICS_PORT [-t TASK_NAME]                                                
create_nifi_reporting_task.py: error: argument -u/--username: expected one argument

Not sure how, but it needs the right credentials from LDAP. Any idea how we can do that?

@sbernauer sbernauer requested a review from maltesander July 20, 2022 06:49
@sbernauer
Copy link
Member Author

The reporting job should now be fixed.

Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe talk to @siegfriedweber how and when we can release a new operator-rs tag?

@sbernauer sbernauer added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 21, 2022
@sbernauer
Copy link
Member Author

@maltesander could you please do one final review?
I released operator-rs and tried using multiple LoginIdentityProviders without success (put the error in the description)

@sbernauer sbernauer requested a review from maltesander July 28, 2022 11:19
Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sbernauer
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Aug 1, 2022
# Description

Doesn't make to much sense without authZ, but that is another story. Trying to split that to keep PRs small.

TODOs:

- [x] Release operator-rs
- [x] Watch AuthenticationClass

I tried using multiple LoginIdentityProvider as follows but NIFI failed to start up
```
        <provider>
            <identifier>login-identity-provider</identifier>
            <class>org.apache.nifi.authentication.single.user.SingleUserLoginIdentityProvider</class>
            <property name="Username">sbernauer</property>
            <property name="Password">sbernauer</property>
        </provider>
        <provider>
            <identifier>login-identity-provider</identifier>
            <class>org.apache.nifi.ldap.LdapProvider</class>
            <property name="Authentication Strategy">{authentication_strategy}</property>

            <property name="Manager DN">xxx_ldap_bind_username_xxx</property>
            <property name="Manager Password">xxx_ldap_bind_password_xxx</property>

            <property name="Referral Strategy">THROW</property>
            <property name="Connect Timeout">10 secs</property>
            <property name="Read Timeout">10 secs</property>

            <property name="Url">{protocol}://{hostname}:{port}</property>
            <property name="User Search Base">{search_base}</property>
            <property name="User Search Filter">{search_filter}</property>

            <property name="TLS - Client Auth">NONE</property>
            <property name="TLS - Keystore">/stackable/keystore/keystore.p12</property>
            <property name="TLS - Keystore Password">secret</property>
            <property name="TLS - Keystore Type">PKCS12</property>
            <property name="TLS - Truststore">/stackable/keystore/truststore.p12</property>
            <property name="TLS - Truststore Password">secret</property>
            <property name="TLS - Truststore Type">PKCS12</property>
            <property name="TLS - Protocol">TLSv1.2</property>
            <property name="TLS - Shutdown Gracefully">true</property>

            <property name="Identity Strategy">USE_DN</property>
            <property name="Authentication Expiration">7 days</property>
        </provider>
```
Startup error
```
│ nifi 2022-07-27 13:52:22,343 INFO [NiFi logging handler] org.apache.nifi.StdOut Caused by: org.apache.nifi.authentication.exception.ProviderCreationException: The Authentication Expiration must be specified.                          │
│ nifi 2022-07-27 13:52:22,343 INFO [NiFi logging handler] org.apache.nifi.StdOut     at org.apache.nifi.ldap.LdapProvider.onConfigured(LdapProvider.java:79)

```
Which doesn't make any sense
@bors
Copy link
Contributor

bors bot commented Aug 1, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Add support for LDAP authentication [Merged by Bors] - Add support for LDAP authentication Aug 1, 2022
@bors bors bot closed this Aug 1, 2022
@bors bors bot deleted the ldap-authentication branch August 1, 2022 07:29
vsupalov pushed a commit to stackabletech/druid-operator that referenced this pull request Nov 14, 2022
vsupalov pushed a commit to stackabletech/druid-operator that referenced this pull request Nov 15, 2022
vsupalov pushed a commit to stackabletech/druid-operator that referenced this pull request Nov 15, 2022
vsupalov pushed a commit to stackabletech/druid-operator that referenced this pull request Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants