rename o2o and object2object to object_group

This commit is contained in:
root
2024-10-24 07:56:49 +00:00
parent 1cd21a43c9
commit da715f21ef
22 changed files with 311 additions and 311 deletions

View File

@@ -31,7 +31,7 @@ A complete use case consists of three parts:
### Case1
In the scanning scenario, it is necessary to configure the schema of multiple tables, including the item table, object2rule table, and rule table. If there is also object nesting involved, the schema of the object2object table needs to be configured.
In the scanning scenario, it is necessary to configure the schema of multiple tables, including the item table, object2rule table, and rule table. If there is also object nesting involved, the schema of the object_group table needs to be configured.
**(1) table schema**
@@ -67,8 +67,8 @@ Table schema is stored in a json file(such as table_info.json), which is loaded
},
{
"table_id":2,
"table_name":"OBJECT2OBJECT",
"table_type":"object2object",
"table_name":"OBJECT_GROUP",
"table_type":"object_group",
"valid_column":4,
"custom": {
"object_id":1,
@@ -100,7 +100,7 @@ Configurations are stored in a json file(such as maat_json.json), which is loade
{
"rule_table": "RULE",
"object2rule_table": "OBJECT2RULE",
"object2object_table": "OBJECT2OBJECT",
"object_group_table": "OBJECT_GROUP",
"rules": [
{
"rule_id": 123,
@@ -217,7 +217,7 @@ In the callback scenario, only the schema of the corresponding table needs to be
{
"rule_table": "RULE",
"object2rule_table": "OBJECT2RULE",
"object2object_table": "OBJECT2OBJECT",
"object_group_table": "OBJECT_GROUP",
"plugin_table": {
"table_name": "TEST_IP_PLUGIN_WITH_EXDATA",
"table_content": [

View File

@@ -13,7 +13,7 @@ The types of physical tables are as follows:
- [item table](#11-item-table)
- [rule table](#12-rule-table)
- [object2rule table](#13-object2rule-table)
- [object2object table](#14-object2object-table)
- [object_group table](#14-object_group-table)
- [plugin table](#15-plugin-table)
- [ip_plugin table](#16-ip_plugin-table)
- [fqdn_plugin table](#17-fqdn_plugin-table)
@@ -52,7 +52,7 @@ Describe matching rules for strings.
| **FieldName** | **type** | **constraint** |
| ---------------- | -------------- | ------- |
| **item_id** | LONG LONG | primary key |
| **object_id** | LONG LONG | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | LONG LONG | leaf object id, can be referenced by object_group & object2rule table |
| **keywords** | VARCHAR2(1024) | field to match during scanning |
| **expr_type** | INT | 0(keywords), 1(AND expr), 2(regular expr), 3(substring with offset)
| **match_method** | INT | only useful when expr_type is 0. 0(sub), 1(suffix), 2(prefix), 3(exactly) |
@@ -158,7 +158,7 @@ Describe extended matching rules for strings by adding the district column.
| **FieldName** | **type** | **constraint** |
| ---------------- | -------------- | ------- |
| **item_id** | LONG LONG | primary key |
| **object_id** | LONG LONG | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | LONG LONG | leaf object id, can be referenced by object_group & object2rule table |
| **district** | VARCHAR2(1024) | describe the effective position of the keywords |
| **keywords** | VARCHAR2(1024) | field to match during scanning |
| **expr_type** | INT | 0(keywords), 1(AND expr), 2(regular expr), 3(substring with offset)
@@ -183,7 +183,7 @@ Describe matching rules for IP address. Both the address and port are represente
| **FieldName** | **type** | **constraint** |
| -------------- | ------------ | -------------- |
| **item_id** | LONG LONG | primary key |
| **object_id** | LONG LONG | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | LONG LONG | leaf object id, can be referenced by object_group & object2rule table |
| **addr_type** | INT | Ipv4 = 4 Ipv6 = 6 |
| **addr_format**| VARCHAR2(40) | ip addr format, single/range/CIDR/mask |
| **ip1** | VARCHAR2(40) | start ip |
@@ -197,7 +197,7 @@ Determine whether an integer is within a certain numerical range.
| **FieldName** | **type** | **constraint** |
| ---------------- | -------- | -------------- |
| **item_id** | INT | primary key |
| **object_id** | INT | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | INT | leaf object id, can be referenced by object_group & object2rule table |
| **low_boundary** | INT | lower bound of the numerical range(including lb), 0 ~ (2^32 - 1)|
| **up_boundary** | INT | upper bound of the numerical range(including ub), 0 ~ (2^32 - 1)|
| **is_valid** | INT | 0(invalid), 1(valid) |
@@ -209,7 +209,7 @@ Describe extended matching rules for integer by adding the district column.
| **FieldName** | **type** | **constraint** |
| ---------------- | -------- | -------------- |
| **item_id** | INT | primary key |
| **object_id** | INT | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | INT | leaf object id, can be referenced by object_group & object2rule table |
| **district** | VARCHAR2(1024)| describe the effective position of the keywords |
| **low_boundary** | INT | lower bound of the numerical range(including lb), 0 ~ (2^32 - 1)|
| **up_boundary** | INT | upper bound of the numerical range(including ub), 0 ~ (2^32 - 1)|
@@ -220,7 +220,7 @@ Describe extended matching rules for integer by adding the district column.
| **FieldName** | **type** | **constraint** |
| ------------- | -------- | -------------- |
| **item_id** | INT | primary key |
| **object_id** | INT | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | INT | leaf object id, can be referenced by object_group & object2rule table |
| **flag** | INT | flag, 0 ~ (2^32 - 1)|
| **flag_mask** | INT | flag_mask, 0 ~ (2^32 - 1)|
| **is_valid** | INT | 0(invalid), 1(valid) |
@@ -230,7 +230,7 @@ Describe extended matching rules for integer by adding the district column.
| **FieldName** | **type** | **constraint** |
| ------------- | -------- | -------------- |
| **item_id** | INT | primary key |
| **object_id** | INT | leaf object id, can be referenced by object2object & object2rule table |
| **object_id** | INT | leaf object id, can be referenced by object_group & object2rule table |
| **district** | INT | describe the effective position of the flag |
| **flag** | INT | flag, 0 ~ (2^32 - 1)|
| **flag_mask** | INT | flag_mask, 0 ~ (2^32 - 1)|
@@ -262,7 +262,7 @@ Describe the relationship between object and rule.
NOTE: If object_id is invalid in xx_item table, it must be marked as invalid in this table.
### 1.4 <a name='Object2ObjectTable'></a> object2object table
### 1.4 <a name='Object2ObjectTable'></a> object_group table
Describe the relationship between objects.
@@ -402,7 +402,7 @@ Configuration tags are tags stored on compilation configurations or object confi
Maat loads the configuration of different types of tables into memory to form the corresponding runtime for each table. We can see all table types from the table schema, and the runtime for the item table is similar, as it is an abstraction of the scanning engine. When we provide the data to be scanned and call the corresponding scanning interface, we can return whether the item is hit or not, and if it is hit, we can return the corresponding items object_id.
From the [configuration relationship](./overview.md#12-configuration-relationship) diagram, we can see how the hit object is referenced by other objects or rules. If a hit object is referenced by other objects or rules, there will be one or more hit paths that follow the `item_id -> object_id` {-> super object_id} `-> rule_id`. This requires two special runtimes: object2object_runtime and rule_runtime.
From the [configuration relationship](./overview.md#12-configuration-relationship) diagram, we can see how the hit object is referenced by other objects or rules. If a hit object is referenced by other objects or rules, there will be one or more hit paths that follow the `item_id -> object_id` {-> super object_id} `-> rule_id`. This requires two special runtimes: object_group_runtime and rule_runtime.
Based on this, we can divide the runtime into the following three categories:
@@ -413,7 +413,7 @@ Based on this, we can divide the runtime into the following three categories:
* interval_runtime
2. object & rule table runtime
* object2object_runtime
* object_group_runtime
* rule_runtime
3. xx_plugin table runtime
@@ -433,9 +433,9 @@ Among the four types of runtimes mentioned above, `expr_runtime` is relatively u
### 2.2 object & rule table runtime
#### 2.2.1 object2object runtime
#### 2.2.1 object_group runtime
The `object2object_runtime` is a runtime that is built based on the reference relationships between objects, which are stored in the [object2object table](#14-object2object-table). From the [object hierarchy](./object_hierarchy.md), we can understand that if a hit occurs in a leaf object that is referenced by other objects, there may be certain super objects that are also hit. This is exactly the functionality provided by this runtime.
The `object_group_runtime` is a runtime that is built based on the reference relationships between objects, which are stored in the [object_group table](#14-object_group-table). From the [object hierarchy](./object_hierarchy.md), we can understand that if a hit occurs in a leaf object that is referenced by other objects, there may be certain super objects that are also hit. This is exactly the functionality provided by this runtime.
#### 2.2.2 rule runtime

View File

@@ -20,7 +20,7 @@ As mentioned in the readme, maat has two typical usage patterns:
Different types of configurations are stored in different tables. For all configuration types, please refer to the [table schema](./maat_table.md#1-table-schema).
The physical tables are mainly divided into three categories: the item table, object rule relationship table (rule table, object2rule table, object2object table), and xx_plugin table. The first two types of tables are used for maat traffic scanning, while the xx_plugin table is used as a callback table, which can obtain the detailed configuration information for a specific key.
The physical tables are mainly divided into three categories: the item table, object rule relationship table (rule table, object2rule table, object_group table), and xx_plugin table. The first two types of tables are used for maat traffic scanning, while the xx_plugin table is used as a callback table, which can obtain the detailed configuration information for a specific key.
### 1.2 Configuration relationship
@@ -56,7 +56,7 @@ The diagram illustrates the overall architecture of maat, including the control
* **Data Plane**
When calling the maat scanning interface, it subsequently calls the table runtime of the corresponding table, then proceeds to the scanning engine. Upon the scanning engine returning a hit object, it further searches for the matching `rule_id` through object2object runtime, object2rule runtime, and rule runtime, which is then returned to the caller. In addition, if the caller is interested in the hit path, they can also retrieve it through the interfaces provided by maat.
When calling the maat scanning interface, it subsequently calls the table runtime of the corresponding table, then proceeds to the scanning engine. Upon the scanning engine returning a hit object, it further searches for the matching `rule_id` through object_group runtime, object2rule runtime, and rule runtime, which is then returned to the caller. In addition, if the caller is interested in the hit path, they can also retrieve it through the interfaces provided by maat.
The scanning mentioned above all uses the `effective runtime`. If there are configuration changes, it will trigger the construction of `updating runtime`. Once this construction is completed, it will become effective runtime, and the original effective runtime will be put into the garbage collection queue waiting to be recycled.

View File

@@ -44,7 +44,7 @@ A object defines a set that can contain different types of items and can also re
- A Object can be referenced by different rules.
The relationship between object and object is stored in the [object2object table](./maat_table.md#14-object2object-table).
The relationship between object and object is stored in the [object_group table](./maat_table.md#14-object_group-table).
## Rule(Policy)
@@ -68,7 +68,7 @@ A Literal consists of `attribute_id(attribute id)` and `object_id`. During the r
## Physical table
Different rules are stored in different tables in the actual database, including [item table](./maat_table.md#11-item-table), [rule table](./maat_table.md#12-rule-table), [object2rule table](./maat_table.md#13-object2rule-table), [object2object table](./maat_table.md#14-object2object-table), and [xx_plugin table](./maat_table.md#15-plugin-table), and so on.
Different rules are stored in different tables in the actual database, including [item table](./maat_table.md#11-item-table), [rule table](./maat_table.md#12-rule-table), [object2rule table](./maat_table.md#13-object2rule-table), [object_group table](./maat_table.md#14-object_group-table), and [xx_plugin table](./maat_table.md#15-plugin-table), and so on.
## Attribute