Bug 31649 - Joinscript fails to create dns-service account as Samba4 rejects simplistic password
Joinscript fails to create dns-service account as Samba4 rejects simplistic p...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 3.1-1-errata
Assigned To: Arvid Requate
Stefan Gohmann
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-05 11:39 CEST by Arvid Requate
Modified: 2013-06-19 14:34 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2013-06-05 11:39:08 CEST
The joinscript 98univention-samba4-dns failed in one project environment to create dns-service account as Samba4 rejected a simplistic password (contained only characters IIRC). We schould insure that the password is complex enough, as we do e.g. in setup-s4.sh. Maybe later this can be solved generically via Bug 31281.
Comment 1 Arvid Requate univentionstaff 2013-06-06 18:59:40 CEST
This happened again in UCS@school 3.1R2 tests. The impact is more severe in UCS@school since local user creation is disabled later:

=========================================================================
RUNNING 96univention-samba4slavepdc.inst
Waiting for RID Pool replication: done.
ERROR(ldb): Failed to add user 'dns-slave32':  - 0000052D: Constraint violation - check_password_restrictions: the password does not meet the complexity criteria!
EXITCODE=0
[...]

RUNNING 98univention-samba4-dns.inst
Waiting for RID Pool replication: done.
univention_samaccountname_ldap_check: ldb_add of user and group object is disabled
[...]

RUNNING 98univention-samba4slavepdc-dns.inst
dns_tkey_negotiategss: TKEY is unacceptable 
dns_tkey_negotiategss: TKEY is unacceptable 
dns_tkey_negotiategss: TKEY is unacceptable 
=========================================================================
Comment 2 Arvid Requate univentionstaff 2013-06-06 19:02:37 CEST
The good news is, that we just need to fix create_spn_account.sh in univention-samba4, and we don't need to fix 96univention-samba4slavepdc.inst or any other UCS@school specific package.
Comment 3 Arvid Requate univentionstaff 2013-06-11 19:06:58 CEST
The script now uses the generate_random_password python function from samba, which assures that Microsoft/Samba password complexity criteria are met.

* To test repeatedly with UCS, the machine should be reverted. Otherwise the follwing commands might be useful:
======================================================================
eval "$(ucr shell)"
udm users/user delete --dn "uid=dns-$hostname,cn=users,$ldap_base"
sed -i '/^univention-samba4-dns/d'  /var/univention-join/status
univention-run-join-scripts
ldbsearch -H /var/lib/samba/private/secrets.ldb \
    "samaccountname=dns-$hostname" secret | sed -n 's/^secret: //p' \
   | kinit --password-file=STDIN "dns-$hostname" && echo ok
======================================================================

* To test repeatedly with an UCS@school Samba4 Slave PDC, it's better to revert master+slave. Otherwise the following two commands must be used additionally to the above, to "unjoin" also libunivention-ldb-modules:
======================================================================
eval "$(ucr shell)"
/usr/share/univention-samba4/scripts/register_ldb_module.py \
   -H /var/lib/samba/private/sam.ldb --ignore-exists \
   --remove $samba4_ldb_sam_module_prepend
sed -i '/^libunivention-ldb-modules/d'  /var/univention-join/status
======================================================================


Advisory: 2013-06-10-univention-samba4.yaml

The fix has not been merged into ucs_3.2-0 because Bug 31281 addresses this problem more generally.
Comment 4 Stefan Gohmann univentionstaff 2013-06-19 07:40:54 CEST
I've added a test case:
 /usr/share/ucs-test/51_samba4/53create_spn_account

3.1-1: OK
YAML: OK
3.2: OK, through Bug #31281 
Changelog: Failed: not found
Comment 5 Stefan Gohmann univentionstaff 2013-06-19 11:40:49 CEST
(In reply to Stefan Gohmann from comment #4)
> Changelog: Failed: not found

Is not necessary.
Comment 6 Stefan Gohmann univentionstaff 2013-06-19 11:41:03 CEST
Verified
Comment 7 Janek Walkenhorst univentionstaff 2013-06-19 14:34:59 CEST
http://errata.univention.de/ucs/3.1/129.html