logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

krb5-sync-backend - Manipulate Kerberos password and status change queue

Author

       Russ Allbery <eagle@eyrie.org>

Description

krb5-sync-backend provides an interface to the queue of pending password and account status changes
       written by either this utility or by the synchronization plugin after failures.  It can queue account
       enables, disables, or password changes for Active Directory, list the queued actions, or process the
       queued actions with krb5-sync (telling it to take its action from a file).

       The queue directory will contain files with names in the format:

           <username>-<domain>-<action>-<timestamp>-<count>

       where <username> is the name of the affected account ("/" will be replaced with "." in the file name and
       the realm will be removed), <domain> is "ad", <action> is either "enable" (used for both enabling and
       disabling accounts) or "password", <timestamp> is a ISO 8601 timestamp in UTC, and <count> is a two-digit
       zero-padded number between 0 and 99 (so that we can handle multiple changes that arrive in the same
       second).  Each file contains a queued change in the format described in krb5-sync(8).

       Supported arguments to krb5-sync-backend are:

       disable user
           Queue a disable action (in Active Directory, as that's the only system currently supported for enable
           and disable) for user.

       enable user
           Queue an enable action (in Active Directory, as that's the only system currently supported for enable
           and disable) for user.

       help
           List the supported commands.

       list
           List the current contents of the queue.

       manual
           Display this documentation.

       process
           Process  the  queue.   All queued actions will be sorted alphanumerically (which due to the timestamp
           means that all changes for a particular user of a particular type will be done in the order  queued).
           krb5-sync will be called for each queued action, as long as it continues to succeed.  If it fails for
           a  queued action, all other actions sharing the same username, domain, and action will be skipped and
           queue processing will continue with the next action that differs in one of those three parameters.

       password user ad < password
           Queue a password change for user in  Active  Directory,  setting  their  password  to  password.   By
           default, password is read from standard input.  It can also be passed as a command-line argument, but
           this  is  less  secure  since  the  password is then readable by anyone on the system who can see the
           command-line arguments of processes.

           The entire standard input is taken as the password, including any trailing newlines,  so  be  careful
           how  the  password  is  provided.   If  using  something  like  echo, use "echo -n" or the "\c" flag,
           depending on your system.

       purge days
           Delete all queued actions last modified longer than days days ago.  This can be used to clean up  old
           failed  change  propagations  in  situations  where  accounts may be created or have password changes
           queued that are later removed and never created in other environments.

Files

/usr/sbin/krb5-sync
           The path to the krb5-sync utility.  This may be changed at the top of this script.

       /var/spool/krb5-sync
           The default path to the queue.  This must match the queue_dir parameter  in  krb5.conf  used  by  the
           plugin.  It can be changed at the top of this script.

       /var/spool/krb5-sync/.lock
           An  empty  file used for locking the queue.  When writing to or querying the queue, krb5-sync-backend
           will open and lock this file with the Perl flock function, which normally calls flock(2).  Any  other
           queue writers need to use the same locking mechanism for safe operation.

Name

       krb5-sync-backend - Manipulate Kerberos password and status change queue

Options

       Options must be specified after the command.

       -dqueue, --directory=queue
           Use queue as the queue directory instead of the default of /var/spool/krb5-sync.  This  also  changes
           the lock file accordingly.  This option is supported for all commands except "help" and "manual".

       -s, --silent
           This  option is only allowed for the "process" command.  Filter out the output of krb5-sync to ignore
           common errors and success messages and only show uncommon errors.  This option will  filter  out  all
           output  when  krb5-sync  is  successful and will filter out error messages that normally indicate the
           account is missing in Active Directory.  The regexes can be modified at the start of this script.

See Also

krb5-sync(8)

       The    current    version    of    this    program    is    available    from    its    web    page    at
       <http://www.eyrie.org/~eagle/software/krb5-sync/>.

3.1                                                2015-08-19                               KRB5-SYNC-BACKEND(8)

Synopsis

krb5-sync-backend (help|manual)

       krb5-sync-backend (disable|enable) [-dqueue] userkrb5-sync-backend list [-dqueue]

       krb5-sync-backend process [-s] [-dqueue]

       krb5-sync-backend password [-dqueue] user ad < passwordkrb5-sync-backend purge [-dqueue] days

See Also