Class: OCI::DataSafe::Models::SqlFirewallViolationSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/sql_firewall_violation_summary.rb

Overview

The resource represents the SQL violations collected from the target database by Oracle Data Safe.

Constant Summary collapse

SQL_LEVEL_ENUM =
[
  SQL_LEVEL_USER_ISSUED_SQL = 'USER_ISSUED_SQL'.freeze,
  SQL_LEVEL_ALL_SQL = 'ALL_SQL'.freeze,
  SQL_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
VIOLATION_ACTION_ENUM =
[
  VIOLATION_ACTION_BLOCKED = 'BLOCKED'.freeze,
  VIOLATION_ACTION_ALLOWED = 'ALLOWED'.freeze,
  VIOLATION_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SqlFirewallViolationSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :db_user_name (String)

    The value to assign to the #db_user_name property

  • :target_id (String)

    The value to assign to the #target_id property

  • :target_name (String)

    The value to assign to the #target_name property

  • :operation_time (DateTime)

    The value to assign to the #operation_time property

  • :time_collected (DateTime)

    The value to assign to the #time_collected property

  • :client_os_user_name (String)

    The value to assign to the #client_os_user_name property

  • :operation (String)

    The value to assign to the #operation property

  • :sql_text (String)

    The value to assign to the #sql_text property

  • :sql_accessed_objects (String)

    The value to assign to the #sql_accessed_objects property

  • :current_db_user_name (String)

    The value to assign to the #current_db_user_name property

  • :sql_level (String)

    The value to assign to the #sql_level property

  • :client_ip (String)

    The value to assign to the #client_ip property

  • :client_program (String)

    The value to assign to the #client_program property

  • :violation_cause (String)

    The value to assign to the #violation_cause property

  • :violation_action (String)

    The value to assign to the #violation_action property



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 168

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

  raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']

  self.db_user_name = attributes[:'dbUserName'] if attributes[:'dbUserName']

  raise 'You cannot provide both :dbUserName and :db_user_name' if attributes.key?(:'dbUserName') && attributes.key?(:'db_user_name')

  self.db_user_name = attributes[:'db_user_name'] if attributes[:'db_user_name']

  self.target_id = attributes[:'targetId'] if attributes[:'targetId']

  raise 'You cannot provide both :targetId and :target_id' if attributes.key?(:'targetId') && attributes.key?(:'target_id')

  self.target_id = attributes[:'target_id'] if attributes[:'target_id']

  self.target_name = attributes[:'targetName'] if attributes[:'targetName']

  raise 'You cannot provide both :targetName and :target_name' if attributes.key?(:'targetName') && attributes.key?(:'target_name')

  self.target_name = attributes[:'target_name'] if attributes[:'target_name']

  self.operation_time = attributes[:'operationTime'] if attributes[:'operationTime']

  raise 'You cannot provide both :operationTime and :operation_time' if attributes.key?(:'operationTime') && attributes.key?(:'operation_time')

  self.operation_time = attributes[:'operation_time'] if attributes[:'operation_time']

  self.time_collected = attributes[:'timeCollected'] if attributes[:'timeCollected']

  raise 'You cannot provide both :timeCollected and :time_collected' if attributes.key?(:'timeCollected') && attributes.key?(:'time_collected')

  self.time_collected = attributes[:'time_collected'] if attributes[:'time_collected']

  self.client_os_user_name = attributes[:'clientOsUserName'] if attributes[:'clientOsUserName']

  raise 'You cannot provide both :clientOsUserName and :client_os_user_name' if attributes.key?(:'clientOsUserName') && attributes.key?(:'client_os_user_name')

  self.client_os_user_name = attributes[:'client_os_user_name'] if attributes[:'client_os_user_name']

  self.operation = attributes[:'operation'] if attributes[:'operation']

  self.sql_text = attributes[:'sqlText'] if attributes[:'sqlText']

  raise 'You cannot provide both :sqlText and :sql_text' if attributes.key?(:'sqlText') && attributes.key?(:'sql_text')

  self.sql_text = attributes[:'sql_text'] if attributes[:'sql_text']

  self.sql_accessed_objects = attributes[:'sqlAccessedObjects'] if attributes[:'sqlAccessedObjects']

  raise 'You cannot provide both :sqlAccessedObjects and :sql_accessed_objects' if attributes.key?(:'sqlAccessedObjects') && attributes.key?(:'sql_accessed_objects')

  self.sql_accessed_objects = attributes[:'sql_accessed_objects'] if attributes[:'sql_accessed_objects']

  self.current_db_user_name = attributes[:'currentDbUserName'] if attributes[:'currentDbUserName']

  raise 'You cannot provide both :currentDbUserName and :current_db_user_name' if attributes.key?(:'currentDbUserName') && attributes.key?(:'current_db_user_name')

  self.current_db_user_name = attributes[:'current_db_user_name'] if attributes[:'current_db_user_name']

  self.sql_level = attributes[:'sqlLevel'] if attributes[:'sqlLevel']

  raise 'You cannot provide both :sqlLevel and :sql_level' if attributes.key?(:'sqlLevel') && attributes.key?(:'sql_level')

  self.sql_level = attributes[:'sql_level'] if attributes[:'sql_level']

  self.client_ip = attributes[:'clientIp'] if attributes[:'clientIp']

  raise 'You cannot provide both :clientIp and :client_ip' if attributes.key?(:'clientIp') && attributes.key?(:'client_ip')

  self.client_ip = attributes[:'client_ip'] if attributes[:'client_ip']

  self.client_program = attributes[:'clientProgram'] if attributes[:'clientProgram']

  raise 'You cannot provide both :clientProgram and :client_program' if attributes.key?(:'clientProgram') && attributes.key?(:'client_program')

  self.client_program = attributes[:'client_program'] if attributes[:'client_program']

  self.violation_cause = attributes[:'violationCause'] if attributes[:'violationCause']

  raise 'You cannot provide both :violationCause and :violation_cause' if attributes.key?(:'violationCause') && attributes.key?(:'violation_cause')

  self.violation_cause = attributes[:'violation_cause'] if attributes[:'violation_cause']

  self.violation_action = attributes[:'violationAction'] if attributes[:'violationAction']

  raise 'You cannot provide both :violationAction and :violation_action' if attributes.key?(:'violationAction') && attributes.key?(:'violation_action')

  self.violation_action = attributes[:'violation_action'] if attributes[:'violation_action']
end

Instance Attribute Details

#client_ipString

The IP address of the host machine from which the session was generated.

Returns:

  • (String)


81
82
83
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 81

def client_ip
  @client_ip
end

#client_os_user_nameString

The name of the operating system user for the database session.

Returns:

  • (String)


54
55
56
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 54

def client_os_user_name
  @client_os_user_name
end

#client_programString

The application from which the SQL violation was generated. Examples include SQL Plus or SQL Developer.

Returns:

  • (String)


85
86
87
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 85

def client_program
  @client_program
end

#compartment_idString

[Required] The OCID of the compartment containing the SQL violation.

Returns:

  • (String)


30
31
32
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 30

def compartment_id
  @compartment_id
end

#current_db_user_nameString

The name of the user that SQL was executed as.

Returns:

  • (String)


70
71
72
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 70

def current_db_user_name
  @current_db_user_name
end

#db_user_nameString

The name of the database user.

Returns:

  • (String)


34
35
36
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 34

def db_user_name
  @db_user_name
end

#idString

[Required] The OCID of the SQL violation.

Returns:

  • (String)


26
27
28
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 26

def id
  @id
end

#operationString

The name of the action executed by the user on the target database. For example, ALTER, CREATE, DROP.

Returns:

  • (String)


58
59
60
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 58

def operation
  @operation
end

#operation_timeDateTime

[Required] The time of the SQL violation occurrence in the target database.

Returns:

  • (DateTime)


46
47
48
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 46

def operation_time
  @operation_time
end

#sql_accessed_objectsString

The objects accessed by the SQL.

Returns:

  • (String)


66
67
68
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 66

def sql_accessed_objects
  @sql_accessed_objects
end

#sql_levelString

Specifies the level of SQL for this violation. USER_ISSUED_SQL - User issued SQL statements only. ALL_SQL - Includes all SQL statements including SQL statement issued inside PL/SQL units.

Returns:

  • (String)


77
78
79
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 77

def sql_level
  @sql_level
end

#sql_textString

The SQL text caught by the firewall.

Returns:

  • (String)


62
63
64
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 62

def sql_text
  @sql_text
end

#target_idString

[Required] The OCID of the target database.

Returns:

  • (String)


38
39
40
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 38

def target_id
  @target_id
end

#target_nameString

[Required] The name of the target database.

Returns:

  • (String)


42
43
44
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 42

def target_name
  @target_name
end

#time_collectedDateTime

[Required] The timestamp when this SQL violation was collected from the target database by Data Safe.

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 50

def time_collected
  @time_collected
end

#violation_actionString

[Required] The action taken for this SQL violation.

Returns:

  • (String)


93
94
95
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 93

def violation_action
  @violation_action
end

#violation_causeString

Indicates whether SQL or context violation.

Returns:

  • (String)


89
90
91
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 89

def violation_cause
  @violation_cause
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 96

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'db_user_name': :'dbUserName',
    'target_id': :'targetId',
    'target_name': :'targetName',
    'operation_time': :'operationTime',
    'time_collected': :'timeCollected',
    'client_os_user_name': :'clientOsUserName',
    'operation': :'operation',
    'sql_text': :'sqlText',
    'sql_accessed_objects': :'sqlAccessedObjects',
    'current_db_user_name': :'currentDbUserName',
    'sql_level': :'sqlLevel',
    'client_ip': :'clientIp',
    'client_program': :'clientProgram',
    'violation_cause': :'violationCause',
    'violation_action': :'violationAction'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 121

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'db_user_name': :'String',
    'target_id': :'String',
    'target_name': :'String',
    'operation_time': :'DateTime',
    'time_collected': :'DateTime',
    'client_os_user_name': :'String',
    'operation': :'String',
    'sql_text': :'String',
    'sql_accessed_objects': :'String',
    'current_db_user_name': :'String',
    'sql_level': :'String',
    'client_ip': :'String',
    'client_program': :'String',
    'violation_cause': :'String',
    'violation_action': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 302

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    db_user_name == other.db_user_name &&
    target_id == other.target_id &&
    target_name == other.target_name &&
    operation_time == other.operation_time &&
    time_collected == other.time_collected &&
    client_os_user_name == other.client_os_user_name &&
    operation == other.operation &&
    sql_text == other.sql_text &&
    sql_accessed_objects == other.sql_accessed_objects &&
    current_db_user_name == other.current_db_user_name &&
    sql_level == other.sql_level &&
    client_ip == other.client_ip &&
    client_program == other.client_program &&
    violation_cause == other.violation_cause &&
    violation_action == other.violation_action
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 348

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


328
329
330
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 328

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



337
338
339
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 337

def hash
  [id, compartment_id, db_user_name, target_id, target_name, operation_time, time_collected, client_os_user_name, operation, sql_text, sql_accessed_objects, current_db_user_name, sql_level, client_ip, client_program, violation_cause, violation_action].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



381
382
383
384
385
386
387
388
389
390
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 381

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



375
376
377
# File 'lib/oci/data_safe/models/sql_firewall_violation_summary.rb', line 375

def to_s
  to_hash.to_s
end