<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: gjorgivarelov</title>
    <description>The latest articles on The Ops Community ⚙️ by gjorgivarelov (@gjorgivarelov).</description>
    <link>https://community.ops.io/gjorgivarelov</link>
    <image>
      <url>https://community.ops.io/images/aBUJV8NjSHlyG3Ys325RYjkLCFlMcl3h-1hbez02OGU/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS8yNjgvMzA5/YmEwOGYtZDMxZC00/ODEwLWIwNDEtMDhm/NGM0ODAwYmM4LnBu/Zw</url>
      <title>The Ops Community ⚙️: gjorgivarelov</title>
      <link>https://community.ops.io/gjorgivarelov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/gjorgivarelov"/>
    <language>en</language>
    <item>
      <title>FinOps: the definition</title>
      <dc:creator>gjorgivarelov</dc:creator>
      <pubDate>Mon, 06 Jun 2022 01:05:42 +0000</pubDate>
      <link>https://community.ops.io/gjorgivarelov/finops-the-definition-40e2</link>
      <guid>https://community.ops.io/gjorgivarelov/finops-the-definition-40e2</guid>
      <description>&lt;p&gt;I am intrigued by the abbreviation: is FinOps dealing only with cloud processing cost? Is it also including APIs that enable e-commerce and payment processing online? From the topics posted in this part of the Ops community, it seems like cutting cost on AWS is the main focus of FinOps.&lt;br&gt;
I could use a search engine to dig on the FinOps meaning, but I thought I may get a more relevant answer from the professionals of that field posting here...&lt;/p&gt;

</description>
      <category>finops</category>
      <category>help</category>
    </item>
    <item>
      <title>SELinux: need I say more to scare you?</title>
      <dc:creator>gjorgivarelov</dc:creator>
      <pubDate>Mon, 06 Jun 2022 00:56:57 +0000</pubDate>
      <link>https://community.ops.io/gjorgivarelov/selinux-need-i-say-more-to-scare-you-3k8p</link>
      <guid>https://community.ops.io/gjorgivarelov/selinux-need-i-say-more-to-scare-you-3k8p</guid>
      <description>&lt;p&gt;SELinux: it may be the scarecrow for many and a best friend for the few. In these few following posts, I'll try to explain how to handle SELinux if one encounters it as an obstacle, with minimal explanation on historical background. Like for example the fact that it is a creation of the NSA. Yes, that government agency contributed to open source software. And that's it for the historical context.&lt;br&gt;
By now, you are aware that SELinux' role is to deny access to a resource you sent a process to use. And indeed, SELinux provides an extra level of security beyond user-based and access control list prescribed access to system resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  At the basic level...
&lt;/h2&gt;

&lt;p&gt;SELinux operates on the concept of &lt;strong&gt;security contexts&lt;/strong&gt;. Each resource on the system- a file, directory, device, port- has a context label on it. Each process running on the system has such a context label as well. It is at the moment that a process is trying to access a system resource that SELinux jumps into action and decides whether that process is authorized to access the resource or not. If labels of both the process and the resource that is about to be accessed match, then the process will successfully access that resource. If labels don't match, SELinux will deny access but also will produce a denial message and assign it a unique UUID that you can later use to read the denial message and take action- which usually consists of re-labeling the resource with the correct label that will allow the process to access that resource. You probably guessed it, re-labeling a resource requires elevated user privileges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is SELinux running on my machine?
&lt;/h2&gt;

&lt;p&gt;Let's first see if SELinux itself is turned on while your system is running, and after that we'll see how to check labels of a process, a port and a file (representing every type of resource on a Unix system).&lt;br&gt;
There are three available states in which SELinux may be running. To check on the current state, you don't need elevated privileges. Just issue:&lt;br&gt;
&lt;code&gt;getenforce&lt;/code&gt;&lt;br&gt;
as a regular user at the command line and one of the following three may be returned: Permissive, Enforcing or Disabled.&lt;br&gt;
One of the novelties/oddities of RHEL 9 is that SELinux by default is now running in Permissive mode: SELinux will not deny access to a resource when its label and the label of the process trying to access aren't matching, but will produce an error message and log it into syslog. That default setting was Enforcing on previous versions of RHEL.&lt;br&gt;
Knowing now what Permissive mode does, you can safely guess what Enforcing and Disabled modes do: enforce SELinux policies that prevent access when labels are mismatched and Disabled will completely turn off SELinux- both its ability to restrict access and to log policy violations.&lt;br&gt;
You may be enticed to think that setting SELinux mode to Disabled on the system is an unsafe way to operate that system. It is however best to consult higher-ups in your hierarchy at work or organization-level documentation on that system before rushing to switch to Enforcing mode: certain pieces of hardware, not always legacy, have no concept of access to them regulated beyond user-level.  In the past, sysadmins were left with no choice but to disable SELinux to make the non-standard hardware work with the system.&lt;br&gt;
If you are the only one in charge of the system and you felt the need to switch around SELinux modes on a running system (educational purposes or testing if SELInux is denying access to a resource- as a part of the troubleshooting process), as a user with elevated privileges, to switch up the level of enforcement, issue:&lt;br&gt;
&lt;code&gt;setenforce Enforcing&lt;/code&gt;&lt;br&gt;
or if you need to lower the level of enforcement:&lt;br&gt;
&lt;code&gt;setenforce Permissive&lt;/code&gt;&lt;br&gt;
Both modes have their numerical equivalents of 1 for Enforcing or 0 for Permissive. Now, disabling SELinux is done at a different level, at the kernel boot level: either as a kernel boot parameter &lt;strong&gt;selinux=0&lt;/strong&gt; at boot time (which change will not survive reboot) or adding that option as a permanent kernel boot option.&lt;br&gt;
As is with all subjects Linux, there's a config file that sets the switches for SELinux operation, that file is &lt;strong&gt;/etc/selinux/config&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking labels
&lt;/h2&gt;

&lt;p&gt;To check the label of a specific file, add the &lt;strong&gt;-Z&lt;/strong&gt; option to the ls command:&lt;br&gt;
&lt;code&gt;ls -Z /home/gjorgivarelov/file1&lt;/code&gt;&lt;br&gt;
will produce the context label of that file.&lt;br&gt;
Let's say there was a process &lt;strong&gt;p1&lt;/strong&gt; that tried to access the file &lt;strong&gt;file1&lt;/strong&gt; and SELinux prevented that but now that you are equipped with some awareness of SELinux being present on your system, you can quickly check the label of the process &lt;strong&gt;p1&lt;/strong&gt; as well:&lt;br&gt;
&lt;code&gt;ps -Z p1&lt;/code&gt;&lt;br&gt;
and check that label against the output of the &lt;code&gt;ls -Z&lt;/code&gt; command on &lt;strong&gt;file1&lt;/strong&gt;.&lt;br&gt;
That was easy, but how about checking the SELinux context label of a port? Let's say you need to check the context label of port 80, very common when setting up a web server. Elevated privileges to the rescue and:&lt;br&gt;
&lt;code&gt;semanage port -l | grep /\&amp;lt;80\&amp;gt;/&lt;/code&gt;&lt;br&gt;
Labels of ports, processes and resources aren't unique to each resource or process. Several ports can have the same label and the same goes for processes and files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Labels aren't the only game in SELinux town
&lt;/h2&gt;

&lt;p&gt;SELinux is able to present additional obstacles to processes trying to access resources on the system. Just because labels match doesn't mean that process has unchecked access to the resource. Enter SEBooleans. Once a process is granted access to a resource, SEBooleans present constraints within which the process can use the resource. Many of those Booleans have to do with network access, meaning they (dis)allow network access to a resource. As you may have guessed already, these values can only be on or off. You may have already encountered the need to switch an SELinux Boolean on or off while configuring a port to be used by a web server on a system that has SELinux at Enforcing.&lt;br&gt;
To check if a Boolean is switched on or off:&lt;br&gt;
&lt;code&gt;getsebool -a | grep 'that_boolean'&lt;/code&gt;&lt;br&gt;
and see if a required Boolean is on the list and is it turned on or off.&lt;br&gt;
Toggle the Boolean on or off for the current session, for example turning on Boolean &lt;strong&gt;se_bool_1&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;setsebool se_bool_1 on&lt;/code&gt;&lt;br&gt;
of course with elevated privileges. Or to toggle to a new state permanently (survives reboot):&lt;br&gt;
&lt;code&gt;setsebool -P se_bool_1 on&lt;/code&gt;&lt;br&gt;
Unlike labels, SE Booleans carry names unique to the action they (dis)allow. For example, to enable access to a non-standard port for the httpd process, part of the procedure might involve switching on  SELinux Booleans whose name starts with &lt;strong&gt;httpd_&lt;/strong&gt;. Names of these Booleans are pretty descriptive most of the time.&lt;br&gt;
This concludes the introduction to SELinux, next to present will be the &lt;strong&gt;semanage&lt;/strong&gt; command and how to change labels on a resource, along with the mechanism of inheritance of SELinux labels by resources at different levels of system's hierarchy.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>tutorials</category>
      <category>productivity</category>
      <category>secops</category>
    </item>
    <item>
      <title>UPGRADING FROM RHEL 8 TO RHEL 9</title>
      <dc:creator>gjorgivarelov</dc:creator>
      <pubDate>Fri, 27 May 2022 19:27:46 +0000</pubDate>
      <link>https://community.ops.io/gjorgivarelov/upgrading-from-rhel-8-to-rhel-9-1d4a</link>
      <guid>https://community.ops.io/gjorgivarelov/upgrading-from-rhel-8-to-rhel-9-1d4a</guid>
      <description>&lt;p&gt;I was so excited to see RHEL 9.0 released out of beta stages and into GA (general availability) that I felt compelled to upgrade my RHEL 8 installation. Upgrading an existing installation to a newer version without going through a clean install is what Red Hat calls "in-place upgrade". Remembering how I was forced to do a clean install when upgrading from RHEL 7 to 8, I was intrigued by the process described in the RH docs on in-place upgrading.&lt;br&gt;
    All commands are executed as a user with elevated privileges, even the reboot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Get your existing RHEL installation to version 8.6&lt;/li&gt;
&lt;li&gt;Install the Leapp utility&lt;/li&gt;
&lt;li&gt;Uninstall apps with non-Red-Hat-signed GPG keys. These apps were reported by the pre-installation check utility to be able to crash the entire upgrade process.&lt;/li&gt;
&lt;li&gt;Run the pre-installation check to see what would impede or halt the in-place upgrade process.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Only after you satisfy all four can you assume safe upgrade to RHEL 9. &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Get your existing RHEL installation to 8.6
&lt;/h2&gt;

&lt;p&gt;I had my own installation at RHEL version 8.5 so I needed to update to 8.6. There was actually a lot to update. Make sure your BaseOS and AppStream repositories are enabled. They are on most RHEL 8 systems unless you heavily customized your own system since the original RHEL 8 installation.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dnf update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It will take A BIT of time. And once done with the update to 8.6, if you want to verify you are actually at 8.6:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/redhat-release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;subscription-manager list --installed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;which should report RHEL 8.6 as the version you are running on. Next to do:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  2. Installing the Leapp utility:
&lt;/h2&gt;

&lt;p&gt;Yes, that's Leapp with "pp" at the end. Installing this utility is a prerequisite for carrying on the in-place upgrade:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dnf install leapp-upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;From here, you could stay with the command-line and run the pre-upgrade leapp to see if anything  impedes the upgrade process- sort of a dry run, very helpful, I don't remember seeing this approach with the leap from RHEL 7 to 8. Or you could install Leapp's Cockpit add-on and carry on with running the pre-upgrade within Cockpit's terminal. The advantage of using Cockpit is that the report of pre-upgrade run will be presented graphically and you will have the option to take the required corrective steps with just a click of a button...&lt;/p&gt;

&lt;h2&gt;
  
  
  3. ...of course I went for the easy option and installed the Cockpit add-on:
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dnf install cockpit-leapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Log in to the web console by pointing your browser to &lt;a href="https://localhost:9090"&gt;https://localhost:9090&lt;/a&gt;, provided you have Cockpit up and running and listening to port 9090. Open the Terminal tab...&lt;/p&gt;

&lt;h2&gt;
  
  
  4. ... and then, in that terminal, run the pre-upgrade test:
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;leapp preupgrade --target 9.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Test will take SOME time to complete, after which you'll be presented with a report both on the terminal and more importantly, as an option at the bottom of the left bar of Cockpit's page. Click on the Upgrade Report to view and take action on possible future complications on your upgrade path.&lt;br&gt;
&lt;strong&gt;Color coding is done right.&lt;/strong&gt; In both CLI version of the report and the graphical version, red means trouble. Potential problems are graded with a Risk Factor on different levels, in which High can rarely be ignored. Problems are also graded as Inhibitor yes/no. An issue can have a risk factor of High and an Inhibitor- which issue can definitely not be ignored but just follow the corrective steps suggested.&lt;br&gt;
In my case, Google Chrome and VS Code were highlighted as Risk Factor: High and Inhibitors because their RPMs' GPG keys aren't signed by Red Hat. I had to uninstall both to have the report come back with issues with low level risk factor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites satisfied? Upgrade!
&lt;/h2&gt;

&lt;p&gt;Once you get that Upgrade Report to report issues in all blue (or green in CLI), you are ready for the upgrade!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;leapp upgrade --target 9.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and for the next hour (more or less, depending on the size of the filesystem(s) you're upgrading and the speed of your internet connection) the process is pretty much automated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The whole process, from updating to RHEL 8.6 to upgrading to RHEL 9 and getting back the fully upgraded system back for my usage took 3 hours. It isn't a trivial undertaking compared with upgrades on more consumer-oriented OSes, but it's much, much better compared with the upgrade from RHEL 7 to 8.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>tutorials</category>
      <category>random</category>
      <category>help</category>
    </item>
  </channel>
</rss>
