// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.cloud.securitycenter.v1beta1;

import "google/api/annotations.proto";
import "google/cloud/securitycenter/v1beta1/security_marks.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter";
option java_package = "com.google.cloud.securitycenter.v1beta1";

// Security Center's representation of a Google Cloud Platform resource.
//
// The Asset is a resource of Security Center that is meant to capture
// information regarding a single Google Cloud Platform resource. All
// modifications to an Asset are only within the context of Security Center and
// do not effect the referenced Google Cloud Platform resource.
message Asset {
  // Security Center managed properties. These properties are managed by
  // Security Center and cannot be modified by the user.
  message SecurityCenterProperties {
    // The full resource name of the Google Cloud Platform resource this asset
    // represents. This field is immutable after create time. See:
    // https://cloud.google.com/apis/design/resource_names#full_resource_name
    string resource_name = 1;

    // The type of the Google Cloud resource. Examples include: APPLICATION,
    // PROJECT, and ORGANIZATION. This is a case insensitive field defined by
    // Security Center and/or the producer of the resource and is immutable
    // after create time.
    string resource_type = 2;

    // The full resource name of the immediate parent of the resource. See:
    // https://cloud.google.com/apis/design/resource_names#full_resource_name
    string resource_parent = 3;

    // The full resource name of the project the resource belongs to. See:
    // https://cloud.google.com/apis/design/resource_names#full_resource_name
    string resource_project = 4;

    // Owners of the Google Cloud resource.
    repeated string resource_owners = 5;
  }

  // The relative resource name of this asset. See:
  // https://cloud.google.com/apis/design/resource_names#relative_resource_name
  // Example:
  // "organizations/123/assets/456".
  string name = 1;

  // Security Center managed properties. These properties are managed by
  // Security Center and cannot be modified by the user.
  SecurityCenterProperties security_center_properties = 2;

  // Resource managed properties. These properties are managed and defined by
  // the Google Cloud Platform resource and cannot be modified by the user.
  map<string, google.protobuf.Value> resource_properties = 7;

  // User specified security marks. These marks are entirely managed by the user
  // and come from the SecurityMarks resource belonging to the asset.
  SecurityMarks security_marks = 8;

  // The time at which the asset was created in Security Center.
  google.protobuf.Timestamp create_time = 9;

  // The time at which the asset was last updated, added, or deleted in Security
  // Center.
  google.protobuf.Timestamp update_time = 10;
}
