# Rules

Rules is a CCA feature that checks the resources used in the cloud, returning recommendations for optimizing the environment.

The rules are divided into two categories: **Savings** and **Best Practices**.

**How to get to Rules:**&#x20;

1. In the CCA side feature menu, select **Rules**.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FN5Rhnt5ItpXhQMH2G8pv%2Fimage.png?alt=media&#x26;token=4f3c1686-36fc-4271-9bfb-91b5d19316d9" alt=""><figcaption></figcaption></figure>

2. **Filters**

On the home screen it possible to search for available rules:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FxlJXz1v9S7gzxz8KiUQg%2Fimage.png?alt=media&#x26;token=6642f3c4-7af6-4b5e-8269-e9b474d70a15" alt=""><figcaption></figcaption></figure>

And filter by categories:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FrKlBOVLLpIfMbZmPZsdI%2Fimage.png?alt=media&#x26;token=1f8a938c-0af4-48b5-86c7-311e4e84276b" alt=""><figcaption></figcaption></figure>

3. **Report**&#x20;

When you click on “**Download report**”, a .csv file is downloaded with details of all the rules.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2F2DkCerWEZV8ztJrDog0O%2Fimage.png?alt=media&#x26;token=ccc97dbf-96af-47fd-86e9-aa482d17615d" alt=""><figcaption></figcaption></figure>

4. **Rules**

The CCA Rules are a set of recommendations based on the services available by the provider, and are divided into the two categories mentioned above.&#x20;

For each rule, it is possible to view some information:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FOytVqPkJl9pmyqwEB9zz%2Fimage.png?alt=media&#x26;token=c9061b50-2d28-4a25-97c7-9eb26568e86c" alt=""><figcaption></figcaption></figure>

* **Monitored Accounts**: Lists the number of accounts being monitored for this recommendation.
* **Total Resources Found**: Lists the number of resources that apply to the rule.
* **Total estimated savings**: Estimated cost of savings with implementation of the recommendations.

Clicking on the rule name in blue opens a detailed breakdown of the rule, showing the following information:

* Monitored accounts
* Non-compliance resources
* Total ignored resources found
* Ignored resources cost
* Total estimated savings

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2F3xszHTDUiSLQvCiVp5q0%2Fimage.png?alt=media&#x26;token=d0cf397c-77d9-42e4-a604-65d27a199c51" alt=""><figcaption></figcaption></figure>

The system also allows you to filter by **Account ID**, **Resource ID**, or **Region**, as highlighted below:

{% hint style="info" %}
**As filters are applied, the data displayed in the rule’s overview panel may change.**
{% endhint %}

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FQvx4kn6mPtlTY5qSjTvt%2Fimage.png?alt=media&#x26;token=aceffe65-9400-49d4-a952-789384a20116" alt=""><figcaption></figcaption></figure>

Clicking on the option “**Download report**”, a .csv file is downloaded with details only for the selected rule.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FfbrDnMMnhjLInGgYxZBb%2Fimage.png?alt=media&#x26;token=2982cb93-77f4-40bd-a127-fc2c5aa694c4" alt=""><figcaption></figcaption></figure>

Further down, the system presents some action options:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FJ3Jfdk0CL6FqyJqcjAxG%2Fimage.png?alt=media&#x26;token=9f533eee-85a4-4ea1-95d7-72b637f0b085" alt=""><figcaption></figcaption></figure>

* By clicking the ignore icon "<img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FSZwKW3Dg2JRzQVz82abn%2Fimage.png?alt=media&#x26;token=933dc8d0-27e4-4167-b0d7-49d754ba6a6d" alt="" data-size="line">"  you can ignore the recommendation for that selected resource. The system will display a screen to you explain the reason why you want to ignore the resource.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FGlxLZPiq8pp7CE0Toeki%2Fimage.png?alt=media&#x26;token=3a62a04f-3919-4ab8-9e87-6f5cfe98d900" alt="" width="563"><figcaption></figcaption></figure>

By describing the reason and confirming the action, clicking the checkbox, the system will enable the button to complete the action:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FUGKnrNmLvxAwuTfcJ3Zn%2Fimage.png?alt=media&#x26;token=34a0e1de-9355-4396-9564-6125e06b9894" alt="" width="563"><figcaption></figcaption></figure>

* In the icon next to ![](https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fu0rb6VcN1p9ckuon3i9i%2Fimage.png?alt=media\&token=232ea769-f3f1-4eb4-9076-4703dc410982)" you can view details about the chosen resource such as **resource information** and **Meta Data**:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FQO62L710gfaXmy1HliAw%2Fimage.png?alt=media&#x26;token=8f1c94ea-b616-4adf-9f45-dddcbf1b638a" alt=""><figcaption></figcaption></figure>

5. **Rule settings**

By clicking on the gear "![](https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FRFud48GBmCawQuARLQ6v%2Fimage.png?alt=media\&token=e9fe2993-1532-4d61-b6e0-f9759c0cc475)", as highlighted below:

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fl1cLoSI8D4oPxPjJ6QuX%2Fimage.png?alt=media&#x26;token=02894762-6d9a-4a89-84b4-02904d8a090a" alt=""><figcaption></figcaption></figure>

The system opens the rule configuration, where you can search for the customization you want to view.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2F17DhWItG8DbLwtN1UzMU%2Fimage.png?alt=media&#x26;token=d489fc9a-c241-421b-a174-3e13cac6410d" alt=""><figcaption></figcaption></figure>

By clicking on the "![](https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2Fe2WSg4fY26fEt4DfrPWY%2Fimage.png?alt=media\&token=6d3c223a-cad1-49d7-b670-6cc90334079d)" key corresponding to the customization, it is possible to open the rule customizations, allowing you to disable the rule chosen in “**Status**”.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FP8bGKrZHWiO4sM41OU9l%2Fimage.png?alt=media&#x26;token=a4a54d27-b7f3-4f1e-b6e9-26f257796195" alt=""><figcaption></figcaption></figure>

**Default Settings:**

In **default setting**, it is possible to have the configuration specified for each resource as:

* **Non-compliance after**: Number of days after which the resource begins to be considered non-compliant.  \
  Example: Infrequent users: after 15 days, it is considered non-compliant.
* **Regions**: The regions that will be listed are the regions that are being monitored.&#x20;

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FqAbInTB9V1BDZhoGS6ax%2Fimage.png?alt=media&#x26;token=ef95d5b3-890d-4c25-8ea8-0b72dc9948d1" alt=""><figcaption></figcaption></figure>

By clicking the **Edit** option, you can configure the acceptable period for the resource to be considered out of compliance.

The system will prompt you to fill in the following fields:

* Filter period operator: Select from the available options
  * **Less than**: When you want the number of days for the resource to be considered out of compliance to be less than the specified number.
  * **Greater than**: When you want the number of days for the resource to be considered out of compliance to be greater than the specified number.
* Filter period days: Specify the number of days for the rule to be considered out of compliance.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FHNmrVCIBbnBowrKKFaZd%2Fimage.png?alt=media&#x26;token=d4a43336-cb8a-44be-b292-e0d9a4d999ef" alt=""><figcaption></figcaption></figure>

By clicking the **save** button, the system will complete the rule compliance customization.

{% hint style="warning" %}
If this rule has no customization, the compliance value will be as per the default values.
{% endhint %}

It is possible to add new customizations to the rule.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FnKPRf7grRBPr4547tLce%2Fimage.png?alt=media&#x26;token=91be3d99-8091-4b44-a660-801b7ae87612" alt=""><figcaption></figcaption></figure>

Clicking Add opens the customization screen, where you will need to fill in the following information:

* **Filter kind**: Select between the two existing filter types
  * Filter only the resources that match the filter
  * Filter only the resources that do not match the filter
* **Filter key**: Enter the filter key that matches the tag
* **Enter the filter value**: Enter the value you want to return in the filter

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FXTm6ROHbdbkx1ivNGu6O%2Fimage.png?alt=media&#x26;token=b5ee6c01-6902-4326-ae1e-939acf5fe7f2" alt=""><figcaption></figcaption></figure>

After entering the desired customizations, just click **save**, and the customization will be added to the selected rule.

### Rules of Savings

1. **Idle Compute Instances:** Identify compute instances that are not being used. These instances may be generating unnecessary costs.
2. **Bucket Without Enabled Multipart Upload Exclusion Policy:** Identifies buckets without enabled multipart upload exclusion policies, which may lead to inefficient storage usage and increased costs in Oracle Cloud Infrastructure.
3. **Disk Detached:** Identifies persistent disks on Oracle Cloud Infrastructure that are not currently attached to any virtual machine and have remained unused for a configurable number of days. These disks may be incurring storage costs without providing operational value.
4. **Bucket Without Active Infrequent Access Policy:** Identifies buckets without active infrequent access policies, which can lead to inefficient storage usage and increased costs in Oracle Cloud Infrastructure.

### Best Practice Rules

1. **Enable Monitoring on Compute Instances**: Identify compute instances that have the compute instance monitoring agent disabled. This prevents resource utilization metrics such as CPU and memory from being tracked.
