이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Monitoring and reacting to configuration changes by using policies
How to create policies to detect inventory configuration changes and send email notifications
Abstract
Chapter 1. Red Hat Lightspeed policies service overview 링크 복사링크가 클립보드에 복사되었습니다!
Policies evaluate system configurations in your environment, and can send notifications when changes occur. Policies you create are applicable to all systems in your Red Hat Lightspeed inventory. You can create and manage policies by using the Red Hat Lightspeed user interface in the Red Hat Hybrid Cloud Console, or using the Red Hat Lightspeed API.
Policies can assist you by managing tasks such as:
- Raising an alert when particular conditions occur in your system configuration.
- Emailing a team when security packages are out of date on a system.
Using policies to monitor configuration changes in your inventory and notifying by email requires:
- Setting user email preferences (if not already set).
- Creating a policy to detect configuration changes as a trigger and selecting email as the trigger action.
- Configure User Access in Red Hat Hybrid Cloud Console > the Settings icon (⚙) > Identity & Access Management > User Access > Users.
- See User Access configuration guide for role-based access control (RBAC) for more information about this feature and example use cases.
1.1. User Access settings in the Red Hat Hybrid Cloud Console 링크 복사링크가 클립보드에 복사되었습니다!
User Access is the Red Hat implementation of role-based access control (RBAC). Your Organization Administrator uses User Access to configure what users can see and do on the Red Hat Hybrid Cloud Console (the console):
- Control user access by organizing roles instead of assigning permissions individually to users.
- Create groups that include roles and their corresponding permissions.
- Assign users to these groups, allowing them to inherit the permissions associated with their group’s roles.
1.1.1. Predefined User Access groups and roles 링크 복사링크가 클립보드에 복사되었습니다!
To make groups and roles easier to manage, Red Hat provides two predefined groups and a set of predefined roles:
Predefined groups
The Default access group contains all users in your organization. Many predefined roles are assigned to this group. It is automatically updated by Red Hat.
NoteIf the Organization Administrator makes changes to the Default access group its name changes to Custom default access group and it is no longer updated by Red Hat.
The Default admin access group contains only users who have Organization Administrator permissions. This group is automatically maintained and users and roles in this group cannot be changed.
On the Hybrid Cloud Console navigate to Red Hat Hybrid Cloud Console > the Settings icon (⚙) > Identity & Access Management > User Access > Groups to see the current groups in your account. This view is limited to the Organization Administrator.
Predefined roles assigned to groups
The Default access group contains many of the predefined roles. Because all users in your organization are members of the Default access group, they inherit all permissions assigned to that group.
The Default admin access group includes many (but not all) predefined roles that provide update and delete permissions. The roles in this group usually include administrator in their name.
On the Hybrid Cloud Console navigate to Red Hat Hybrid Cloud Console > the Settings icon (⚙) > Identity & Access Management > User Access > Roles to see the current roles in your account. You can see how many groups each role is assigned to. This view is limited to the Organization Administrator.
1.1.2. Access permissions 링크 복사링크가 클립보드에 복사되었습니다!
The Prerequisites for each procedure list which predefined role provides the permissions you must have. As a user, you can navigate to Red Hat Hybrid Cloud Console > the Settings icon (⚙) > My User Access to view the roles and application permissions currently inherited by you.
If you try to access Red Hat Lightspeed features and see a message that you do not have permission to perform this action, you must obtain additional permissions. The Organization Administrator or the User Access administrator for your organization configures those permissions.
Use the Red Hat Hybrid Cloud Console Virtual Assistant to ask "Contact my Organization Administrator". The assistant sends an email to the Organization Administrator on your behalf.
Additional resources
For more information about user access and permissions, see User Access configuration guide for role-based access control (RBAC).
1.1.3. User Access roles for the Policies service 링크 복사링크가 클립보드에 복사되었습니다!
The following predefined roles on the Red Hat Hybrid Cloud Console enable access to policies features in Red Hat Lightspeed:
- Policies administrator role. The Policies administrator role provides read and write access allowing these users to perform any available operation on policies resources. This predefined role is in the Default admin access group.
- Policies viewer role. The Policies viewer role provides read-only access. (If your organization determines that the default configuration of the Policies viewer role is inadequate, a User Access administrator can create a custom role with the specific permissions that you need.) This predefined role is in the Default access group.
If you configured groups before April 2023, any user who was not an Organization Administrator will have the Policies administrator role replaced with the Policies viewer role. Modifications made to the Default access group before April are not changed.
Additional Resources
- How to use User Access in the User Access configuration guide for role-based access control (RBAC).
- Predefined User Access roles
Chapter 2. Setting notifications and email preferences 링크 복사링크가 클립보드에 복사되었습니다!
By configuring notifications and user preferences settings in the Red Hat Hybrid Cloud Console, Red Hat Lightspeed will notify you of policy changes to your Red Hat Enterprise Linux systems.
2.1. Enabling notifications and integrations for the policies service 링크 복사링크가 클립보드에 복사되었습니다!
You can enable the notifications service on the Red Hat Hybrid Cloud Console to send notifications whenever the policy service detects an issue and generates an alert. Using the notifications service frees you from having to continually check the Red Hat Lightspeed Dashboard for alerts.
For example, you can configure the notifications service to automatically send an email message whenever the policies service detects that a server’s security software is out of date, or to send an email digest of all the alerts that the policies service generates each day.
In addition to sending email messages, you can configure the notifications service to send policies event data in other ways:
- Using an authenticated client to query Red Hat Lightspeed APIs for event data
- Using webhooks to send events to third-party applications that accept inbound requests
- Integrating notifications with applications such as Splunk to route policies events to the application dashboard
Enabling the notifications service requires three main steps:
- First, an Organization Administrator creates a User access group with the Notifications administrator role, and then adds account members to the group.
- Next, a Notifications administrator sets up behavior groups for events in the notifications service. Behavior groups specify the delivery method for each notification. For example, a behavior group can specify whether email notifications are sent to all users, or just to Organization administrators.
- Finally, users who receive email notifications from events must set their user preferences so that they receive individual emails for each event.
2.2. Setting user preferences 링크 복사링크가 클립보드에 복사되었습니다!
To receive email notifications, you can set or update your email preferences using the following procedure.
Procedure
- Navigate to Operations > Policies.
- Click Open user preferences. The My Notifications page appears.
- Select Red Hat Enterprise Linux > Policies from the left menu.
- Check the appropriate boxes to define your policies notification preferences.
Depending on your email notification preferences, you can subscribe to Instant notification emails for each system with triggered policies or a Daily digest summarizing triggered application events in a 24-hour time frame. To unsubscribe from all notifications, select Unsubscribe from all.
NoteSubscribing to instant notifications can result in receiving many emails on large inventories. To reduce the volume of emails, consider selecting the Daily digest option.
- Click Submit.
Chapter 3. Creating policies 링크 복사링크가 클립보드에 복사되었습니다!
The following workflow examples explain how to create several types of policies that detect system configuration changes and send notification of the changes by email.
When creating a policy, if you see a warning message that you have not opted in for email alerts, set your User preferences to receive email from your policies.
3.1. Creating a policy to ensure public cloud providers are not over provisioned 링크 복사링크가 클립보드에 복사되었습니다!
Create a policy using the following procedure.
Procedure
- In Red Hat Hybrid Cloud Console, go to Operations > Policies.
- Click Create policy.
- On the Create a policy page, click From scratch or As a copy of existing Policy as required. Note that the As a copy of existing Policy option will prompt you to select a policy from the list of existing policies to use as a starting point.
- Click Next.
Enter Condition. In this case, enter: facts.cloud_provider in ['alibaba', 'aws', 'azure', 'google'] and (facts.number_of_cpus >= 8 or facts.number_of_sockets >=2). This condition will detect if an instance running on the specified public cloud providers is running with CPU hardware higher than the allowed limit.
NoteYou can expand What condition can I define? and/or Review available system facts to view an explanation of conditions you can use, and see the available system facts, respectively. In this section are examples of syntax you can use.
- Click Validate condition.
- Once the condition is validated, click Next.
- On the Trigger actions page, click Add trigger actions. If notifications are greyed out, select Notification settings in the notifications box. Here you can customize notifications and their behaviors.
Click Next.
NoteOn the Trigger actions page, you can also enable email alerts and set other available email preferences.
- On the Review and enable page, click the toggle switch to activate the policy and review its details.
- Click Finish.
Your new policy is created. When the policy is evaluated on a system check-in, if the condition in the policy is met, Policies automatically sends an email to all users on the account with access to Policies, depending on their email preferences.
3.2. Creating a policy to detect if systems are running an outdated version of RHEL 링크 복사링크가 클립보드에 복사되었습니다!
You can create a policy that detects if systems are running outdated versions of RHEL and notifies you by email about what it finds.
Procedure
- In Red Hat Hybrid Cloud Console, go to Operations > Policies.
- Click Create policy.
- On the Create policy page, click From scratch or As a copy of existing Policy as required. Note that the As a copy of existing Policy option prompts you to select a policy from the list of existing policies to use as a starting point.
- Click Next.
- Enter a Name and Description for the policy.
- Click Next.
- Enter Condition. In this case, enter facts.os_release < 8.1. This condition will detect if systems still run an outdated version of our operating system based on RHEL 8.1.
- Click Validate condition, then click Next.
- On the Trigger actions page, click Add trigger actions and select Email.
- Click Next.
- On the Review and activate page, click the toggle switch to activate the policy and review its details.
- Click Finish.
Your new policy is created. When the policy is evaluated on a system check-in, if the condition in the policy is triggered, the policies service automatically sends an email to all users on the account with access to Policies, depending on their email preferences.
3.3. Creating a policy to detect a vulnerable package version based on recent CVE 링크 복사링크가 클립보드에 복사되었습니다!
You can create a policy that detects vulnerable package versions based on recent CVE and notifies you by email about what it finds.
Procedure
- In Red Hat Hybrid Cloud Console, go to Operations > Policies.
- Click Create policy.
- On the Create Policy page, click From scratch or As a copy of existing Policy as required. Note that the As a copy of existing Policy option will prompt you to select a policy from the list of existing policies to use as a starting point.
- Click Next.
- Enter a Name and Description for the policy.
- Click Next.
-
Enter Condition. In this case, enter facts.installed_packages contains ['openssh-4.5']. This condition will detect if systems still run a vulnerable version of an
opensshpackage based on recent CVE. - Click Validate condition, then click Next.
- On the Trigger actions page, click Add trigger actions and select Email.
- Click Next.
- On the Review and activate page, click the toggle switch to activate the policy and review its details.
- Click Finish.
Your new policy is created. When the policy is evaluated on a system check-in, if the condition in the policy is met, Policies automatically sends an email to all users on the account with access to Policies, depending on their email preferences.
Chapter 4. Reviewing and managing policies 링크 복사링크가 클립보드에 복사되었습니다!
You can review and manage all created policies (enabled and disabled) by navigating to Operations > Policies.
You can filter the list of policies by name and by active state. You can click the options menu next to a policy to perform the following operations:
- Enable and disable
- Edit
- Duplicate
- Delete
Additionally, you can perform the following operations in bulk by selecting multiple policies from the list of policies and clicking the options menu
located next to the Create policy button at the top:
- Delete policies
- Enable policies
- Disable policies
If you see a warning message about email alerts not opted in, set your User preferences to receive email from your policies.
Chapter 5. Appendix 링크 복사링크가 클립보드에 복사되었습니다!
This appendix contains the following reference materials:
- System Facts
- Operators
5.1. System Facts 링크 복사링크가 클립보드에 복사되었습니다!
The following table defines the system facts for use in system comparisons.
| Fact name | Description | Example value |
|---|---|---|
|
| Category with a list of Ansible-related facts |
|
|
| System architecture |
|
|
|
BIOS release date; typically | 01/01/2011 |
|
| BIOS vendor name | LENOVO |
|
| BIOS version | 1.17.0 |
|
|
Cloud vendor. Values are |
|
|
| Number of CPU cores per socket | 2 |
|
|
Category with a list of CPU flags. Each name is the CPU flag (ex: |
|
|
|
Category with a list of enabled services. Each name in the category is the service name (ex: |
|
|
| The fully qualified domain name (FQDN) of the system |
|
|
|
System infrastructure; common values are |
|
|
|
Infrastructure vendor; common values are |
|
|
| List of installed RPM packages. This is a category. |
|
|
|
Category with a list of installed services. Each name in the category is the service name (ex: |
|
|
|
List of kernel modules. Each name in the category is the kernel module (ex: |
|
|
|
The boot time in |
|
|
| Category with a list of Microsoft SQL Server-related facts |
|
|
| List of facts related to network interfaces. | |
|
There are six facts for each interface: | ||
|
Each interface is prefixed to the fact name. For example, the interface | ||
|
Most network interface facts are compared to ensure they are equal across systems. However, | ||
|
| Total number of CPUs |
|
|
| Total number of sockets |
|
|
| Kernel version |
|
|
| Kernel release |
|
|
| List of running processes. The fact name is the name of the process, and the value is the instance count. |
|
|
| SAP instance number |
|
|
| SAP system ID (SID) |
|
|
| Boolean field that indicates if SAP is installed on the system |
|
|
| SAP version number |
|
|
| Boolean field that indicates whether a system is registered to a Satellite Server |
|
|
| Current SELinux mode |
|
|
| SELinux mode set in the config file |
|
|
|
The number of failures, the number of current jobs queued, and the current state of |
|
|
| Total system memory in bytes |
|
|
|
Current profile resulting from the command |
|
|
|
List of yum repositories. The repository name is added to the beginning of the fact. Each repository has the associated facts |
|
5.2. Operators 링크 복사링크가 클립보드에 복사되었습니다!
| Operators | Value |
|---|---|
| Logical Operators | AND |
| OR | |
| Boolean Operators | NOT |
| ! | |
| = | |
| != | |
| Numeric Compare Operators | > |
| >= | |
| < | |
| <= | |
| String Compare Operators | CONTAINS |
| MATCHES | |
| Array Operators | IN |
| CONTAINS |
Providing feedback on Red Hat documentation 링크 복사링크가 클립보드에 복사되었습니다!
We appreciate and prioritize your feedback regarding our documentation. Provide as much detail as possible, so that your request can be quickly addressed.
Prerequisites
- You are logged in to the Red Hat Customer Portal.
Procedure
To provide feedback, perform the following steps:
- Click the following link: Create Issue
- Describe the issue or enhancement in the Summary text box.
- Provide details about the issue or requested enhancement in the Description text box.
- Type your name in the Reporter text box.
- Click the Create button.
This action creates a documentation ticket and routes it to the appropriate documentation team. Thank you for taking the time to provide feedback.