|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package proto; |
| 4 | + |
| 5 | +option go_package = "github.com/cel-expr/cloud-armor-rules/pkg/cloudarmor/proto"; |
| 6 | + |
| 7 | +import "google/protobuf/timestamp.proto"; |
| 8 | + |
| 9 | +// Vendor ruleset collection initially provided by Vendor |
| 10 | +// This represents the initial set of data provided by the Vendor. |
| 11 | +// For further details, please refer to shared(Google and Imperva) design doc: |
| 12 | +// go/imperva-google-mgdrules-integration |
| 13 | +message VendorRulesetCollection { |
| 14 | + // Next ID: 4 |
| 15 | + // Unique ID associated with the ruleset collection |
| 16 | + string uuid = 1; |
| 17 | + |
| 18 | + // Metadata shared across Rulesets |
| 19 | + message RulesetMetadata { |
| 20 | + // Next ID: 6 |
| 21 | + // ruleset creation date |
| 22 | + google.protobuf.Timestamp creation_date = 1; |
| 23 | + |
| 24 | + // ruleset modification date |
| 25 | + google.protobuf.Timestamp updation_date = 2; |
| 26 | + |
| 27 | + // Name of the owner of the rulesets, e.g. Imperva |
| 28 | + string owner = 3; |
| 29 | + |
| 30 | + // A description of the ruleset's purpose |
| 31 | + string description = 4; |
| 32 | + |
| 33 | + // Encryption key identifier |
| 34 | + string encryptionkey_id = 5; |
| 35 | + } |
| 36 | + |
| 37 | + // Metadata for the ruleset |
| 38 | + RulesetMetadata ruleset_metadata = 2; |
| 39 | + |
| 40 | + // Collection of vendor rulesets |
| 41 | + repeated VendorRuleSet rule_sets = 3; |
| 42 | +} |
| 43 | + |
| 44 | +// Vendor rulesets containing rules for specific category, e.g. sqli, xss |
| 45 | +message VendorRuleSet { |
| 46 | + // Next ID: 7 |
| 47 | + // Name of the ruleset provided by Vendor |
| 48 | + string name = 1; |
| 49 | + |
| 50 | + // Version of the ruleset provided by Vendor, if any. |
| 51 | + string version = 2; |
| 52 | + |
| 53 | + // Category of the ruleset, e.g. SQLi, XSS |
| 54 | + string category = 3; |
| 55 | + |
| 56 | + // ChangeLog for the ruleset |
| 57 | + message ChangeLog { |
| 58 | + // This will be used to surface changelog information through |
| 59 | + // documentation |
| 60 | + string description = 1; |
| 61 | + |
| 62 | + // this determines whether the ruleset description should be public |
| 63 | + // e.g. Included in the release notes |
| 64 | + bool always_public = 2; |
| 65 | + |
| 66 | + // this is set if it should be included in a CVE release |
| 67 | + bool use_for_cve = 3; |
| 68 | + } |
| 69 | + |
| 70 | + // Release notes corresponding to the rulesets |
| 71 | + ChangeLog change_log = 4; |
| 72 | + |
| 73 | + // Transformations should be applied sequentially to the input request |
| 74 | + // before evaluating CEL Expression |
| 75 | + // Rule shall be evaluated only once all the transformations were applied. |
| 76 | + repeated string transformations = 5; |
| 77 | + |
| 78 | + // Rule from the Vendor ruleset. |
| 79 | + // It would only exist in the initial set of rules provided by the Vendor. |
| 80 | + message VendorRule { |
| 81 | + // Next ID: 7 |
| 82 | + // Unique ID associated with each rule |
| 83 | + // For incremental updates, the rule ID remains unchanged but follows a |
| 84 | + // versioning format. Example: id191190.0 to id191190.1 |
| 85 | + string id = 1; |
| 86 | + |
| 87 | + // CEL expression |
| 88 | + // Defines the rule logic in CEL string format using Cloud Armor (CA) |
| 89 | + // attributes. |
| 90 | + string cel_expression = 2; |
| 91 | + |
| 92 | + // Array of Key value pairs of tags and additional info associated |
| 93 | + // with the tag separated by ':' |
| 94 | + repeated string tags = 3; |
| 95 | + |
| 96 | + // Curl commands that would generate the matching expression for rule |
| 97 | + repeated string e2e_test_command = 4; |
| 98 | + |
| 99 | + // This field is reserved for the initial version of the ruleset |
| 100 | + // defined by the Vendor. |
| 101 | + reserved 5; |
| 102 | + |
| 103 | + // By default, it would be false. |
| 104 | + // If true, the rule shall only be evaluated if enabled by customers. |
| 105 | + bool opt_in = 6; |
| 106 | + } |
| 107 | + // collection of rules under the ruleset |
| 108 | + repeated VendorRule rules = 6; |
| 109 | +} |
0 commit comments