Skip to content

Commit ee020f3

Browse files
authored
Document required AD ACLs (#541)
* Document required AD ACLs * Document how to configure the ACL rules manually * Add a warning about empty-looking ACL rules
1 parent 12e2807 commit ee020f3

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

docs/modules/secret-operator/pages/secretclass.adoc

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,56 @@ If the same AD domain _is_ shared between multiple Kubernetes clusters, the foll
219219
* The Kubernetes Nodes' names and fully qualified domain names
220220
* The Kubernetes Namespaces' names (only Namespaces that use Kerberos)
221221

222+
[#ad-acl]
223+
===== Access Control
224+
225+
The Secret Operator needs permission to create users in the configured base container
226+
(`kerberosKeytab.admin.activeDirectory.userDistinguishedName`), as well as to reset their passwords.
227+
228+
The easiest way to configure this is to run the following PowerShell script:
229+
230+
// FIXME: This script is copied from ad-init, can we share this somehow?
231+
232+
[source,powershell]
233+
----
234+
Import-Module ActiveDirectory
235+
# Change these variables to fit your environment
236+
$ou_path = "AD:OU=SDP,DC=sble,DC=test"
237+
$secretop = [System.Security.Principal.SecurityIdentifier]::New("S-1-5-21-1256652973-2063416196-3566311115-1103")
238+
239+
$acl = Get-ACL -Path $ou_path
240+
$user_schema_guid = "bf967aba-0de6-11d0-a285-00aa003049e2"
241+
$password_reset_right_guid = "00299570-246d-11d0-a768-00aa006e0529"
242+
$ou_create_children_rule = [System.DirectoryServices.ActiveDirectoryAccessRule]::New(
243+
$secretop,
244+
[System.DirectoryServices.ActiveDirectoryRights]::CreateChild,
245+
[System.Security.AccessControl.AccessControlType]::Allow,
246+
$user_schema_guid,
247+
[System.DirectoryServices.ActiveDirectorySecurityInheritance]::None
248+
)
249+
$ou_reset_passwords_rule = [System.DirectoryServices.ExtendedRightAccessRule]::New(
250+
$secretop,
251+
[System.Security.AccessControl.AccessControlType]::Allow,
252+
$password_reset_right_guid,
253+
[System.DirectoryServices.ActiveDirectorySecurityInheritance]::Children
254+
)
255+
$acl.AddAccessRule($ou_create_children_rule)
256+
$acl.AddAccessRule($ou_reset_passwords_rule)
257+
Set-ACL -Path $ou_path -AclObject $acl
258+
----
259+
260+
NOTE: The "reset passwords" rule created by the script will show up as applying no permissions in ADSI Edit.
261+
This is because ADSI Edit is unaware of the extended right that it grants. The rule _should not_ be
262+
deleted or modified manually, or the operator will break. If the rule has been tampered with, run the
263+
script again to fix the problem.
264+
265+
Alternatively, it can be configured manually using the graphical "ADSI Edit" tool. Secret Operator's user needs two permission rules
266+
on the base container:
267+
268+
- On the container itself: Create User objects
269+
- On descendants of the container: Reset Password (this is not visible in the GUI, but is granted by the "All extended rights" toggle)
270+
271+
222272
[#ad-samaccountname]
223273
===== Custom `samAccountName` generation
224274

@@ -273,7 +323,7 @@ spec:
273323
passwordCacheSecret:
274324
namespace: default
275325
name: secret-operator-ad-passwords
276-
userDistinguishedName: CN=Users,DC=sble,DC=test
326+
userDistinguishedName: OU=SDP,DC=sble,DC=test
277327
schemaDistinguishedName: CN=Schema,CN=Configuration,DC=sble,DC=test
278328
adminKeytabSecret:
279329
namespace: default
@@ -290,8 +340,8 @@ spec:
290340
`kerberosKeytab.admin.activeDirectory.ldapServer`:: An AD LDAP server, such as the AD Domain Controller. This _must_ match the server's FQDN, or GSSAPI authentication will fail.
291341
`kerberosKeytab.admin.activeDirectory.ldapTlsCaSecret`:: Reference (`name` and `namespace`) to a K8s `Secret` object containing the TLS CA (in `ca.crt`) that the LDAP server's certificate should be authenticated against.
292342
`kerberosKeytab.admin.activeDirectory.passwordCacheSecret`:: Reference (`name` and `namespace`) to a K8s `Secret` object where workload passwords will be stored. This _must not_ be accessible to end users.
293-
`kerberosKeytab.admin.activeDirectory.userDistinguishedName`:: The root Distinguished Name (DN) where service accounts should be provisioned, typically `CN=Users,\{domain_dn\}`.
294-
`kerberosKeytab.admin.activeDirectory.schemaDistinguishedName`:: The root Distinguished Name (DN) for AD-managed schemas, typically `CN=Schema,CN=Configuration,\{domain_dn\}`.
343+
`kerberosKeytab.admin.activeDirectory.userDistinguishedName`:: The root Distinguished Name (DN) of the container where service accounts should be provisioned, such as `OU=SDP,\{domain_dn\}`.
344+
`kerberosKeytab.admin.activeDirectory.schemaDistinguishedName`:: The root Distinguished Name (DN) of the container for AD-managed schemas, typically `CN=Schema,CN=Configuration,\{domain_dn\}`.
295345
`kerberosKeytab.adminKeytabSecret`:: Reference (`name` and `namespace`) to a K8s `Secret` object where a keytab with administrative privileges is stored in the key `keytab`.
296346
`kerberosKeytab.adminPrincipal`:: The name of the Kerberos principal to be used by the Secret Operator. This should be provided by the Kerberos administrator. The credentials for this principal must be stored in the keytab (`adminKeytabSecret`).
297347

0 commit comments

Comments
 (0)