Showing posts with label Utilities. Show all posts
Showing posts with label Utilities. Show all posts

Wednesday, October 28, 2015

Utilities: Access Manager's Analyze Wizard

Background

Maintenance activities are part of any IT professional's basic tasks, and Centrify provides many tools for administrators to facilitate proper maintenance and cleanup of Centrify-related objects in Active Directory;  as a matter of fact, it's expected that any customer of Active Directory maintains basic "etiquette" like:

  • alignment with established naming conventions:  for example;  in the context of a computer role.  What's more descriptive for the AD group?  "webservers"  or "centrify-unix-global-cr-webservers"
    The first one could be any web servers, including IIS; however, the second one follows a naming convention that goes from the general to the specific.  We know it's related to Centrify due to the name, used for UNIX-like platforms, in the global zone, it's a computer role (cr) and the name is web servers.
  • do not use software that makes direct LDAP connections to domain controllers, leverage software that is aware of the AD topology defined in Sites and Services
    This one may not be very clear to everyone.  Unfortunately many IT Pros equate AD to LDAP and that could not be further from the truth.  Active Directory maintains a topology and uses DNS to ensure high-availability; sites and services aware programs (like the Centrify base and audit agents) will switch and perform telemetry calculations.  The issue with straight LDAP binds is that depending on the application, it may spawn multiple threads of TCP connections that don't act like web connections, these are persistent connections that use CPU and memory. It is not fun when you get a call with the "j'accuse" an application for killing a specific domain controller.  When in doubt, use the Centrify LDAP proxy instead of connecting directly to an AD domain controller.
  • cleanup after yourself: when objects are not used, delete them
    This may come as no surprise, but looking at many deployments, I don't see very good hygiene.  Perhaps it's important to understand how the internal workings on how Active Directory stores data.  Active Directory uses the extensive storage engine (ESE, legacy name "Jet") - ESE data only grows in size in the operating system;  however the engine is very mature and resilient;  it will perform online defragmentation; in addition, replication only happens with deltas.  If you cleanup after yourself, although the size of the file (ntds.dit) will continue to grow, internally it may be able to reclaim space.
  • communicate  and work together with your AD team
    This one may be a shock to those who are still stuck in the early 2000s.  When you implement a cross-functional solution like Centrify Server Suite that combines Security Capability (Access Control) with Directory Services (Windows) and Open Systems (UNIX, Linux, Mac); there's an underlying expectation that you will work together as a team. This means understanding that there's a dependency on a utility service (Active Directory) that both users and critical apps are relying on.  Network folks also have a role here;  new subnets have to be communicated to the AD team for proper sites and services topology;  AD teams MUST consider UNIX, Linux and Mac teams when major changes happen like Domain/Forest functional levels change or when new type of DCs are added (e.g. Windows 2012 R2+).  Security folks also need to understand that instead of having things done for them (e.g. those dreadful reports); they can work to have those created for them on SQL Server or using automated tools like PowerShell.  The game here is to provide results for the business while maintaining a proper security posture, not the early 2000's immature battle of "My Linux does not go near Windows"

Common Hygiene Issues

  • Orphaned Objects:
    This one is the most common in my opinion.  An orphaned object is created when the parent of a child object is deleted and the child is left behind.  Some apps (like ADUC) are smart enough to delete any child objects if the proper plugins are installed;  e.g. Exchange, Centrify.  Some examples include:
    • Deleting a user object without deleting any UNIX profiles
    • Leaving the domain with adleave and teh --force option (offline leave) and not cleaning up the computer object in AD.  The proper way is to perform an adleave with connectivity with the --remove option.
    • Deleting zones without proper cleanup:  many customer are phasing out classic zones and not properly decommissioning them.
  • Unused Objects: Some examples include:  empty roles, unused roles, etc.
  • Improper permissions:  For example, a computer that can't update it's OS information.

The Analyze Wizard Tool

Centrify's Access Manager includes a Utility called the Analyze Wizard.  This tool allows for the identification and correction of common issues.

You can launch the Analyze Wizard from the left pane of Access Manager by right-clicking the DirectManage Access Manager [domain controller] node and clicking "Analyze"

Once launched, you can select the checks to be performed.

Once you run the Analyze tool, it will present its results in a brand new node in the left pane of Access Manager.

You can browse to the issues, as you right click them it will provide you an automated way to resolve the issues provided that you have the proper rights in Active Directory.

Friday, October 9, 2015

Utilities: install.sh

Background

Automation and orchestration are key capabilities of the modern IT infrastructure.  Whether organizations are using private or public clouds, tools like Bladelogic, System Center, Satellite, Chef, Casper, Puppet or homegrown scripts - software should be orchestration friendly.

Centrify Server Suite for UNIX, Linux, and Mac offers a facility that should be leveraged by any savvy IT infrastructure team.  The tool is a script called install.sh.

This script is shipped with the gzipped tarball for Centrify software, for example, here are the listings for a RHEL-based system (excluding the release notes):

  • adcheck-rhel4-x86_64
  • centrifyda-3.2.3-rhel4-x86_64.rpm
  • centrifydc-5.2.3-rhel4-x86_64.rpm
  • centrifydc-install.cfg
  • centrifydc-ldapproxy-5.2.3-rhel4-x86_64.rpm
  • centrifydc-nis-5.2.3-rhel4-x86_64.rpm
  • centrifydc-openssh-6.7p1-5.2.3-rhel4-x86_64.rpm
  • centrify-suite.cfg
  • install-express.sh -> install.sh
  • install.sh

Note that all the installation bits are shipped in the native package manager or the platform, this gives the opportunity to the administrator to bypass install.sh and use the native installer.  E.g.  to install only the base agent, you can run

rpm -Ivh centrifydc-5.2.3-rhel4-x86_64.rpm

Many admins just simply add the RPMs to their repositories and can use facilities like yum to install or maintain the package.

Capabilities of install.sh

  • Interactive install/join operations:  walks the user through a series of menus and options
  • Automatic with command options:  can be run manually or by an orchestration facility for installations and joins.
  • Automatic with an answer file:  any of the .CFG answer files can be used with install.sh
  • Kerberized:  install.sh calls adjoin and other utilities that can benefit from Kerberos keytab preauthentication.

What does install.sh do?

install.sh is a script;  it acts as an abstraction layer between the package manager of the native OS and any other tool or manual script.  This is very powerful because eliminates the nuances related to each operating system, architecture or distribution.

For example, some AIX systems use the installp facility, RHEL and derivatives use RPM, Debian derivatives like Ubuntu use dpkg, OS X systems use Install.app and so on;  install.sh allows for the administrator to have a QA tested way to install Centrify software and perform additional tasks.


When preparing for a release, Centrify will QA install.sh against all the supported platforms.


Basic Automation Playbook

What you need:
a) The keytab for an AD user that can join systems (or remove them) to the target OUs
For more info on how to create this, click here.
b) A krb5.conf file for a working system
d) Install.sh (or the native package manager utility)
e) If not using install.sh, you'll need adjoin (or adleave)

Sample Command Sequences

Sample 1:  In this sequence, we use an /temp/ad-joiner keytab with a /temp/krb5.conf and we'll use install.sh to install standard edition and join a zone called  myzone in the acme.test domain in the "My Servers" OU.

env KRB5_CONFIG=/temp/krb5.conf  /usr/share/centrifydc/kerberos/bin/kinit -kt /temp/ad-joiner.keytab ad-joiner

 ./install.sh  --std-suite  --adjoin_opt="acme.test -z myzone -c acme.test/My\ Servers"


Sample 1:  In this sequence, we use an /temp/ad-joiner keytab with a /temp/krb5.conf and we'll use install.sh to install standard edition and join a zone called  myzone in the corp.contoso.com domain in the "My Servers" OU.

env KRB5_CONFIG=/temp/krb5.conf  /usr/share/centrifydc/kerberos/bin/kinit -kt /temp/ad-joiner.keytab ad-joiner

 ./install.sh  --std-suite  --adjoin_opt="corp.contoso.com -z myzone -c corp.contoso.com/My\ Servers"

Sample 2:  In this sequence, we use an /temp/ad-joiner keytab with a /temp/krb5.conf and we'll use rpm to install the standard package and adjoin to join the Global zone in the corp.contoso.com domain and put the computer under the Centrify\Servers OU.

env KRB5_CONFIG=/temp/krb5.conf  /usr/share/centrifydc/kerberos/bin/kinit -kt /temp/ad-joiner.keytab ad-joiner

rpm -Ivh centrifydc-5.2.3-rhel4-x86_64.rpm

adjoin -z Global -c "ou=servers,ou=centrify" corp.contoso.com


install.sh Help file

This script installs (upgrades/uninstalls) Centrify Suite.
Only the superuser can run this script.

Usage:
  install.sh [-n|--ent-suite|--std-suite|--express] [-e] [-h] [-V] [-v ver] [-l log_file]

where:
  -n             Custom install/upgrade/uninstall in non-interactive mode.
  --ent-suite    Install Enterprise Suite in non-interactive mode.
  --std-suite    Install Standard Suite in non-interactive mode.
  --express      Install Centrify Express in non-interactive mode.
  --bundle       Install Centrify Suite using bundle.
  --suite-config <config_file>
                 Override default suite config file with <config_file>.
  -e             Uninstall (erase) CentrifyDC.
  -h, --help     Print out this usage and then exit.
  -V             Print out installer version and then exit.
  -v <ver>       Install CentrifyDC <ver> version.
                 Format: x.x.x or x.x.x-xxx. x is number.
  -l <log_file>  Override default log-file PATH with <log_file>.
  --rev <rev>    Package OS revision to install.
  --custom_rc    Return meaningful exit code.
  --override="<options>"
                 In non-interactive mode, override default options with <options> list.
                 Format: --override="CentrifyDC_openssh=n,CentrifyDA=R"
  --adjoin_opt="<adjoin_options>"
                 Override default adjoin command line options with <adjoin_options>.
  --enable-da    In non-interactive mode, once joined to a domain,
                 enable DA for all shells.
  --disable-da   In non-interactive mode, disable DA NSS mode after install.

Examples:
  ./install.sh        -n  --override="INSTALL=R,CentrifyDC_nis=Y,CentrifyDC_openssh=N,CentrifyDA=N"
  ./install.sh        --std-suite  --adjoin_opt="acme.test -p pass\$ -z t_zone -c acme.test/My\ Servers"
  ./install-bundle.sh --std-suite "--adjoin_opt=\"acme.test -p pass\\$ -z t_zone -c acme.test/My\\ Servers\""

Wednesday, September 24, 2014

Utilities: The powerful "copy files" GPO

Background

As you know, Centrified systems can process group policies (basics here).  However, did you know that there is a group policy object named "Copy files" that can be used to:

  • Distribute files
  • Make sure config files stay consistent
  • Deploy software
  • and many many more creative uses.
The copy files GPO
It's located under Computer Configuration > Centrify Settings > Common UNIX Settings 

How does it work?

The copy-file GPO uses the Centrify agent's GP engine along with adsmb and the computer credentials to connect to the AD SYSVOL (or an alternate share) and obtain the files and it will place it in the target folder of the Unix/Linux or Mac system.

Copy-file GPO options

Because adclient is a privileged process the destination file can be manipulated (permissions, ownership, etc.).  The file gets copied under two conditions:
  • If enabled, when the group policy refresh interval is met (every 90 minutes by default with a random offset of 30 minutes.
  • When the adgpupdate command is triggered.
Considerations when using this GPO (and group policies in general):
  • Perl needs to be installed.  (5.8 minimum as of 9/2014)
  • The sysvol or alternate share have to be reachable, therefore the requirements to make a CIFS connection are in play.  This may be undesirable in firewall scenarios.
  • When writing to sysvol, an appropriate AD account needs to be used.
  • Group Policy Objects for users are not enabled on *NIX by default, they are on the Mac.

File Copy GPO in action


Sunday, August 24, 2014

Security Corner: What is a Kerberos Keytab and why should you use it?

Background

Active Directory provides a Kerberos environment.  We have written extensively about Kerberos capabilities in this blog.  We also have explained that Centrify provides tight integration with Microsoft's Kerberos AD implementation by way of their MIT-Kerberos libraries and tools.  The advantage of using Centrify's tool set is that the tools are extensively tested against Microsoft's implementation.

A Kerberos key table (or "keytab") file is "is a file containing pairs of Kerberos principals and encrypted keys (these are derived from the Kerberos password)."(1).

Kerberos keytab files can help overcome two major issues:
  • The security requirement of not having plain-text passwords in scripts or helper files.
  • The increasing IT Infrastructure requirement for automation.  The proliferation elastic computing by way of private and public clouds requires that IT adds or reduces capacity on demand in a secure way.

Kerberos Keytabs 101

  • In a Kerberos environment, each system has at least one keytab table stored on disk.  The keytab table lists the service principals and provides at least one key for each of those service principals (/etc/krb5.keytab by default).  Remember that principals typically follow the "service@host/REALM" format.
  • End-users also have Kerberos files, but they are temporary (by default 10 hours), they are stored as a Kerberos cache file (by default /tmp/krb5cc_<uid of the user>), they list any user principals.
  • When working with a Centrified system, the location of the Centrify-enabled Kerberos tools is /etc/centrifydc/kerberos/bin.  
  • Quick primer on basic Kerberos tools:
    • kinit: is used to obtain a kerberos ticket-granting-ticket
    • klist: is used to list the cached tickets.
    • kdestroy: destroys kerberos tickets
  • The Centrify Kerberos tools documentation is publicly available here.
  • Keytabs are Sensitive/Confidential information: A Security Procedure needs to be established for the handling of keytabs, because whoever has the keytab can authenticate as the principal used to create it.  As a tip, this process should be viewed with the same sensitivity as the handling of private keys.

Using Kerberos Tools

Kerberos tools are great for troubleshooting purposes.
  1. Testing end-to-end AD connectivity and account availability with kinit (e.g. accunt jerry.seinfeld)
    # /usr/share/centrifydc/kerberos/bin/kinit jerry.seinfeld
    Password for jerry.seinfeld@CORP.CONTOSO.COM:

    You are prompted for the user's password.  The benefit of this test that it bypasses the NSS, PAM and authorization modules.  This means that any user in AD can be tested with kinit.
  2. Listing the contents of a keytab or cache file with klist
    1. For systems
      # /usr/share/centrifydc/kerberos/bin/klist -kt krb5.keytab
      Keytab name: FILE:krb5.keytab
      KVNO Timestamp         Principal
      ---- ----------------- ----------------------------------
      3 05/17/14 22:22:55 host/cen1@CORP.CONTOSO.COM

      Note: By default, during a system join (with adjoin) Centrify will automatically register service principals for  http ftp cifs nfs, this parameter is controlled by the adclient.krb5.service.principals directive of the centrifydc.conf file.
    2. For users (user root)
      /usr/share/centrifydc/kerberos/bin/klist
      Ticket cache: FILE:/tmp/krb5cc_0
      Default principal: jerry.seinfeld@CORP.CONTOSO.COM

      Valid starting     Expires            Service principal
      08/24/14 14:07:02  08/25/14 00:07:04  krbtgt/CORP.CONTOSO.COM@CORP.CONTOSO.COM
      renew until 08/25/14 14:07:02
      Notice that this is a Kerberos Ticket Granting Ticket (krbtgt).

Ticket-Granting-Tickets vs. Service Tickets

Depending on how the application is using the keytab, it's possible that it will request a ticket-granting ticket (TGT), or a service ticket.  Generally, a TGT is given upon a session log-in;  a service ticket is requested when a user attempts to access a service on the network.  The key here is that a principal without a servicePrincipalName (SPN) can't be used to request a service ticket.  This changes how the AD principal is created.

The example above shows how to request a TGT.  This example, shows how to test a keytab for a service ticket:
First, we check if the account has a servicePrincipalName (e.g. db2inst1)
$ adquery user -A db2inst1
dn:CN=db2inst1,CN=Service-Accounts,DC=centrifyimage,DC=vms
samAccountName:db2inst1
userPrincipalName:db2inst1@CENTRIFYIMAGE.VMS
servicePrincipalName:db2inst1/engcen5.centrifyimage.vms

Second, we attempt to get a service ticket (the keytab is db2inst1.keytab)
$ /usr/share/centrifydc/kerberos/bin/kinit -S db2inst1/engcen5.centrifyimage.vms -kt db2inst1.keytab db2inst1
[db2inst1@engcen5 ~]$ /usr/share/centrifydc/kerberos/bin/klist
Ticket cache: FILE:/tmp/krb5cc_1004
Default principal: db2inst1@CENTRIFYIMAGE.VMS

Valid starting     Expires            Service principal
11/24/14 11:24:46  11/24/14 21:24:47  db2inst1/engcen5.centrifyimage.vms@CENTRIFYIMAGE.VMS
        renew until 11/25/14 11:24:46
Notice that this is not a KRBTGT, but a service ticket.

Using Centrify Tools for Kerberos-related operations

adinfo (with the C option) can be used to review the system service principals, and encryption level. Remember that the latter is set by the domain controller functional level.
$ adinfo -C
Computer Account Diagnostics
  Joined as: cen1
  Trusted for Delegation: false
  Use DES Key Only: false
  Key Version: 6
  Service Principal Names: nfs/cen1.corp.contoso.com
                           nfs/cen1
                           ipp/cen1.corp.contoso.com
                           ipp/cen1
                           http/cen1.corp.contoso.com
                           http/cen1
                           host/cen1.corp.contoso.com
                           host/cen1
                           ftp/cen1.corp.contoso.com
                           ftp/cen1
                           cifs/cen1.corp.contoso.com
                           cifs/cen1
                           afpserver/cen1.corp.contoso.com
                           afpserver/cen1

Supported Encryption Type(s): RC4-HMAC
                              AES128-CTS-HMAC-SHA1-96
                              AES256-CTS-HMAC-SHA1-96

Operating System Version: 6.1:6.5 (Final)

Adkeytab

adkeytab, is arguably one the most powerful command line tools provided by Centrify.  When used in tandem with scripts and the Kerberos tools it can help to increase security and provide flexibility in automation scenarios.  It has the ability to provision, deprovision and modify server and user principals.  Aside from adedit, adkeytab contains the largest command reference.

adkeytab  -  create  and manage Kerberos key tables (*.keytab files)and coordinate changes with the  Kerberos  key  distribution center(KDC) provided by Active Directory.

I will try to highlight some benefits of using adkeytab:
  • It can be used to create or adopt AD principals:  adkeytab can create the user in AD for you, or in a separation of duties scenario, the UNIX/Linux admin can adopt the account provided he has the appropriate rights to modify the AD account.
  • It randomizes the AD account's password:  The major issue with service accounts it that they are considered a shared account since at least one person (the creator or the user) knows the password.  With adkeytab it's possible to randomize the password of the AD account, effectively minimizing the need for aggressive password rotation.
  • Can be fully automated:  adkeytab can be used with your scripts to perform operations.  This helps with elastic or private clouds.
  • It's Kerberized!  what that means is that you can use a keytab to use adkeytab - this is great for automation.
  • Syntax can be tricky - there are so many options that it can be overwhelming for beginners; my tips are to use the long for options (e.g. --adopt) and verbose output.
  • Fixes stale AD computer accounts:  It can be used to reset the machine computer account.  Just elevate to use the adkeytab command with the -C (--change-password).  The output below uses the local system's computer account (--machine) in AD to reset the computer's password in AD.
$ dzdo adkeytab --change-password --machine -V
Attempting bind to centrifyimage.vms site:Demo-Site server:dc.centrifyimage.vms: ccache:FILE:/etc/krb5.ccache
Bind successful to server dc.centrifyimage.vms
Searching for AD Object: filter = (samAccountName=engcen5$), root = DC=centrifyimage,DC=vms
AD Object found: CN=engcen5,OU=UNIX-Servers,OU=Unix,DC=centrifyimage,DC=vms
Key Version = 21
Changing account 'engcen5' password with machine credentials.
Searching for AD Object: filter = (samAccountName=engcen5$), root = DC=centrifyimage,DC=vms
AD Object found: CN=engcen5,OU=UNIX-Servers,OU=Unix,DC=centrifyimage,DC=vms
Key Version = 22
Success: Change Password: Default Key Tab

The posts below, cover scenarios that use Kerberos key table files:

(1) Source: Indiana University IT, https://kb.iu.edu/d/aumh

Tuesday, June 24, 2014

Utilities: addebug

Background

The addebug command is used to use the log feature of the Centrify client for UNIX, Linux and Mac OS X.  Logs written to /var/log/centrifydc.log, however in HP-UX the location is /var/admin/syslog.  Only turn on debugging if you're troubleshooting a problem and you'll have to elevate (with sudo or dzdo) to use addebug and review the log.

Location

The utility is located in the /usr/share/centrifydc/bin folder.

Basic Usage
  • Use /usr/share/centrifydc/bin/addebug on to start debugging
  • Use /usr/share/centrifydc/bin/addebug off to stop debugging 
  • Use /usr/share/centrifydc/bin/addebug clear to clear the logs
For more information, read the manual page for addebug  (man addebug).

What to look for

Modules
Centrify  implements directory lookups with Name Server Switch (NSS) and Pluggable Authentication Modules (PAM) for authentication, this means that you need to become familiar with some of  these calls:
  • NSS calls:  These are name server switch function calls.  For example (oversimplifying) an application may use a call to determine the user's UID from the login name.  These calls start with "NSS".
  • PAM calls:  These function calls implement the account, authentication, session and password modules that are implemented with the solution. These calls start with "pam_"
File Descriptors
FDs identity the transactions, they make it easy for the log reader to follow the same transaction.  They are labeled with "fd:nn"  (nn is the descriptor number).  

Keywords, Phrases and Functions
During the troubleshooting process, you'll become familiar with several keywords that will help you determine what happened during the transaction.  For example, here are a few:
  • pam_sm_authenticate:  search for this call to determine the beginning of PAM authentications.
  • "User is ours" / "User is not ours":  This phrase appears in a file descriptor when the function PAMUserIsOurResponsibility determines that the user is indeed an AD user that needs to be processed or not.

Sunday, March 2, 2014

Lab 16: Configuring ZPA for Automatic UNIX Group Provisioning

Background


Posting:  http://centrifying.blogspot.com/2014/03/basics-automatic-unix-profile.html
Automatic Provisioning for Users: http://centrifying.blogspot.com/2014/01/labs-centrify-zone-provisioning-agent.html

Part 1

  1. We configure grant the proper rights to the Centrify ZPA AD service account
  2. We create the Source Group
  3. We create a test group (UNIX-HQ-webadmin) and nest it to the source group.
  4. We test and verify that automatic provisioning is working


Part 2

  1. We verify that add/moves/changes are working as expected.
  2. We modify the UNIX group profile with account overrides
  3. We modify the UNIX group provisioning to automatically set the unix name and GID based on our needs.
  4. We add the dbaadmin group.
  5. We verify that regardless of the membership, only the users who have been granted rights to the system are the ones in the NSS group.

Saturday, March 1, 2014

Basics: Configuring the Centrify Zone Provisioning Service for Automatic Secondary UNIX group provisioning

Background

In a previous posting we discussed how to implement automatic provisioning of UNIX user identities using Centrify's Zone Provisioning Agent (ZPA).
As part of BP#2, one of the key requirements was to implement a provisioning model for secondary UNIX groups and to make it resemble the existing one for users.
This capability consists in the automatic creation of the secondary UNIX group as well as the lifecycle maintenance of members (add/moves/changes).

All the principles applied in the basic posing about ZPA apply here, but in the context of UNIX secondary groups.  Let's apply the Plan-Do-Check-Adjust methodology.

Planning for Secondary Group Provisioning

Is the secondary group needed
The first place to start is to ask "Why is this secondary group required?" -  remember that with Centrify there is no need to have these groups for Access or Privilege purposes, Zones and RBAC take care of all that. In these exercises, the typical answer "Because that's the way is done" is not a good answer so you may have dig deeper.

Naming Conventions
The same rules of UNIX systems apply here as well, but they are a bit more stringent;  the 8 character limit for users is platform-dependent;  the UNIX group case, it may be more of a hard requirement.

Active Directory
Basically the way UNIX Groups work in Centrify is as follows;  there is a security group in AD for each secondary group in UNIX;  the memberships are handled from AD (the process consolidator and time saver), however, governance and processes have to be taken into account.  Questions such as:
  1. How are AD Security group are requested today?
  2. How is the membership lifecyle managed (add/moves/changes)?
  3. Are group memberships subject to any attestation process?
Need to be understood and agreed upon.  

Group Merging
Group Merging is the ability to mix members from other Name Server Switch groups (like /etc/group) with UNIX Enabled AD groups. For example, if an application requires the enumeration of all the members from the software group (UID 200) and the application uses local users (e.g. like the db2inst account) and AD users (like jessie.matthews), then this feature needs to be implemented as well.

Implementing (Do) Secondary Group Provisioning

The process is as follows:
  1. Make sure the service account used for ZPA has the proper delegation to add/remove/modify group profiles.  This is done through the Delegation Wizard of the zone.
  2. An Active Directory "Source" Group is created.
  3. ZPA is configured to look at that group as the source group.  For consistency, this group is stored in the OU designated for provisioning 
  4. The rules for GID are set, the options are:
    • An unique value generated from the group's System ID (SID)
    • The RFC 2307 attribute (has to be populated in the object manually or programatically)
    • Using the defaults set in the zone (Group Defaults tab)
    • Using Apple's scheme (this is new for version 2014)
  5. The naming rules are set (truncation, character sets, prefixes, etc)
  6. Once this is set, ZPA is ready to provision UNIX groups.

Verifying the Implementation (Check)

Verifying group creation:
  1. Restart ZPA (so the new zone provisioning configuration is processed)
  2. Create an AD Security group.
  3. Nest the group (make it a member) of the source group in the previous step.
  4. Wait the ZPA refresh cycle or restart the service.
  5. Verify that the new group exists under Zone > UNIX Data > Groups.
  6. Verify that the group exists in the adequate UNIX systems.  There are several ways:
    getent group | grep <unix name of group>
    adquery group | grep <unix name of group>
  7. To verify the group's deletion, just remove the AD group from the source group and cycle ZPA;  the UNIX group will be removed from the zone.
Verifying Add/Moves or Changes
  1. Add a user to the previously provisioned group
    Note:  this user needs to be at least listed in the system, otherwise he/she won't show. For example, if the user has a UNIX identity, but only has access to web servers, the user will not show in the Database Servers by virtue of the access rules enforced by Centrify.
  2. Wait the ZPA refresh cycle or restart the service.
  3. Verify that the user's UNIX name is in the list of users for that group.
    There are several ways:
    getent group | grep <unix name of group>
    adquery group | grep <unix name of group>
  4. Remove the user from the AD group (go to step 2) and in step 3 verify that the user is gone.

Performing Adjustments

Adjustments may vary depending on the results.  They can be:
  • Adjusting how the GID is generated (or reviewing the provisioning process)
  • Adjusting how the UNIX name of the group is generated.
  • Adjusting group merging options.

Tuesday, January 14, 2014

Utilities: addns and adsmb

addns


This utility is allows the register and update of the system DNS resource record either automatically or manually.  It is very handy especially for UNIX administrators that may not have access to the DNS management snap-in.  addns uses secure DNS dynamic updates.

For example, to update my computer (ubu1), in the corp.contoso.com using jessie's account:

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0c:29:1f:2c:0a
          inet addr:10.0.0.154  

$ addns -U -u jmatthews  -d corp.contoso.com -n ubu1 -i 10.0.0.154
jmatthews@CORP.CONTOSO.COM's password:
Updating host records for ubu1.corp.contoso.com on 10.0.0.1.
Updated host records ubu1.corp.contoso.com.
Updating reverse lookup records for ubu1.corp.contoso.com on 10.0.0.1.
Updated reverse lookup record  154.0.0.10.in-addr.arpa.

In DNS Manager, I can see my updated record


addns Usage


    addns -U [-u <user> -p <pwd>] [-d <dom>] [-s <svr>] [-n <host>] [(-i <ip>)+]
Or:
    addns -D [-u <user> -p <pwd>] [-d <dom>] [-s <svr>] [-n <host>]
Or:
    addns -A [-u <user> -p <pwd>] [-d <dom>] [-s <svr>] [-n <host>] [(-i <ip>)+]
Or:
    addns -L [-d <dom>] [-s <svr>] [-n <host>] [(-i <ip>)+]
With:
  -U, --update        create or update host's DNS records
  -D, --delete        delete host's DNS records
  -A, --add           just add host's DNS records
  -L, --list          lists DNS record details
  -N, --nocreds       no credential is to be supplied or prompted for (only works when the DNS server is configured for non-secured updates)
  -m, --machine       Use machine credentials (must be root)
  -u, --user          AD user name
  -p, --password      pwd password string, prompts if absent
  -s, --server        svr DNS server to contact. Legal formats include: host<@REALM>, host.domain.com<@REALM>
  -d, --domain        dmn DNS domain name
  -n, --name          hst Host Name
  -i, --ipaddr        ipa IP address
  -f, --force         force update DNS records even if they have not changed
  -r, --refresh       updates unchanged records to refresh TTL
  -t, --ttl           val specify a time to live value in seconds
  -v, --version       print version information and exit
  -V, --verbose       print debug information for each operation
  -h, --help          print this help information and exit
Examples:
    addns -U
    addns -D
    addns -U -d acme.com -s dnssvr@ACME_REALM.COM -n myhost -i 192.168.1.155
    addns -L


adsmb


This is a very cool tool that allows to access windows shares via the command line.  It allows to copy, read and even print!! files from the command line interface to windows shares.  adsmb can use the current machine credentials and even a kerberos keytab to authenticate (great for scripts!)

Folder listing example:  To list the files in the files folder in APP1  (\\APP1\files)

$ adsmb dir -h app1.corp.contoso.com -s files
  10 Sat Dec 14 14:39:38 2013, Wed Dec 18 06:27:39 2013,  Wed Dec 18 06:27:39 2013,  Wed Dec 18 06:27:39 2013,               0 .
  10 Sat Dec 14 14:39:38 2013, Wed Dec 18 06:27:39 2013,  Wed Dec 18 06:27:39 2013,  Wed Dec 18 06:27:39 2013,               0 ..
  10 Sun Dec 15 19:30:14 2013, Sun Dec 15 19:32:08 2013,  Sun Dec 15 19:32:08 2013,  Sun Dec 15 19:32:08 2013,               0 Centrify-Suite-2013.3-mgmt-ent-win64
  20 Wed Dec 18 06:27:39 2013, Wed Dec 18 06:26:06 2013,  Tue Jan 14 18:06:55 2014,  Wed Dec 18 06:27:39 2013,        39118052 centrify-suite-2013.3-rhel3-x86_64.tgz
  20 Wed Dec 18 06:27:39 2013, Wed Dec 18 06:26:22 2013,  Tue Jan 14 18:06:55 2014,  Wed Dec 18 06:27:39 2013,        30561472 centrify-suite-2013.3-sol9-x86.tgz
  20 Wed Dec 18 06:27:39 2013, Wed Dec 18 06:26:38 2013,  Tue Jan 14 18:06:55 2014,  Wed Dec 18 06:27:39 2013,        31055871 centrify-suite-2013.3-suse9-x86_64.tgz
  20 Sat Dec 14 14:40:51 2013, Sat Dec 14 14:40:51 2013,  Tue Jan 14 18:06:55 2014,  Sat Dec 14 14:40:51 2013,              21 example.txt

File get example: to copy example.txt to the Files shared folder in APP1

$ adsmb get -h app1.corp.contoso.com -s files -r example.txt -l example.txt
$ ls -l
total 4
-rw------- 1 jmatthews jmatthews 21 Dec 14 14:40 example.txt
-rw-rw-r-- 1 jmatthews jmatthews  0 Jan 14 17:59 myfile.txt
$ cat example.txt
This is a shared file
jmatthews@ubu1:~$


adsmb Usage


Usage: adsmb <action> [-c credentials] [-d domain] [-h host] -s share [-r file] [-l file ] [-n pattern] [-CmTV]
        action = get, getnew, getmod, put, putnew, print, dir, mkdir, rename, rmdir, delete
        -c credentials = credentials to use
        -h host   = host to connect to. If not given it is the 'best' domain controller
        -d domain = domain to connect to. If not given it is using current joined domain or the domain part from the host
        -s share  = share name
        -r file   = the remote file or remote directory to dir
        -n pattern= pattern to list when listing directory, default is *
        -l file   = the local file
        -C = convert CRLF to LF
        -m = use machine credentials. Requires access to krb5.keytab, typically root
        -T = Machine-readable timestamps
        -V = print debug message
Examples:
        adsmb get -h myserver -s test -r files\\my.txt -l foo.txt
        adsmb dir -s sysvol -mT
        adsmb dir -s homedrive -mT -r krusty\library -n *
        adsmb print -h myserver -s sharedPrinterName -l <-|foo.txt>

Tuesday, January 7, 2014

Basics: Automatic UNIX Profile Provisioning Using Centrify's Zone Provisioning Agent

Background


In a previous posts we discussed what's in a UNIX profile, we have also discussed the concepts behind Centrify Zones, how Active Directory users can be UNIX-enabled using Centrify and what are some of the considerations and strategies for UNIX identities;  the problem has been that our labs have been focused in manual Identity manipulation.

The reason for this is simple:  understanding the basics is establishes the best foundation to address complex issues; but since we have gone over man manual scenarios, in this posting we will discuss automatic provisioning with the Zone Provisioning Agent (ZPA) utility.  The rest of the labs will use ZPA with a rationalized namespace.

Why Exceptions are Bad


In IT infrastructure, Security as well as in Identity and Access Management, designers need to strive for standardization and simplicity; sadly the reality is that organizations are complex today because problems are addressed in a reactive matter and rarely the root cause of issues are addressed, instead, organizations throw technology and resources at the problem.

Getting to a standard Identity Provisioning process is hard and the most challenging part is the ability to make the process standard and repeatable enough that exceptions are almost eliminated.   Exceptions introduce overhead and unnecessary risk; any system administrator with a certain degree of experience knows this and the sad thing is that some of them have figured out that complexity keeps them employed and enjoying the status quo.

Exceptions = More complexity = More stress = More work = More cost = Lower Satisfaction

In addition, to be completely fair, not all organizations can afford to completely aim and then shoot.  This is why solutions need to allow a certain degree of flexibility.


Centrify Zone Provisioning Agent


The Zone Provisioning Agent (or ZPA) is a utility included with Centrify Standard Edition that allows the automatic provisioning of UNIX identities leveraging Active Directory Security groups.
Yes, we get to reuse the same process again.
ZPA waits a preset number of minutes and searches in Active Directory for provisioning groups, and based on the zone defaults, will automatically UNIX-enable a user.

ZPA is implemented as a Windows Service or it can be run as a command utility called zoneupdate.exe.
Zoneupdate provides an interface to work with scripting or Identity Management solutions.

Like any other solution, ZPA has to subscribe to the Plan-Do-Check-Model.

Planning for ZPA


  • Understand the impact of ZPA - once a zone has been enabled for automatic provisioning, AD users can't be UNIX-enabled manually, overrides are still possible at the zone, child zone and system levels.  The unavailability of manual provisioning, stresses that the process has to be clean of major exceptions.
  • Determine how you're handling the Unix Name (RFC 2307 uid attribute).  This is important because some UNIXes need to be enabled for long name support and you may have naming conventions to consider.
    • ZPA allows to handle any exceptions on the settings for the UNIX name.
    • ZPA can use any attribute stored in the user object as the RFC2307 uid field, therefore if you have any scripts, IdM solution, etc that make transformations and write them into this field, they can be leveraged by zpa.  The default is the AD username:  ${u:sAMAccountName}
  • ZPA requires a master provisioning AD security group per zone;  this means that we need to create and populate an AD Security group with the users that require provisioning.
    Sample Design (Nested Groups):  
    You can leverage Active Directory group nesting to kill two birds with one stone.   For example:  Jeremy is a member of the UNIX Database Servers Users group;  since this group grants the role in the appropriate number of systems, we can safely assume that he requires a UNIX profile, so if we have a Provisioning group called UNIX All Users, all we need to do is nest the role-granting AD group in to the provisioning group.

    This design simplifies operations because either manually, programmatically or by virtue of using an Identity Management tool, adding or removing the user to the role-granting group, has the effect of provisioning or deprovisioning access.
  • ZPA high-availability:  All services need to be planned with HA in mind.  Running multiple ZPAs is not uncommon.
  • Planning for Exceptions:  In this model, Centrify allows for identity overrides at the child or system levels.
  • Planning for Migrations from existing Manual to ZPA zones:  In this case, the brief moment in which the accounts won't be available has to be accounted for.
    All users will lose their UNIX identities until the next polling interval kicks-in.  If well planned, this should be negligible in a medium to small environment.

Implementing ZPA (Do)

To Implement ZPA, at a high level:
  1. Create the Provisioning group and populate it with the appropriate users and/or groups.
    If using the model outlined above, nest the role-granting groups into the provisioning group.
  2. Request an Active Directory service account to run ZPA.
  3. Delegate the proper permissions for Users (or Groups) for ZPA to be able to perform the functions desired.
  4. Install ZPA in a highly-available system.
    Note:  If it hasn't been done, your existing Access Manager consoles have to be extended with ZPA setup to have the Provisioning tab enabled.
  5. In Access Manager Configure the zone for automatic provisioning (if this zone had users, the UNIX-identities will be deleted)
  6. Configure the account and the polling interval for ZPA
    (You may need to make sure that the service account has the proper log on locally rights)
  7. When the service starts, all identities will be provisioned.

Verifying the Implementation (Check)

  1. In Access Manager, verify that all UNIX Identities are accounted for.
  2. In the UNIX systems, make sure that after an adflush all users for the corresponding system are accounted for.
  3. Add a user to one of the role-granting groups.  Trigger a polling interval.  Verify that the user has a UNIX identity.
  4. Remove the user from the role-granting group. Trigger a polling interval.  Verify that the user has lost his UNIX identity.

Adjusting the ZPA Implementation


There are multiple reasons to adjust a ZPA implementation, but the most common are:
  • Provisioning SLAs:  Provisioning is composed of multiple parts:  from user creation or provisioning, to workflow/approvals, AD-replication, cache-flush intervals and now ZPA.  The polling interval may need to be adjusted for Service Level Agreements.
  • Performance:  Network, domain controller availability, etc.
  • Availability:  Redundancy, etc.

Zoneupdate Help


Usage: ZONEUPDATE [options] zone1 [zone2 zone3...] Options

/z|SourceZone:Path  
Copy user attributes from the source zone (specified 
in canonical name format, for classic zone only).

/d|Domain:DomainName
The FQDN of the target domain.

/dc|DomainController:DomainControllerNameThe target domain controller to connect to.

/u|UserSource:ADGroup[@domain]
The AD group used to populate the users in the zone.

/g|GroupSource:ADGroup[@domain]The AD group used to populate the groups inthe zone.

/uu|UserUid:<Option>
The method to generate the UID for a user profile. 
Option can be one of the following values. Auto is the default if this option is not specified.

/us|UserShell:<Option>
The method to generate the UNIX shell for a user profile.
Option can be one of the following values. 

/uh|UserHomeDirectory:<Option>
The method to generate the home directory for a user profile.
Option can be one of the following values. 

/uc|UserGecos:<Option> (For hierarchical zone only)
The method to generate the Gecos in a user profile.
                     
/gg|GroupGid:<Option>
The method to generate the GID for a group profile.

/gn|GroupName:<Option>
The method to generate the UNIX name for a group profile.
Option can be one of the following values. SamAccountName
is the default if this option is not specified.
                     
Methods:  
SamAccountName is the default if this option is not specified (for login, UID, GID).
Auto is the default if this option is not specified.
Auto            - Auto-generate from the AD group's SID.
RFC2307         - Group's AD RFC 2307 gidNumber attribute.
ZoneDefault     - The GID of this group in the default value zone for the target zone. Use the next GID of the target zone if the default value zone is not available.
SourceZone      - The GID of this group in the source zone.
(for classic zone only)
<Empty>         - Leave empty option for undefined GID.
(for hierarchical zone only)

                     
/v|Verbose           Verbose output messages.

/p|Preview           Preview only. No provisioning changes will be made.

/l|Log:<Level>       
Turn on the log file. The log file will be created in'C:\Documents and Settings\<CurrentUser>\Application Data\Centrify\Zone Provisioning Agent\Log'
Log level can be Error, Warning, Information or Verbose.

Example:
    zoneupdate /u:"Domain Users" /g:"Domain Users" /d:centrify.dev zone1 zone2

Monday, January 6, 2014

Basics: Using Group Policy on UNIX/Linux and Mac OS X Systems with Centrify

Background

As per Wikipedia: "Group Policy provides the centralized management and configuration of operating systems, applications, and users' settings in an Active Directory environment"  but what does this mean:
  • For the IT Administrator:  It allows the enforcement and management of computer and user settings to be much easier.  It's also easier to achieve standardization from a central administrative place.
  • For Security:  It allows for security policy definition in a single place, with enforcement in multiple endpoints.
  • For End-Users:  It means that the two parties above can control my experience.  :-)  All joking aside, group policies can make the user's experience more consistent.
  • For IT Management:  Group Policies promote better compliance, more standardization and operational efficiency.
Centrify provides Group Policy objects for the UNIX/Linux (including GNOME), Mac OS X and in the user suite for iOS, Android, etc.

How does group policy work?

In a Windows network, client reads a special share in the SYSVOL share of a domain controller and based on the scope (Site, Domain, OU), the processing rules and security settings they may or may not be processed.  They can change computer settings (upon reboot) or user settings (upon login) or after the gpupdate command is issued.

But UNIX/Linux systems are not Group Policy capable?  Yes, this is true.  Unless the system has been Centrified.  The section below explains how Centrify can process group policies.

Note:  Group Policy processing is available on the licensed versions of Centrify for UNIX, Linux and Mac OS X, with the exception of the Password and Kerberos policy that can be enforced in the Express (community) version.  This blog does not cover Centrify Express, but the reason why this is possible is due to the shared objects that comprise the Account PAM module provided by Centrify.

How does Centrify enable Group Policy for UNIX/Linux and Mac Systems?

There are several components that allow group policies to be processed in UNIX systems.
On the Windows side:  Group Policy templates and definitions (.adm and .xml) files provided with the Centrify Suite. A trusted administrator links and configures the GPOs, which in turn are copied in the SYSVOL share of the domain controller (and replicated in the domain).
On the UNIX/Linux/Mac OS X system side:  The Centrify agent (adclient), mapping files, the mapper process, a virtual directory and config files.


The simplified process works like this:
  1. At the group policy refresh interval or when the adgpupdate command is issued, adclient reads the SYSVOL share of the current domain controller.
  2. The client determines which group policies apply according GP processing rules.
  3. The group policies are interpreted and implemented by the mappers process
  4. The corresponding changes are made to the configuration files in the system.
For example, the Windows logon banner, specified in the "Interactive logon: Message text for users attempting to log on" GPO under Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options is mapped to the text in the  /etc/issue file in the UNIX/Linux system.

Other very important GPOs are verified by the PAM Password Module, like these options on the "Computer Configuration > Windows Settings > Security Settings > Account Policies > Password Policy" Section:  
Enforce password history
  • Maximum password age
  • Minimum password age
  • Minimum password length
  • Password must meet complexity requirements
Process Reuse:  This means that all the password policies can be reused in the UNIX, Linux and Mac OS X systems that are joined via Centrify commercial editions!!!

Video Chalk-talk

For a deeper dive on group policies provided for Mac OS X by Centrify, take a look at this chalktalk:



Documentation

Group Policy-related Centrify Utilities

adgpupdate

The adgpupdate command is the equivalent to the gpupdate command in Windows.  What it does is described above.  

usage: adgpupdate [options]
options:
  -T, --target <Computer | User>
                     Only refresh the computer or user policy (default both).
  -V, --verbose      Print debugging diagnostics to stderr.
  -v, --version      Print version information.
  -h, --help         Print this help text.

Sample output:
$ adgpupdate -V
session opened
Refreshing Computer Policy...
Success
Refreshing User Policy...
User Policy disabled on this machine.

To view the settings processed by group policy, inspect the gp.report file under /var/centrifydc/reg/machine  (and /user if the system is a Mac or if it was enabled for GNOME policies)

adgpresult

In the 2015 version of the Centrify DirectControl agent (5.2.2), the adgpresult command has been introduced.  This command works just like the Windows gpresult tool.  It shows all the group policies processed locally by the agent in a very neat output.

$ adgpresult --help
usage: adgpresult [options]
    e.g. adgpresult -a
    or adgpresult -m -u uname1 -u uname2 ...
options:
    -a, --all           Dump both gp settings for machine and current user.
                        Default option if no option is given.
    -m, --machine       Dump the machine's gp settings.
    -u, --user <name>   Dump the specified user's gp settings.
    -h, --help          Print this help information and exit.