Active Directory and LDAP
One connector covers LDAP directories. Under “Variant”, administrators define how the directory is structured:
| Property | Generic LDAP (ApacheDS) | OpenLDAP | Active Directory |
|---|---|---|---|
| Groups | groupOfNames, member | posixGroup, memberUid | group, member |
| Account ID | uid | uid | sAMAccountName |
| Unique ID | entryUUID | entryUUID | objectGUID |
| Lock | pwdAccountLockedTime | pwdAccountLockedTime | userAccountControl |
| Last logon | not preset | authTimestamp | lastLogonTimestamp, lastLogon |
Connection
The fields: “Host”, “Port”, “Base DN”, and “Bind DN” and “Bind password” of the service account. Under “Advanced” are “User Search Base” and “Group Search Base” – if left empty, the base DN applies – and “Use SSL (LDAPS)”. For Active Directory, further fields are added, including “AD domain” and “Initial Account State”. “Check status” signs in to the directory with the service account.
Through the SAP Cloud Connector
When Nova runs on SAP BTP Cloud Foundry and the directory sits in the customer network, Nova reaches it through the SAP Cloud Connector. The Nova app needs a binding to the Connectivity service for this. Under “Advanced”, set “Connection path” to “SAP Cloud Connector”; “Host” and “Port” are then the Cloud Connector's virtual host.
- LDAP: Expose it in the Cloud Connector with protocol TCP, for example
dc1.example.com:636. With “Use SSL (LDAPS)” the connection stays encrypted up to the domain controller. - Exchange: The same connection path applies; expose it in the Cloud Connector with protocol HTTPS and the resource
/PowerShell/. The Exchange address stays unchanged, for examplehttps://mail.example.com/PowerShell/; the Cloud Connector opens the connection to Exchange. - Location ID: Only needed when several Cloud Connectors are attached to the subaccount.
Without the binding, Nova reports an error and does not connect directly.
Accounts
Nova creates new accounts directly below the “User Search Base”: for Generic LDAP and OpenLDAP as uid=<account ID>, for Active Directory as cn=<name>. In Active Directory, Nova sets sAMAccountName to the account ID and userPrincipalName according to the “UPN rule”; without a rule a userPrincipalName row of the mapping applies, otherwise account ID@AD domain. The “Mail rule” fills the mail attribute for all variants. If “Initial Account State” is set to “Disabled”, a new AD account is created locked and stays locked until it is explicitly enabled. Nova writes further attributes according to the “Mapping”.
Nova finds accounts by uid or mail, in Active Directory by sAMAccountName, userPrincipalName or mail.
DN rule
Where and under which name an Active Directory account is created is decided by the DN row at the top of the Active Directory mapping (see Field mapping). The rule is an expression and yields the DN relative to the “User Search Base” or in full, for example per user type:
CN={{ user.last_name }}, {{ user.first_name }},OU={{ 'External' if user.user_type == 'external' else 'Employees' }}The comma in the CN needs no escaping; Nova escapes it and sets cn to the same value. If the rule repeats the OUs at the start of the “User Search Base” (rule …,OU=Users,OU=NOVA, base OU=Users,OU=NOVA,DC=nova,DC=de), Nova creates the account in the base itself and does not append the OUs twice. A DN outside the “User Search Base” is rejected because Nova searches for accounts from there. Without a DN row, cn=<name> in the “User Search Base” applies.
Manager
The manager attribute expects the DN of the manager's account. The mapping offers the source “Manager: DN of the account” for it: Nova takes the identity's manager (the “Manager” field, otherwise the head of the organisational unit), looks up that person's account on the same target system and sets its DN. If the manager has no account there, manager stays empty and the account carries a note; “Sync” fills it in once the account exists.
Sync after changes
When an identity changes, “Sync” on the account (Identity → Accounts) or the routine block “Sync account (system)” brings the AD account in line with the mapping: changed attributes, the manager, the mailbox properties and the DN. If the DN rule yields another name or container, Nova renames or moves the entry; the backend journal records the change as “rename”, and it can be reverted like any attribute change. Only differences are written; an empty value never clears.
The three steps of account creation
The routine blocks model account creation in the three steps many directories call for: “Create account (system)” – in a method nova.create_account(sys_id="AD", password_mode="none", mailbox_mode="none") – creates the account without a password and without a mailbox – Active Directory allows that only locked, so the account is created disabled (514) until “Enable account (system)” or the step “Set identity active” releases it –, “Set password (system)” generates a password from the system's ruleset (with “Force password change” the person must change it at first logon), “Create mailbox (Exchange)” creates the mailbox with the Exchange rows of the mapping.
Exchange mailboxes
An Active Directory target system can manage the Exchange mailboxes of its accounts as well. The mailbox is not a target system of its own but a property of the AD account: Nova creates it after the account and removes it before the account is deleted. Exchange has no LDAP interface for this; Nova uses Exchange remote PowerShell (Enable-Mailbox, Get-Mailbox, Disable-Mailbox) through the /PowerShell endpoint of a Mailbox server, https only. Nova talks to it over TLS 1.2 at most: /PowerShell asks for client certificates, which needs the server to renegotiate the TLS session, and TLS 1.3 does not allow that – under TLS 1.3 Exchange answers HTTP 500 before authentication. Nothing needs to change on the server.
The “Exchange” section of the target system holds the PowerShell address, the authentication (Basic over TLS, NTLM or Kerberos), a dedicated account (empty: the directory's bind account), optionally the server's CA certificate and the mailbox database. “Load databases” reads the databases of the saved system as a pick list; without a choice Exchange selects the database itself. The account needs the Exchange roles “Mail Recipient Creation”, “Mail Recipients” and “Distribution Groups” and must be enabled for remote PowerShell; nothing more is required, the health check too only reads the mailbox databases.
Saving creates the entitlement “Postfach (Exchange)” in the target system. It is assignable like a group, including through business roles and access requests: assigning it creates the mailbox, revoking it disables the mailbox. With “Mailbox with every new account” switched on, every account Nova creates gets a mailbox regardless of the entitlement. A mailbox failure does not prevent the account; it appears in the provisioning run and the log, and the entitlement can be applied again.
Exchange attributes in the mapping
Which database a mailbox lands on, whether it is visible in the address book, which size limits, archive and policy settings apply, are decisions per identity. For them the field mapping of the Active Directory flavour (Administration → Mapping → Target systems → Active Directory) has a second section Exchange below the directory attributes: the directory attribute on the right, the source on the left, as in every free mapping a Nova attribute, a fixed value or an expression, for example per user type:
homeMDB {{ 'MDB-EXT' if user.user_type == 'external' else 'MDB-01' }}
msExchHideFromAddressLists {{ 'true' if user.user_type == 'external' else 'false' }}Nova does not write these attributes to the directory itself. It passes the values to Enable-Mailbox and Set-Mailbox when the mailbox is created; Exchange sets from them the attributes other tools (such as SAP IdM with a mailbox template) write by hand:
| Target attribute | Value | Cmdlet parameter |
|---|---|---|
| homeMDB | mailbox database name, also as a DN | Enable-Mailbox -Database |
| msExchHomeServerName | server name, also as a legacy DN; without homeMDB Nova picks a mounted database on this server | (database choice) |
| mailNickname | alias | Enable-Mailbox -Alias |
| primary SMTP address (switches the address policy off) | Enable-Mailbox -PrimarySmtpAddress | |
| proxyAddresses | address list separated by ; – a blank does not separate (exactly one SMTP: primary, smtp: alias); Nova reports a malformed list as a warning and leaves it out; switches the address policy off unless msExchPoliciesIncluded is set | Set-Mailbox -EmailAddresses |
| msExchArchiveDatabaseLink | archive database name (set = archive on) | Enable-Mailbox -Archive -ArchiveDatabase |
| msExchMailboxTemplateLink | retention policy name | Enable-Mailbox -RetentionPolicy |
| msExchAddressBookPolicyLink | address book policy name | Enable-Mailbox -AddressBookPolicy |
| msExchHideFromAddressLists | yes/no (hide) | Set-Mailbox -HiddenFromAddressListsEnabled |
| showInAddressBook | yes/no (visible, its counterpart; Exchange fills in the address lists) | Set-Mailbox -HiddenFromAddressListsEnabled |
| mDBUseDefaults | yes/no | Set-Mailbox -UseDatabaseQuotaDefaults |
| mDBStorageQuota, mDBOverQuotaLimit, mDBOverHardQuotaLimit | size (“2 GB”, “unlimited”) | Set-Mailbox -IssueWarningQuota / -ProhibitSendQuota / -ProhibitSendReceiveQuota |
| msExchArchiveQuota, msExchArchiveWarnQuota | size | Set-Mailbox -ArchiveQuota / -ArchiveWarningQuota |
| msExchMailboxAuditEnable | yes/no | Set-Mailbox -AuditEnabled |
| msExchPoliciesIncluded | yes/no | Set-Mailbox -EmailAddressPolicyEnabled |
The section also lists the attributes Exchange computes itself (legacyExchangeDN, msExchVersion, msExchRecipientTypeDetails, msExchRecipientDisplayType, msExchMailboxGuid, msExchArchiveGUID, msExchUMDtmfMap, msExchMailboxSecurityDescriptor, msExchRBACPolicyLink, msExchUserAccountControl, msExchProvisioningFlags). They cannot be set; saving with such an attribute is rejected.
Rules:
- A row without a source leaves the property out; Exchange then applies its default (without
homeMDBthe database of the target system, otherwise Exchange's own choice). - When an identity changes, Nova applies the
Set-Mailboxproperties to the existing mailbox. The database is not moved; when it differs from the mapping, the account shows “expected” next to “actual”. - Should Exchange not fill an attribute in your environment, map it above among the directory attributes as a free mapping with a fixed value; Nova then writes it to the directory directly.
Locking an account leaves the mailbox in place; deleting the account disables it first, and Exchange keeps a disabled mailbox for its retention period. On an identity's accounts tab a badge shows the last state read (“Mailbox”, “No mailbox”), and the mailbox can be checked, created and disabled there. Reconciliation shows the mailbox like a group membership. Distribution lists are groups in Active Directory; Nova manages their members through the groups, mail-enabling them happens in Exchange.
Groups
Nova takes over groups as entitlements with a job of type “Import LDAP Groups”. Nova recognises a group by its unique ID, provided the directory supplies one. If the group is renamed or moved within the “Group Search Base”, Nova finds it again through this ID and updates the stored DN. Once the ID is known, Nova accepts only exactly this object: a newly created group with the old name or DN does not count as the same group.
Nova changes memberships one at a time; the other members of a group remain untouched. Generic LDAP does not maintain memberOf itself. There, Nova writes it in addition, provided the directory schema knows the attribute.
Nested groups
Nova reads the group structure. The “Add group” dialog on an account shows the subgroups and parent groups of each group. Nova does not derive assignments from nesting; for the check against the risk rule set, however, a member of a subgroup also holds the parent groups – see Segregation of duties. For Generic LDAP and Active Directory, administrators can nest groups in this dialog (“Add subgroup”) and remove nesting again. OpenLDAP groups (posixGroup) do not allow nesting.
Cycle protection: before Nova enters a group as a subgroup, it checks whether that group already contains the parent group, directly or across further levels. If it does, Nova does not make the change. The same applies if the check cannot be completed – for example because an object cannot be read or the limit of 64 levels, 512 reads or 5 seconds is reached. If the directory already contains a cycle, Nova shows a notice and does not run through the cycle repeatedly. The display reads at most 5,000 groups and 64 levels; if it is incomplete, Nova says so.
Passwords
- Active Directory: Nova writes
unicodePwd. The directory only accepts passwords over an encrypted connection; without “Use SSL (LDAPS)”, Nova refuses to set the password. - Generic LDAP and OpenLDAP: Nova uses the password modify operation according to RFC 3062 and, if the server does not support it, the
userPasswordattribute.
Locking
- Active Directory: Nova sets or clears the
ACCOUNTDISABLEbit inuserAccountControl; the other bits remain unchanged. - Generic LDAP and OpenLDAP: Nova locks permanently through the password policy attribute
pwdAccountLockedTimeand removes it to unlock. The password is kept; Nova reads the result back. This requires an active password policy – for OpenLDAP the ppolicy overlay – and the right to write this attribute.
Last logon
In Active Directory, Nova reads lastLogonTimestamp, otherwise lastLogon; for OpenLDAP authTimestamp, provided the directory maintains it. For Generic LDAP no attribute is preset; one can be specified in the configuration key last_logon_attrs.
Directory permissions required
The service account (“Bind DN”) needs:
- Read: accounts below the “User Search Base”; groups with their member attribute and unique ID below the “Group Search Base”; for Generic LDAP also the schema, to check
memberOf; for the last logon, the attributes named above. - Groups: write the member attribute (
memberormemberUid) on the groups Nova manages; for Generic LDAP alsomemberOfon the accounts. - Accounts: create, modify and delete below the “User Search Base”.
- Passwords: reset them – in Active Directory via
unicodePwd. - Locking: write
userAccountControlorpwdAccountLockedTime. - Nesting: write
memberon parent groups and read the subgroups involved.
Nova should connect via LDAPS (“Use SSL (LDAPS)”); Active Directory requires this for password operations.