banshee est en développement actif : les collecteurs vont encore changer, et une version que vous publiez demandera sans doute des ajustements. Pour un usage stable, attendez la version 1.0.0.

Active Directory

banshee/active-directory-collection/active-directory/ssh/

krbtgt

The age of the password of the krbtgt accounts of a domain, by SSH, PowerShell and LDAP

  • active-directory
  • kerberos
  • krbtgt
  • password
  • ssh
  • powershell

par banshee1 installation2 versions

Age of the krbtgt password, by SSH

Returns the age, in days, of the password of each krbtgt account of the domain of a domain controller: the key that signs every Kerberos ticket of the domain. A ticket forged with a stolen copy of that key stays valid as long as the key is not changed. Two watches are proposed, both checked: a password too old, and the account krbtgt not found.

How it works

The collector runs one PowerShell command that searches the directory over LDAP, on the domain controller itself, for the users whose sAMAccountName starts with krbtgt:

powershell -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding; $computer = Get-CimInstance Win32_ComputerSystem; $server = $computer.DNSHostName + '.' + $computer.Domain; $rootDSE = [ADSI]('LDAP://' + $server + '/RootDSE'); $domain = [ADSI]('LDAP://' + $server + '/' + $rootDSE.Properties['defaultNamingContext'][0]); $searcher = New-Object DirectoryServices.DirectorySearcher($domain, '(&(objectCategory=person)(objectClass=user)(sAMAccountName=krbtgt*))', @('sAMAccountName', 'pwdLastSet')); $now = [DateTime]::UtcNow; $accounts = @($searcher.FindAll() | ForEach-Object { @{name = [string]$_.Properties['samaccountname'][0]; days = [long]($now - [DateTime]::FromFileTimeUtc([long]$_.Properties['pwdlastset'][0])).TotalDays} }); ConvertTo-Json -Compress -Depth 4 -InputObject @{accounts = $accounts}"
  • The search starts at the domain, defaultNamingContext of the RootDSE of the domain controller, and reads two attributes of the schema of Active Directory: sAMAccountName and pwdLastSet, the time of the last change of the password, in hundreds of nanoseconds since 1 January 1601 UTC. The age is counted in whole days, on the domain controller.
  • The accounts found are krbtgt, the key of the domain, and krbtgt_<number>, the key of each read-only domain controller; any other account whose name starts with krbtgt is returned too.
  • No krbtgt account found stops the collector as misconfigured, as does an answer that is not the expected JSON.

Nothing is written to the Windows or to the directory: the command only reads. Changing the krbtgt password is the work of an administrator, twice, a replication apart.

Prerequisites

  • A domain controller running Windows Server 2012 or later, with Windows PowerShell 3.0 or later.
  • The OpenSSH server of Windows, installed and started, its default shell left at cmd.exe, the Windows firewall open to the poller on TCP 22, and the fingerprint of its host key set in protocol:ssh:fingerprint unless the Security settings trust the first SSH fingerprint presented: the steps are those of the windows/ssh/services collector of banshee/windows-collection.
  • An account of the domain for monitoring, without administrator rights, set in protocol:ssh:user, with its password in protocol:ssh:password or its key in protocol:ssh:private-key. No group is given here (see Limits).

Outputs

NameLabelUnitPer instance
agePassword agedyes, per account

Watches

NameTitleKindDefaultsChecked by default
oldkrbtgt password oldhigh threshold, on agewarning above 180 d, critical above 365 dyes
missingkrbtgt account missingexpected instances, on agecritical when krbtgt is not foundyes

Limits

  • Not yet checked on a real domain controller: the execution; that an account of the domain without administrator rights reads pwdLastSet of the krbtgt accounts. The accounts are protected by AdminSDHolder, whose rights a domain may have narrowed. If it may not, the collector stops as misconfigured, or returns no account; the right to read the attribute is then given to the account on those objects, never by making it an administrator. Which right lets an account that is not an administrator open an SSH session on a domain controller.