<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[CloudForms Now]]></provider_name><provider_url><![CDATA[http://cloudformsblog.redhat.com]]></provider_url><author_name><![CDATA[mwesley@redhat.com]]></author_name><author_url><![CDATA[https://cloudformsblog.redhat.com/author/mwesleyredhatcom/]]></author_url><title><![CDATA[Using Tags for Access&nbsp;Control]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>Most systems use Access Control Lists (ACL’s) to manage user’s access to objects. Common examples are ACL’s for file systems, LDAP, Web Servers and many more. Anyone who has had to create ACL rules and maintain them knows how complicated this can be. To make access control easy again, CloudForms uses tags. If the group a user belongs to has the same tag as the accessed object, access is granted, if not, access is denied.</p>
<p>This sounds simple and straightforward, but there are a couple of things to know about tags which make them very powerful, but also a bit tricky.</p>
<p><!--more--></p>
<p>Let’s start with a basic explanation of common objects in CloudForms:</p>
<ul>
<li>Users: users can be created in the internal database or retrieved from external authentication. Meta data, including the full name, email address, password (in the case of database authentication) and relationship to one or more groups, is associated to the user.</li>
<li>Groups: every user is a member of one or more groups. Groups are used to define the scope or visibility of a user. For example, a member of the “Engineering Department” group can be granted access to all virtual machines (VMs) owned by the engineering department. Or a member of the group “Operations” could be granted access to all VMs running in the production environment.</li>
<li>Roles: every group is associated to exactly one role, which describes the privileges granted to that group. Roles are used to define which actions a user is allowed to perform. For example, an “Operator” role could include permissions to start or stop VMs, re-configure them, etc. A “Self Service” role could allow a user to order new VMs and manage them.</li>
</ul>
<p>The combination of groups and roles defines which actions are allowed and on which objects. An “Operator” role in the “Engineering Department” group would have the same privileges as an “Operator” role in the “Finance Department” group because they share the same role, but they would see different objects because they are not in the same group.</p>
<p>Let’s discuss a couple of examples to get familiar with this model.</p>
<h2>Setting the Stage</h2>
<p>As an administrator, navigate to <strong>Settings &gt; Configuration</strong> and click on “Access Control” in the pane on the left, and then click on “Roles”. Add a new role by clicking on <strong>Configuration &gt; Add a New Role</strong> and name it “Self Service”. Granting privileges to the role is very nicely implemented. The tree on the right represents all of the menus and actions a user can perform in the UI. Enabling (checking) a feature grants the privilege to the role. By drilling down into sub folders, very fine grained permissions can be granted (e.g. power on, but not power off).</p>
<p>For the purpose of this demo, a role with full access to “Cloud Intel”, “Services”, “Compute”, “Settings” and “Access Rules for all Virtual Machines” &#8211; but no other privileges &#8211; is created.</p>
<p><img data-attachment-id="1444" data-permalink="https://cloudformsblog.redhat.com/2016/10/13/using-tags-for-access-control/image1-5/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=1044&#038;h=510" data-orig-size="1044,510" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image1" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=1044&#038;h=510?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=1044&#038;h=510?w=1024" class="alignnone wp-image-1444 size-full" style="border:1px solid #000000;" src="https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=1044&#038;h=510" alt="image1" width="1044" height="510" srcset="https://cloudformsredhat.files.wordpress.com/2016/10/image12.png 1044w, https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=150&amp;h=73 150w, https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=300&amp;h=147 300w, https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=768&amp;h=375 768w, https://cloudformsredhat.files.wordpress.com/2016/10/image12.png?w=1024&amp;h=500 1024w" sizes="(max-width: 1044px) 100vw, 1044px" /></p>
<h3>Example Group “Engineering”</h3>
<p>In the next step, a group called “Engineering” is created. All members of this group will have the “Self Service” role assigned, which was created in the previous step. For now, we skip tags and filters and keep them all unchecked.</p>
<p><img data-attachment-id="1445" data-permalink="https://cloudformsblog.redhat.com/2016/10/13/using-tags-for-access-control/image2-5/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2016/10/image21.png?w=655&#038;h=340" data-orig-size="655,340" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image2" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2016/10/image21.png?w=655&#038;h=340?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2016/10/image21.png?w=655&#038;h=340?w=655" class="alignnone wp-image-1445 size-full" style="border:1px solid #000000;" src="https://cloudformsredhat.files.wordpress.com/2016/10/image21.png?w=655&#038;h=340" alt="image2" width="655" height="340" srcset="https://cloudformsredhat.files.wordpress.com/2016/10/image21.png 655w, https://cloudformsredhat.files.wordpress.com/2016/10/image21.png?w=150&amp;h=78 150w, https://cloudformsredhat.files.wordpress.com/2016/10/image21.png?w=300&amp;h=156 300w" sizes="(max-width: 655px) 100vw, 655px" /></p>
<h3>Example User “Joe Doe”</h3>
<p>In the last step a user “Joe Doe” is created. This will be a local user (stored in the database) and is a member of the “Engineering” group.</p>
<p><img data-attachment-id="1446" data-permalink="https://cloudformsblog.redhat.com/2016/10/13/using-tags-for-access-control/image3-5/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2016/10/image31.png?w=552&#038;h=393" data-orig-size="552,393" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image3" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2016/10/image31.png?w=552&#038;h=393?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2016/10/image31.png?w=552&#038;h=393?w=552" class="alignnone wp-image-1446 size-full" style="border:1px solid #000000;" src="https://cloudformsredhat.files.wordpress.com/2016/10/image31.png?w=552&#038;h=393" alt="image3" width="552" height="393" srcset="https://cloudformsredhat.files.wordpress.com/2016/10/image31.png 552w, https://cloudformsredhat.files.wordpress.com/2016/10/image31.png?w=150&amp;h=107 150w, https://cloudformsredhat.files.wordpress.com/2016/10/image31.png?w=300&amp;h=214 300w" sizes="(max-width: 552px) 100vw, 552px" /></p>
<h3>Results</h3>
<p>If Joe Doe logs into the web interface and navigates to <strong>Providers &gt; Hosts &gt; Virtual Machines</strong> or <strong>Providers &gt; Hosts &gt; Service Catalogs</strong> he will see all of the existing objects. This should not be a surprise, because he is assigned to a group which doesn’t have any restrictions on visibility.</p>
<h2>Granting Access to Individual Objects</h2>
<p>For our next step, we want to restrict Joe Doe’s visibility to only those VMs associated to the Engineering Department. To accomplish this, we will restrict Joe Doe to only see objects tagged as <em><strong>Department/Engineering</strong></em>. But first, we will learn a little bit about tags and tag categories.</p>
<h3>Tags and Tag Categories</h3>
<p>Tags are any string that you would like to describe a particular characteristic of an object. The best tags are clearly descriptive and easy for other users to understand. For example, <em><strong>Engineering</strong></em> and <em><strong>Finance</strong></em> are clearly descriptive and easy to understand tags that describe the part of the organization to which a user or VM belongs. Tag categories are groupings of related tags. For example, <em><strong>Engineering</strong></em> and <em><strong>Finance</strong></em> belong to the <em><strong>Department</strong></em> tag category. Using tag categories you can group related tags together.</p>
<p>CloudForms comes with a default set of tags and tag categories that you can use, or you can create your own custom taxonomy of tags. In this way, tags are very flexible. For this demonstration, we are going to work with the default set of tags and tag categories.</p>
<h3>Assigning a Tag to an Object</h3>
<p>Navigate to the “Engineering” group, edit it and select the <em><strong>Department/Engineering</strong></em> tag.</p>
<p><img data-attachment-id="1447" data-permalink="https://cloudformsblog.redhat.com/2016/10/13/using-tags-for-access-control/image4-5/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?w=645&#038;h=811" data-orig-size="645,811" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image4" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?w=645&#038;h=811?w=239" data-large-file="https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?w=645&#038;h=811?w=645" class="alignnone wp-image-1447 size-full" style="border:1px solid #000000;" src="https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?w=645&#038;h=811" alt="image4" width="645" height="811" srcset="https://cloudformsredhat.files.wordpress.com/2016/10/image41.png 645w, https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?w=119&amp;h=150 119w, https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?w=239&amp;h=300 239w" sizes="(max-width: 645px) 100vw, 645px" /></p>
<p>When changing groups, roles or tenants, the user doesn’t need to logout and login again. Changes to groups and roles are reflected immediately in CloudForms, even if the user is already logged in. If Joe now navigates to view VMs, only those VMs tagged with <em><strong>Department/Engineering</strong></em> will be shown. In this case, none!</p>
<h3>First Gotcha!</h3>
<p>You might have noticed, after setting the <em><strong>Department/Engineering</strong></em> tag for the group, no objects are showing up in the UI. The scope for the group, and hence the user, was just limited to objects which are tagged as <em><strong>Department/Engineering</strong></em> &#8211; and no objects have been tagged so far. We now need to tag all objects which should be visible for the user. An object, like a VM, can be tagged by using the <strong>Policy &gt; Edit Tags</strong> menu. After tagging a VM and navigating to the VM list, the VM will show up in the user interface.</p>
<p>This process works the same way for all other objects. If Joe Doe should be able to order a specific item from the service catalog, the item or bundle has to be tagged with the <em><strong>Department/Engineering</strong></em> tag to make it visible.</p>
<h2>Working with Multiple Tags</h2>
<p>If a VM or other object has to be visible to multiple groups, we can add all the necessary tags to the object. For instance, adding the <em><strong>Department/Finance</strong></em> tag to a VM, makes the VM available to members of the “Finance Department” group, which also has that tag.</p>
<p>Tags within the same tag category are processed as logical OR relationships. That is, if at least one tag of the group matches with at least one tag of the object, access is granted. For example, if a user is in a group with the <em><strong>Department/Engineering</strong></em> or <em><strong>Department/Finance</strong></em> tag, they will see the object. Users which are in a group with neither the <em><strong>Department/Engineering</strong></em> or <em><strong>Department/Finance</strong></em> tag, will not see the object. This also applies, if the object isn’t tagged with any tag &#8211; which means, nobody will see it.</p>
<h3>Second Gotcha!</h3>
<p>Tag restrictions also apply to Super Administrators! If you restrict the visibility of a Super Administrator by assigning them tags, they will no longer see those objects which do not have matching tags! Since Super Administrators can always fix tag assignments or remove the tags for their group, they can restore full visibility, but it’s probably best to make sure you never limit Super Administrators.</p>
<h3>Working with Multiple Tag Categories</h3>
<p>When working in more complex environments, multiple tag categories must be used. For example, in addition to separating VMs by departments, tags can be used to separate VMs in different stages of deployment (Development, QA, Production). However, as soon as multiple tag categories are introduced, things get a bit more complicated.</p>
<h3>Third Gotcha!</h3>
<p>When using multiple tag categories, there is a logical AND between tags in multiple categories. This is probably best explained with an example. CloudForms comes with a default tag category called <em><strong>Environment</strong></em> with tags like <em><strong>Development</strong></em> and <em><strong>Production</strong></em>.</p>
<p>If the “Engineering” group, of which Joe Doe is a member, gets the additional tag <em><strong>Environment/Development</strong></em>, Joe will only see objects which have the <em><strong>Department/Engineering</strong></em> tag and the <em><strong>Environment/Development</strong></em> tag.  A VM tagged as <em><strong>Department/Engineering</strong></em> and <em><strong>Environment/Production</strong></em> will be hidden from Joe.</p>
<table style="border:none;">
<tbody>
<tr>
<th style="border:1px solid #cccccc;text-align:center;padding:12px;background-color:#aaaaaa;"><b>Object Tags</b></th>
<th style="border:1px solid #cccccc;text-align:center;padding:12px;background-color:#aaaaaa;"><b>Group Tags</b></th>
<th style="border:1px solid #cccccc;text-align:center;padding:12px;background-color:#aaaaaa;"><b>Visible?</b></th>
</tr>
<tr>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;">Yes, Tags match.</td>
</tr>
<tr>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b><br />
AND<br />
<b><i>Department/Finance</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;">Yes. At least one tag in the same category matches.</td>
</tr>
<tr>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b><br />
AND<br />
<b><i>Environment/Development</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;">No. Tags from multiple categories, so both must match.</td>
</tr>
<tr>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b><br />
AND<br />
<b><i>Environment/Production</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b><br />
AND<br />
<b><i>Environment/Development</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;">No. Tags from multiple categories, so both must match.</td>
</tr>
<tr>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b><br />
AND<br />
<b><i>Environment/Development</i></b><br />
AND<br />
<b><i>Environment/Production</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;"><b><i>Department/Engineering</i></b><br />
AND<br />
<b><i>Environment/Development</i></b></td>
<td style="border:1px solid #cccccc;text-align:center;padding:12px;">Yes. At least one tag in each tag category matches.</td>
</tr>
</tbody>
</table>
<p>This is very important and often causes confusion. As soon as you start tagging objects with tags from different tag categories, the logical AND comes into play!</p>
<h2>Conclusion: Think Before You Tag</h2>
<p>There are a few rules we try to follow when we plan tagging:</p>
<ul>
<li>Don’t use tags for information which is already available as an attribute for the object. For example, tagging all Windows VMs as <strong><em>Operating System Windows</em></strong> is in most cases not a good idea. Since this information is already stored in an VM attribute, you can use a filter to find all of the Windows VMs.</li>
<li>Try to minimize the number of tags and tag categories. Having a large number of categories and tags makes things more complicated.</li>
<li>Think before you add a new tag or tag category. Besides increasing the number of tags or tag categories, you will have to tag all of the objects already in CloudForms.</li>
<li>Try to use auto tagging where possible. Instead of manually tagging objects, write Automate code to do this for you or make use of the CloudForms REST API.</li>
</ul>
<p>Tags are a very simple and yet powerful way to manage access control lists. Used properly, they can provide greater flexibility and manageability in CloudForms. For more information on tags and access control, see the following resources:</p>
<p style="padding-left:30px;"><a href="https://access.redhat.com/articles/421423" target="_blank">Creating and Using Tags in Red Hat CloudForms</a></p>
<p style="padding-left:30px;"><a href="https://www.youtube.com/watch?v=C5nBexDu2ug" target="_blank">Planning your CloudForms tagging taxonomy</a></p>
]]></html><thumbnail_url><![CDATA[https://cloudformsredhat.files.wordpress.com/2016/10/image41.png?fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[262]]></thumbnail_width><thumbnail_height><![CDATA[329]]></thumbnail_height></oembed>