Class: SDM::QueryCapture

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

A QueryCapture contains additional information about queries against SSH, Kubernetes, and RDP resources.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_command: nil, command: nil, container: nil, env: nil, file_name: nil, file_size: nil, height: nil, impersonation_groups: nil, impersonation_user: nil, pod: nil, privilege_groups: nil, request_body: nil, request_method: nil, request_uri: nil, type: nil, width: nil) ⇒ QueryCapture

Returns a new instance of QueryCapture.



13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
# File 'lib/models/porcelain.rb', line 13473

def initialize(
  client_command: nil,
  command: nil,
  container: nil,
  env: nil,
  file_name: nil,
  file_size: nil,
  height: nil,
  impersonation_groups: nil,
  impersonation_user: nil,
  pod: nil,
  privilege_groups: nil,
  request_body: nil,
  request_method: nil,
  request_uri: nil,
  type: nil,
  width: nil
)
  @client_command = client_command == nil ? "" : client_command
  @command = command == nil ? "" : command
  @container = container == nil ? "" : container
  @env = env == nil ? {} : env
  @file_name = file_name == nil ? "" : file_name
  @file_size = file_size == nil ? 0 : file_size
  @height = height == nil ? 0 : height
  @impersonation_groups = impersonation_groups == nil ? [] : impersonation_groups
  @impersonation_user = impersonation_user == nil ? "" : impersonation_user
  @pod = pod == nil ? "" : pod
  @privilege_groups = privilege_groups == nil ? [] : privilege_groups
  @request_body = request_body == nil ? "" : request_body
  @request_method = request_method == nil ? "" : request_method
  @request_uri = request_uri == nil ? "" : request_uri
  @type = type == nil ? "" : type
  @width = width == nil ? 0 : width
end

Instance Attribute Details

#client_commandObject

The command executed on the client for a Kubernetes session.



13441
13442
13443
# File 'lib/models/porcelain.rb', line 13441

def client_command
  @client_command
end

#commandObject

The command executed over an SSH or Kubernetes session.



13443
13444
13445
# File 'lib/models/porcelain.rb', line 13443

def command
  @command
end

#containerObject

The target container of a Kubernetes operation.



13445
13446
13447
# File 'lib/models/porcelain.rb', line 13445

def container
  @container
end

#envObject

The environment variables for an SSH or Kubernetes session.



13447
13448
13449
# File 'lib/models/porcelain.rb', line 13447

def env
  @env
end

#file_nameObject

The remote file name of an SCP operation.



13449
13450
13451
# File 'lib/models/porcelain.rb', line 13449

def file_name
  @file_name
end

#file_sizeObject

The file size transferred for an SCP operation.



13451
13452
13453
# File 'lib/models/porcelain.rb', line 13451

def file_size
  @file_size
end

#heightObject

The height of the terminal or window for SSH, Kubernetes, and RDP interactive sessions.



13453
13454
13455
# File 'lib/models/porcelain.rb', line 13453

def height
  @height
end

#impersonation_groupsObject

The impersonation groups of a Kubernetes operation.



13455
13456
13457
# File 'lib/models/porcelain.rb', line 13455

def impersonation_groups
  @impersonation_groups
end

#impersonation_userObject

The impersonation user of a Kubernetes operation.



13457
13458
13459
# File 'lib/models/porcelain.rb', line 13457

def impersonation_user
  @impersonation_user
end

#podObject

The target pod of a Kubernetes operation.



13459
13460
13461
# File 'lib/models/porcelain.rb', line 13459

def pod
  @pod
end

#privilege_groupsObject

The additional impersonation groups, as granted by privilege levels, of a Kubernetes operation.



13461
13462
13463
# File 'lib/models/porcelain.rb', line 13461

def privilege_groups
  @privilege_groups
end

#request_bodyObject

The HTTP request body of a Kubernetes operation.



13463
13464
13465
# File 'lib/models/porcelain.rb', line 13463

def request_body
  @request_body
end

#request_methodObject

The HTTP request method of a Kubernetes operation.



13465
13466
13467
# File 'lib/models/porcelain.rb', line 13465

def request_method
  @request_method
end

#request_uriObject

The HTTP request URI of a Kubernetes operation.



13467
13468
13469
# File 'lib/models/porcelain.rb', line 13467

def request_uri
  @request_uri
end

#typeObject

The CaptureType of this query capture, one of the CaptureType constants.



13469
13470
13471
# File 'lib/models/porcelain.rb', line 13469

def type
  @type
end

#widthObject

The width of the terminal or window for SSH, Kubernetes, and RDP interactive sessions.



13471
13472
13473
# File 'lib/models/porcelain.rb', line 13471

def width
  @width
end

Instance Method Details

#to_json(options = {}) ⇒ Object



13509
13510
13511
13512
13513
13514
13515
# File 'lib/models/porcelain.rb', line 13509

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end