OpanLdap password policies - openldap

I have installed the openldap version 2.4.23 on windows xp and using the apache DS as a client.I can authenticate users on a client server I set up for testing.
My next step is to turn on a password policy. This is where things have gotten a bit hazy for me and I'm hoping someone can help me out.
i added a password policy also by using the followin command
ldapadd -x -c -f -D "cn=Manager,dc=maxcrc,dc=com" -w secret
but after addition of password policies how do i make them in effect.
The openldap documentation says the password policy module should be configured with the DN of the default policy.
i added the following lines in slapd.conf file
# invokes password policies for this DIT only
overlay ppolicy
# Default ppolicy
ppolicy_default "cn=passwordDefault,ou=policies,dc=maxcrc,dc=com"
but somehow it is not getting loaded , i have already spent more a lot of time on this, but i am not getting the proper guide for the same.
Can anyone shed some light on this in plain, layman's terms?
Thanks in advance.
My ldif file is as follows.
dn: cn=passwordDefault,ou=policies,dc=localdomain,dc=com
objectClass: pwdPolicy
objectClass: person
objectClass: top
cn: passwordDefault
sn: passwordDefault
pwdAttribute: userPassword
pwdCheckQuality: 1
pwdMinAge: 1
pwdMaxAge: 90
pwdMinLength: 6
pwdInHistory: 4
pwdMaxFailure: 3
pwdFailureCountInterval: 0
pwdLockout: TRUE
pwdLockoutDuration: 0
pwdAllowUserChange: TRUE
pwdExpireWarning: 604800
pwdGraceAuthNLimit: 3
pwdMustChange: TRUE
pwdSafeModify: TRUE
after adding this policy and restarting the server i tried changing the password of existing as well as newly added users.
The server allows me to change the password to a string with length less than 6
whereas i have mentioned pwdMinLength: 6 in ldif.
as well as i tried changing the password more than once , but it allows me to change the password to recently used password, whereas the pwdInHistory: 4 in ldif.

The password policy doesn't work if you use the rootDN to execute the updates. You must use an existing admin account, or the user's own account.

It is not clear how you are setting the password when testing, but I would check if you are passing the password in the correct format, meaning that the server needs to receive the password in cleartext. Some clients would hash the value before sending the value to the OpenLDAP server, in which case it would be impossible for the OpenLDAP server to determine the length of password. The communication can and should be encrypted, but it shouldn't be pre-hashed. Hashing can be handled by the server:
pwdCheckQuality
If the value is 1 and the supplied password is in cleartext then a user supplied function (defined using the pwdCheckModule - if defined - will be called to check the password quality. If this function is not available then the password will be accepted (assuming it passes all the other tests defined by the various pwdPolicy attributes).
reference: http://www.zytrax.com/books/ldap/ch6/ppolicy.html

the rootdn bypass password policy, so do not use rootdn in your
ldappasswd command.
https://www.openldap.org/lists/openldap-technical/201102/msg00262.html
You can basically put any password (not empty thou) if setting passwords using ldappasswd and binding with rootdn.
It's a bit tricky situation since you cannot change the password with "passwd" command either for the user. In this case the password policy would kick in.
If you know the rootdn password, you can bypass everything.

Related

Encrypting the Web Console password in ActiveMQ

I have to get rid of the clear text password in ActiveMQ server in the jetty-realm.properties file as part of the security requirements of our project.
I followed the procedure for encrypting passwords found here: https://activemq.apache.org/encrypted-passwords.html.
In Jetty-real.properties I replaced plain password with ${activemq.password}
But I could not login into the web console (http://localhost:8161/admin)
Are there additional config parameters I need to change? Any help would be greatly appreciated.
For ecrypt password we can use jetty utility. This can be downloaded from http://download.eclipse.org/jetty/.
use:
java -cp lib/jetty-util-$JETTY_VERSION.jar org.eclipse.jetty.util.security.Password admin admin
admin
OBF:1u2a1toa1w8v1tok1u30
MD5:21232f297a57a5a743894a0e4a801fc3
CRYPT:adpexzg3FUZAk
Add in bus\conf\jetty.xml\jetty-realm.properties
admin: MD5:21232f297a57a5a743894a0e4a801fc3, admin
A very important note: the sequence of data specified by you should be as follows:
org.eclipse.jetty.util.security.Password [username] password
Also note that in some shells (like default on Ubuntu 20.04) the dollar sign inside the password will effectively truncate your password to the part preceding the dollar sign.
(I meant to put a comment to the answer by #dorin.canepa, but clicked on a wrong button and now it's an answer, oh well)

Apache Drill Plain Authentication throws Invalid Username/Password error

I have setup Apache Drill version 1.15 in distributed mode on 3 nodes with ZK on the same 3 nodes.
Now, I am trying to configure Plain Authentication in Drill using PAM.
I already have 2 existing users in the 3 nodes with same password and they are present in /etc/passwd and /etc/shadow.
I have followed the steps mentioned here, to configure authentication setup on the Drill cluster.
But, on entering correct username and password, it throws Invalid Username/Password error.
My drill-override.conf looks like:
drill.exec: {
cluster-id: "[cluster_name]",
zk.connect: "[host1]:2181,[host2]:2181,[host3]:2181"
security.user.auth: {
enabled: true,
packages += "org.apache.drill.exec.rpc.user.security",
impl: "pam",
pam_profiles: [ "sudo", "[profile1]", "[profile2]" ]
}
}
I have set, user1 as an admin and user2 as normal user.
Is it that Drill, doesnt work with existing Users in the linux system and wants users to be created explicitly (which i really doubt), or anything else that I am missing?
pam_profiles is array of PAM profiles, not users.
Example of pam_profiles configs: pam_profiles: [ "sudo", "login" ]. See details in doc.
You can add other PAM profiles from your /etc/pam.d.

ldap oclAccess does not seem to work with pwdPolicy

I have installed ldap 2.4.3 on Ubuntu 14.04. I have configured pwdPolicy overlay and it works when the users changes his/her own password and when admin changes the password. The problem is that when admin changes the password the policies are not adhered. So, I created another account called usermanagement and added the dn to oclAccess. I can modify all fields I've tried using the usermanagement account except for userpassword.
When running ldappasswd I get Insufficient access (50)
This is My olcAccess:
olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by dn="cn=admin,dc=zed,dc=com" write by dn="cn=usermanagement,dc=zed,dc=com" write by anonymous auth by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by self write by dn="cn=admin,dc=zed,dc=com" write by dn="cn=usermanagement,dc=zed,dc=com" write by * read
Edit
I have enabled debugging and then executed ldappasswd -H ldap://localhost -x -D "uid=luis,ou=users,dc=zed,dc=com" -W -S "uid=vixian,ou=users,dc=zed,dc=com". The log shows:
983c0f8 bdb_dn2entry("cn=passworddefault,ou=policies,dc=zed,dc=com")
5983c0f8 => bdb_entry_get: found entry: "cn=passworddefault,ou=policies,dc=zed,dc=com"
5983c0f8 bdb_entry_get: rc=0
5983c0f8 change password must use DELETE followed by ADD/REPLACE
5983c0f8 send_ldap_result: conn=1004 op=1 p=3
5983c0f8 send_ldap_result: err=50 matched="" text="Must supply old password to be changed as well as new one"
5983c0f8 send_ldap_extended: err=50 oid= len=0
5983c0f8 send_ldap_response: msgid=2 tag=120 err=50
I then tried to delete the userPassword using ldapmodify and it was successful but replacing or adding produced the same result permission denied.
I have updated the olcAccess following #ejp suggestion:
olcAccess: {0}to attrs=userPassword,shadowLastChange
by group/groupOfUniqueNames/uniqueMember.exact="cn=itinst,ou=groups,dc=zed,dc=com" write
by anonymous auth
by self write
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to *
by self write
by group/groupOfUniqueNames/uniqueMember.exact="cn=itinst,ou=groups,dc=zed,dc=com" write
by users read by anonymous search
The problem is that when admin changes the password the policies are not adhered.
When the managerDN changes the password 'the policies are not adhered'. You should not use the managerDN for anything. That's the account the server runs as, and it can do anything, of course. You should define a separate admin account in the DIT, and give it the appropriate access rights, as I have for the entire ldap admins group in the example below.
It doesn't have anything to do with your olcAccess. Have a look at the documentation for how to do this properly. I have:
olcAccess {0}to attrs=userPassword
by dn.base="cn=replicator,dc=verismart,dc=com,c=us" write
by group/groupOfUniqueNames/uniqueMember.exact="cn=ldap admins,ou=groups,dc=verismartlabs,dc=com" write
by group/groupOfUniqueNames/uniqueMember.exact="cn=applications,ou=groups,dc=verismartlabs,dc=com" write
by anonymous auth by self write
olcAccess {1}to dn.base="" by * read
olcAccess {2}to *
by self write
by dn.base="cn=replicator,dc=verismart,dc=com,c=us" write
by group/groupOfUniqueNames/uniqueMember.exact="cn=ldap admins,ou=groups,dc=verismartlabs,dc=com" write
by group/groupOfUniqueNames/uniqueMember.exact="cn=applications,ou=groups,dc=verismartlabs,dc=com" write
by users read
by anonymous search
EDIT As you're using the ppolicy overlay:
You should use the -e ppolicy argument to ldappasswd so you can see the extended response if any.
The user must also use the -a option to ldappasswd to specify the old password, as suggested by the log, or -A to get it to prompt you for it. The change log is saying change password must use DELETE followed by ADD/REPLACE, which means you have to supply both the old and the new password. ldappasswd will send a DELETE for the old one and an ADD or a REPLACE for the new value.
How you get the admin to do it without knowing the old password is another question, looking ... Works for me via an application, but I've never done it via ldappasswd. Maybe -e ppolicy is the answer to that too.
EDIT 2 It is because you have pwdSafeModify=TRUE in your password policy. This rather useless setting makes it impossible for administrators to reset passwords without knowing the old one, and if the old one was known there would be no need for the administrative reset at all. I have it turned off, but then all my passwords are changed only by Java code: one piece for the user himself, and another for the administrator, so I can enforce pwdSafeModify myself.

I cannot enable basic HTTP authentication in a SOAPInput node (Websphere Message Broker)

I have tried enabling http authentication to a SOAPInput node in my message flow, however it does not seem to take effect. I don't have to pass any credentials and I still get a reply. These are the steps I have taken:
1.) created a security profile with the following commands:
## Set up the security id
mqsisetdbparms DEV_ESB30_AP01 -n basicSecurityId -u user1 -p testPass1
## Set up the security profile
mqsicreateconfigurableservice DEV_ESB30_AP01 -c SecurityProfiles -o orsSecurityProfile -n "propagation,idToPropagateToTransport,transportPropagationConfig" -v "TRUE,STATIC ID,basicSecurityId"
2.) I set the security profile in the BAR to basicSecurityId
Am I missing something?
Did I define the security profile correctly?
This security profile authenticates correctly when used in a SOAPRequest node, but completely ignored in a SOAPInput node. Thanks for any help you can give.
You need to tell broker how to authenticate by setting and authentication provider in the security profile (ie/ LDAP, WS-TRUST).
The security profile you have posted just tells broker to put the ID in the properties folder, not actually to do anything with it.
Note that is it not currently possible to do both WS-Security and Basic Auth at the same time so if you have a policyset configured basic auth will not work.

How to change WebDAV password locally

I can't figure out how to change the webdav password. I've done some searching, found many resources of how to add a new user to webdav, but nothing about changing password. Anyone know?
Passwords are stored in webdav.htpasswd file.
If you open it, you will see an entry like this
wampp:XAMPP with WebDAV:bc7f2b670e7e965e307feb30492e642e
That's the entry for user wampp: in realm XAMPP with WebDAV: with password which is encrypted.
To change password, you should use htdigest.exe.
See manual. It is used to create and update user authentication files. You should find in the bin directory of xampp installation.
To do that, do :
htdigest.exe "pathto/webdav.htpasswd" "XAMPP with WebDAV" yourusername
This will be returned:
Adding user yourusername in realm "XAMPP with WebDAV"
You will then be asked for the password for yourusername
New password: yourpassword
Re-type new password: yourpassword
Reference: http://www.apachefriends.org/f/viewtopic.php?f=16&t=38897
Replace the content of the file C:\Program Files\xampp\security\htpasswd.webdav with your username, a colon and the password. Note: Everyone who can see this file can see the password!
Assuming you're talking about doing a password change at the server from a client, I don't believe WebDAV supports such a transaction.
You'd use something like a shell logon or a Web-based admin page to do this.
This always struck me as odd for a lot of network services, for example FTP or email. It seems to be common though.

Resources