github.com/devseccon/trivy@v0.47.1-0.20231123133102-bd902a0bd996/rpc/common/service.proto (about)

     1  syntax = "proto3";
     2  
     3  import "google/protobuf/timestamp.proto";
     4  
     5  package trivy.common;
     6  option  go_package = "github.com/devseccon/trivy/rpc/common;common";
     7  
     8  import "google/protobuf/struct.proto";
     9  
    10  message OS {
    11    string family   = 1;
    12    string name     = 2;
    13    bool   eosl     = 3;
    14    bool   extended = 4;
    15  }
    16  
    17  message Repository {
    18    string family  = 1;
    19    string release = 2;
    20  }
    21  
    22  message PackageInfo {
    23    string           file_path = 1;
    24    repeated Package packages  = 2;
    25  }
    26  
    27  message Application {
    28    string           type      = 1;
    29    string           file_path = 2;
    30    repeated Package libraries = 3;
    31  }
    32  
    33  message Package {
    34    // binary package
    35    // e.g. bind-utils
    36    string id      = 13;
    37    string name    = 1;
    38    string version = 2;
    39    string release = 3;
    40    int32  epoch   = 4;
    41    string arch    = 5;
    42    // src package containing some binary packages
    43    // e.g. bind
    44    string          src_name    = 6;
    45    string          src_version = 7;
    46    string          src_release = 8;
    47    int32           src_epoch   = 9;
    48    repeated string licenses    = 15;
    49    Layer           layer       = 11;
    50    string          file_path   = 12;
    51    repeated string depends_on  = 14;
    52    string          digest      = 16;
    53    bool            dev         = 17;
    54    bool            indirect    = 18;
    55  }
    56  
    57  message Misconfiguration {
    58    string                 file_type  = 1;
    59    string                 file_path  = 2;
    60    repeated MisconfResult successes  = 3;
    61    repeated MisconfResult warnings   = 4;
    62    repeated MisconfResult failures   = 5;
    63    repeated MisconfResult exceptions = 6;
    64  }
    65  
    66  message MisconfResult {
    67    string namespace = 1;
    68    string message   = 2;
    69    reserved 3 to 6;
    70    reserved "type", "id", "title", "severity";
    71    PolicyMetadata policy_metadata = 7;
    72    CauseMetadata  cause_metadata  = 8;
    73  }
    74  
    75  message PolicyMetadata {
    76    string          id                  = 1;
    77    string          adv_id              = 2;
    78    string          type                = 3;
    79    string          title               = 4;
    80    string          description         = 5;
    81    string          severity            = 6;
    82    string          recommended_actions = 7;
    83    repeated string references          = 8;
    84  }
    85  
    86  message DetectedMisconfiguration {
    87    string type                    = 1;
    88    string id                      = 2;
    89    string title                   = 3;
    90    string description             = 4;
    91    string message                 = 5;
    92    string namespace               = 6;
    93    string          resolution     = 7;
    94    Severity        severity       = 8;
    95    string          primary_url    = 9;
    96    repeated string references     = 10;
    97    string          status         = 11;
    98    Layer           layer          = 12;
    99    CauseMetadata   cause_metadata = 13;
   100    string          avd_id         = 14;
   101    string          query          = 15;
   102  }
   103  
   104  message Vulnerability {
   105    string                    vulnerability_id     = 1;
   106    string                    pkg_name             = 2;
   107    string                    installed_version    = 3;
   108    string                    fixed_version        = 4;
   109    string                    title                = 5;
   110    string                    description          = 6;
   111    Severity                  severity             = 7;
   112    repeated string           references           = 8;
   113    Layer                     layer                = 10;
   114    string                    severity_source      = 11;
   115    map<string, CVSS>         cvss                 = 12;
   116    repeated string           cwe_ids              = 13;
   117    string                    primary_url          = 14;
   118    google.protobuf.Timestamp published_date       = 15;
   119    google.protobuf.Timestamp last_modified_date   = 16;
   120    google.protobuf.Value     custom_advisory_data = 17;
   121    google.protobuf.Value     custom_vuln_data     = 18;
   122    repeated string           vendor_ids           = 19;
   123    DataSource                data_source          = 20;
   124    map<string, Severity>     vendor_severity      = 21;
   125    string                    pkg_path             = 22;
   126    string                    pkg_id               = 23;
   127    int32                     status               = 24;
   128  }
   129  
   130  message DataSource {
   131    string id   = 1;
   132    string name = 2;
   133    string url  = 3;
   134  }
   135  
   136  message Layer {
   137    string digest     = 1;
   138    string diff_id    = 2;
   139    string created_by = 3;
   140  }
   141  
   142  message CauseMetadata {
   143    string resource   = 1;
   144    string provider   = 2;
   145    string service    = 3;
   146    int32  start_line = 4;
   147    int32  end_line   = 5;
   148    Code   code       = 6;
   149  }
   150  
   151  enum Severity {
   152    UNKNOWN  = 0;
   153    LOW      = 1;
   154    MEDIUM   = 2;
   155    HIGH     = 3;
   156    CRITICAL = 4;
   157  }
   158  
   159  message CVSS {
   160    string v2_vector = 1;
   161    string v3_vector = 2;
   162    double v2_score  = 3;
   163    double v3_score  = 4;
   164  }
   165  
   166  message CustomResource {
   167    string                type      = 1;
   168    string                file_path = 2;
   169    Layer                 layer     = 3;
   170    google.protobuf.Value data      = 4;
   171  }
   172  
   173  message Line {
   174    int32  number      = 1;
   175    string content     = 2;
   176    bool   is_cause    = 3;
   177    string annotation  = 4;
   178    bool   truncated   = 5;
   179    string highlighted = 6;
   180    bool   first_cause = 7;
   181    bool   last_cause  = 8;
   182  }
   183  
   184  message Code {
   185    repeated Line lines = 1;
   186  }
   187  
   188  message SecretFinding {
   189    string rule_id    = 1;
   190    string category   = 2;
   191    string severity   = 3;
   192    string title      = 4;
   193    int32  start_line = 5;
   194    int32  end_line   = 6;
   195    Code   code       = 7;
   196    string match      = 8;
   197    Layer  layer      = 10;
   198  
   199    reserved 9;  // deprecated 'deleted'
   200  }
   201  
   202  message Secret {
   203    string                 filepath = 1;
   204    repeated SecretFinding findings = 2;
   205  }
   206  
   207  message DetectedLicense {
   208    Severity             severity   = 1;
   209    LicenseCategory.Enum category   = 2;
   210    string               pkg_name   = 3;
   211    string               file_path  = 4;
   212    string               name       = 5;
   213    float                confidence = 6;
   214    string               link       = 7;
   215  }
   216  
   217  message LicenseFile {
   218    LicenseType.Enum        license_type = 1;
   219    string                  file_path    = 2;
   220    string                  pkg_name     = 3;
   221    repeated LicenseFinding fingings     = 4;
   222    Layer                   layer        = 5;
   223  }
   224  
   225  message LicenseFinding {
   226    LicenseCategory.Enum category   = 1;
   227    string               name       = 2;
   228    float                confidence = 3;
   229    string               link       = 4;
   230  }
   231  
   232  // Enumerations are wrapped with a message to improve the readability of enumerations 
   233  // in generated code and avoid name conflicts.
   234  // https://github.com/golang/protobuf/issues/513
   235  message LicenseCategory {
   236    enum Enum {
   237      UNSPECIFIED  = 0;
   238      FORBIDDEN    = 1;
   239      RESTRICTED   = 2;
   240      RECIPROCAL   = 3;
   241      NOTICE       = 4;
   242      PERMISSIVE   = 5;
   243      UNENCUMBERED = 6;
   244      UNKNOWN      = 7;
   245    }
   246  }
   247  
   248  message LicenseType {
   249    enum Enum {
   250      UNSPECIFIED  = 0;
   251      DPKG         = 1;
   252      HEADER       = 2;
   253      LICENSE_FILE = 3;
   254    }
   255  }