1// Copyright 2018 The Grafeas Authors. All rights reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package grafeas.v1beta1.package; 18 19option go_package = "cloud.google.com/go/containeranalysis/apiv1beta1/containeranalysispb;containeranalysispb"; 20option java_multiple_files = true; 21option java_package = "io.grafeas.v1beta1.pkg"; 22option objc_class_prefix = "GRA"; 23 24// Instruction set architectures supported by various package managers. 25enum Architecture { 26 // Unknown architecture. 27 ARCHITECTURE_UNSPECIFIED = 0; 28 // X86 architecture. 29 X86 = 1; 30 // X64 architecture. 31 X64 = 2; 32} 33 34// This represents a particular channel of distribution for a given package. 35// E.g., Debian's jessie-backports dpkg mirror. 36message Distribution { 37 // Required. The cpe_uri in [CPE format](https://cpe.mitre.org/specification/) 38 // denoting the package manager version distributing a package. 39 string cpe_uri = 1; 40 41 // The CPU architecture for which packages in this distribution channel were 42 // built. 43 Architecture architecture = 2; 44 45 // The latest available version of this package in this distribution channel. 46 Version latest_version = 3; 47 48 // A freeform string denoting the maintainer of this package. 49 string maintainer = 4; 50 51 // The distribution channel-specific homepage for this package. 52 string url = 5; 53 54 // The distribution channel-specific description of this package. 55 string description = 6; 56} 57 58// An occurrence of a particular package installation found within a system's 59// filesystem. E.g., glibc was found in `/var/lib/dpkg/status`. 60message Location { 61 // Required. The CPE URI in [CPE format](https://cpe.mitre.org/specification/) 62 // denoting the package manager version distributing a package. 63 string cpe_uri = 1; 64 65 // The version installed at this location. 66 Version version = 2; 67 68 // The path from which we gathered that this package/version is installed. 69 string path = 3; 70} 71 72// This represents a particular package that is distributed over various 73// channels. E.g., glibc (aka libc6) is distributed by many, at various 74// versions. 75message Package { 76 // Required. Immutable. The name of the package. 77 string name = 1; 78 79 // The various channels by which a package is distributed. 80 repeated Distribution distribution = 10; 81} 82 83// Details of a package occurrence. 84message Details { 85 // Required. Where the package was installed. 86 Installation installation = 1; 87} 88 89// This represents how a particular software package may be installed on a 90// system. 91message Installation { 92 // Output only. The name of the installed package. 93 string name = 1; 94 95 // Required. All of the places within the filesystem versions of this package 96 // have been found. 97 repeated Location location = 2; 98} 99 100// Version contains structured information about the version of a package. 101message Version { 102 // Used to correct mistakes in the version numbering scheme. 103 int32 epoch = 1; 104 105 // Required only when version kind is NORMAL. The main part of the version 106 // name. 107 string name = 2; 108 109 // The iteration of the package build from the above version. 110 string revision = 3; 111 112 // Whether this is an ordinary package version or a sentinel MIN/MAX version. 113 enum VersionKind { 114 // Unknown. 115 VERSION_KIND_UNSPECIFIED = 0; 116 // A standard package version. 117 NORMAL = 1; 118 // A special version representing negative infinity. 119 MINIMUM = 2; 120 // A special version representing positive infinity. 121 MAXIMUM = 3; 122 }; 123 124 // Required. Distinguishes between sentinel MIN/MAX versions and normal 125 // versions. 126 VersionKind kind = 4; 127} 128