- Resource: Rule
- CompilationState
- RunFrequency
- CompilationDiagnostic
- CompilationPosition
- Severity
- Methods
Resource: Rule
The Rule resource represents a user-created rule.
JSON representation |
---|
{ "name": string, "revision_id": string, "display_name": string, "text": string, "author": string, "severity": { object ( |
Fields | |
---|---|
name |
Full resource name for the rule. Format: projects/{project}/locations/{location}/instances/{instance}/rules/{rule} |
revision_id |
Output only. The revision ID of the rule. A new revision is created whenever the rule text is changed in any way. Format: v_{10 digits}_{9 digits} Populated in REVISION_METADATA_ONLY view and FULL view. |
display_name |
Output only. Display name of the rule. Populated in BASIC view and FULL view. |
text |
The YARA-L content of the rule. Populated in FULL view. |
author |
Output only. The author of the rule. Extracted from the meta section of text. Populated in BASIC view and FULL view. |
severity |
Output only. The severity of the rule as specified in the meta section of text. Populated in BASIC view and FULL view. |
metadata |
Output only. Additional metadata specified in the meta section of text. Populated in FULL view. An object containing a list of |
create_time |
Output only. The timestamp of when the rule was created. Populated in FULL view. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
revision_create_time |
Output only. The timestamp of when the rule revision was created. Populated in FULL, REVISION_METADATA_ONLY views. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
compilation_state |
Output only. The current compilation state of the rule. Populated in FULL view. |
type |
Output only. User-facing type of the rule. Extracted from the events section of rule text. Populated in BASIC view and FULL view. |
reference_lists[] |
Output only. Resource names of the reference lists used in this rule. Populated in FULL view. |
allowed_run_frequencies[] |
Output only. The run frequencies that are allowed for the rule. Populated in BASIC view and FULL view. |
etag |
The etag for this rule. If this is provided on update, the request will succeed if and only if it matches the server-computed value, and will fail with an ABORTED error otherwise. Populated in BASIC view and FULL view. |
scope |
Output only. Resource name of the DataAccessScope bound to this rule. Populated in BASIC view and FULL view. If reference lists are used in the rule, validations are performed against this scope to ensure that the reference lists are compatible with both the user's and the rule's scopes. The scope should be in the format: "projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope}". |
compilation_diagnostics[] |
Output only. A list of a rule's corresponding compilation diagnostic messages such as compilation errors and compilation warnings. Populated in FULL view. |
near_real_time_live_rule_eligible |
Output only. Indicate the rule can run in near real time live rule. If this is true, the rule uses the near real time live rule when the run frequency is set to LIVE. |
CompilationState
The current compilation state of the rule.
Enums | |
---|---|
COMPILATION_STATE_UNSPECIFIED |
The compilation state is unspecified/unknown. |
SUCCEEDED |
The Rule can successfully compile. |
FAILED |
The Rule cannot successfully compile. This is possible if a backwards-incompatible change was made to the compiler. |
RunFrequency
LINT.IfChange(run_frequency_enum) RunFrequency indicates the run frequency at which a YARA-L 2 rule will run if enabled.
Enums | |
---|---|
RUN_FREQUENCY_UNSPECIFIED |
The run frequency is unspecified/unknown. |
LIVE |
Executes in real time. |
HOURLY |
Executes once per hour. |
DAILY |
Executes once per day. |
CompilationDiagnostic
CompilationDiagnostic represents a compilation diagnostic generated during a rule's compilation, such as a compilation error or a compilation warning.
JSON representation |
---|
{ "message": string, "position": { object ( |
Fields | |
---|---|
message |
Output only. The diagnostic message. |
position |
Output only. The approximate position in the rule text associated with the compilation diagnostic. Compilation Position may be empty. |
severity |
Output only. The severity of a rule's compilation diagnostic. |
uri |
Output only. Link to documentation that describes a diagnostic in more detail. |
CompilationPosition
CompilationPosition represents the location of a compilation diagnostic in rule text.
JSON representation |
---|
{ "start_line": integer, "start_column": integer, "end_line": integer, "end_column": integer } |
Fields | |
---|---|
start_line |
Output only. Start line number, beginning at 1. |
start_column |
Output only. Start column number, beginning at 1. |
end_line |
Output only. End line number, beginning at 1. |
end_column |
Output only. End column number, beginning at 1. |
Severity
The severity level of the compilation diagnostic.
Enums | |
---|---|
SEVERITY_UNSPECIFIED |
An unspecified severity level. |
WARNING |
A compilation warning. |
ERROR |
A compilation error. |
Methods |
|
---|---|
|
Creates a new Rule. |
|
Deletes a Rule. |
|
Gets a Rule. |
|
Gets a RuleDeployment. |
|
Lists Rules. |
|
Lists all revisions of the rule. |
|
Updates a Rule. |
|
Updates a RuleDeployment. |