Class: IControl::ASM::Policy

Inherits:
Base
  • Object
show all
Defined in:
lib/icontrol/asm/policy.rb,
lib/icontrol/asm.rb

Overview

The Policy interface enables you to manipulate a policy.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IControl::Base

Instance Method Details

#add_predictable_resource_location(opts) ⇒ boolean

Add predictable resource location

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The polciy's name.

  • :uris (String)

    List or URIs to block. The URI is full, e.g.: foo.com/bar.php

Returns:

  • (boolean)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



18
19
20
21
# File 'lib/icontrol/asm/policy.rb', line 18

def add_predictable_resource_location(opts)
  opts = check_params(opts,[:policy_name,:uris])
  super(opts)
end

#associate_wa_webapp(opts) ⇒ Object

Associates the WA web applictions to the ASM policy.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :wa_webapp_names (String)

    List of WA web applcations.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



31
32
33
34
# File 'lib/icontrol/asm/policy.rb', line 31

def associate_wa_webapp(opts)
  opts = check_params(opts,[:wa_webapp_names])
  super(opts)
end

Get the max cookie length.

Returns:

  • (long)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



131
132
133
# File 'lib/icontrol/asm/policy.rb', line 131

def cookie_length
  super
end

#create(opts) ⇒ Object

Create policies for this web applications.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :webapp_names (String)

    The web application names.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



44
45
46
47
# File 'lib/icontrol/asm/policy.rb', line 44

def create(opts)
  opts = check_params(opts,[:webapp_names])
  super(opts)
end

#create_from_template(opts) ⇒ Object

Create policies from template for this web applications.

Parameters:

  • opts (Hash)

Options Hash (opts):

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



58
59
60
61
# File 'lib/icontrol/asm/policy.rb', line 58

def create_from_template(opts)
  opts = check_params(opts,[:webapp_names,:policy_templates])
  super(opts)
end

#delete_policyObject

Deletes a policy.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



69
70
71
# File 'lib/icontrol/asm/policy.rb', line 69

def delete_policy
  super
end

#detach_wa_webapp(opts) ⇒ Object

Detaches the WA web applictions from the ASM policy.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :wa_webapp_names (String)

    List of WA web applcations.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



81
82
83
84
# File 'lib/icontrol/asm/policy.rb', line 81

def detach_wa_webapp(opts)
  opts = check_params(opts,[:wa_webapp_names])
  super(opts)
end

#disable_blocking_flagboolean

Get blocking flag.

Returns:

  • (boolean)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



142
143
144
# File 'lib/icontrol/asm/policy.rb', line 142

def disable_blocking_flag
  super
end

#download_policy(opts) ⇒ FileTransferContext

Downloads the policy from the device. The download_policy is typically called after having called to export_policy. The parameter policy_name must be the same as used during export_policy. The file is downloaded in chunks. Each chunk should be concatenated to the previous one on the client side. The return value has two fields: - file_data: The relevant part of the content of the file - chunk_type: Indicates the current chunk whether it is the first, middle, last chunk or the current call includes the entire file.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The relative filename under /var/tmp into which export_policy previously exported the policy.

  • :chunk_size (long)

    The chunk/block size of the file data to read from the device.

  • :file_offset (long)

    The file offset that indicates where to read the next chunk of file data from.

Returns:

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



103
104
105
106
# File 'lib/icontrol/asm/policy.rb', line 103

def download_policy(opts)
  opts = check_params(opts,[:policy_name,:chunk_size,:file_offset])
  super(opts)
end

#dynamic_sessions_in_urlDynamicSessionsInUrl

Get the "dynamic sessions in URL“ for this policies.

Returns:

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



153
154
155
# File 'lib/icontrol/asm/policy.rb', line 153

def dynamic_sessions_in_url
  super
end

#export_policy(opts) ⇒ Object

Export Policy The export_policy method exports the policy specified in parameter policy_name and writes the file to the device's local disk. This method is typically followed by a call to download_policy which gets this full path filename as a parameter.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The name of the policy.

  • :filename (String)

    The filename to which the policy will be exported under /var/tmp.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



119
120
121
122
# File 'lib/icontrol/asm/policy.rb', line 119

def export_policy(opts)
  opts = check_params(opts,[:policy_name,:filename])
  super(opts)
end

#http_header_lengthlong

Get max http header length.

Returns:

  • (long)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



164
165
166
# File 'lib/icontrol/asm/policy.rb', line 164

def http_header_length
  super
end

#import_policy(opts) ⇒ Object

Import Policy Before calling import_policy, upload_policy should be done. Once the policy is completely uploaded, you can import it.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :webapp_name (String)

    The target web application into which the policy will be imported.

  • :filename (String)

    The server-side full path where the policy was previously uploaded during upload_policy. This is: “/var/tmp/” concatenated with the parameter policy_name from the import_policy call.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



208
209
210
211
# File 'lib/icontrol/asm/policy.rb', line 208

def import_policy(opts)
  opts = check_params(opts,[:webapp_name,:filename])
  super(opts)
end

#listString

Get the list of policies.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



175
176
177
# File 'lib/icontrol/asm/policy.rb', line 175

def list
  super
end

Updates max cookie length.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :cookie_lengths (long)

    The maximum length of a cookie.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



221
222
223
224
# File 'lib/icontrol/asm/policy.rb', line 221

def set_cookie_length(opts)
  opts = check_params(opts,[:cookie_lengths])
  super(opts)
end

#set_disable_blocking_flag(opts) ⇒ Object

Updates blocking flag.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :blocking_flags (boolean)

    The flags of blocking enabled / disabled for each policy

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



234
235
236
237
# File 'lib/icontrol/asm/policy.rb', line 234

def set_disable_blocking_flag(opts)
  opts = check_params(opts,[:blocking_flags])
  super(opts)
end

#set_dynamic_sessions_in_url(opts) ⇒ Object

Set the "dynamic sessions in URL“ for this policies.

Parameters:

  • opts (Hash)

Options Hash (opts):

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



247
248
249
250
# File 'lib/icontrol/asm/policy.rb', line 247

def set_dynamic_sessions_in_url(opts)
  opts = check_params(opts,[:settings])
  super(opts)
end

#set_http_header_length(opts) ⇒ Object

Updates max http header length.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :http_header_lengths (long)

    The maximum length of http header.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



260
261
262
263
# File 'lib/icontrol/asm/policy.rb', line 260

def set_http_header_length(opts)
  opts = check_params(opts,[:http_header_lengths])
  super(opts)
end

#set_http_response_splitting(opts) ⇒ boolean

Set HTTP response splitting

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The polciy's name.

Returns:

  • (boolean)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



274
275
276
277
# File 'lib/icontrol/asm/policy.rb', line 274

def set_http_response_splitting(opts)
  opts = check_params(opts,[:policy_name])
  super(opts)
end

#set_path_traversal(opts) ⇒ boolean

Set path traversal

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The polciy's name.

Returns:

  • (boolean)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



288
289
290
291
# File 'lib/icontrol/asm/policy.rb', line 288

def set_path_traversal(opts)
  opts = check_params(opts,[:policy_name])
  super(opts)
end

#set_prerequisite_expiration_period(opts) ⇒ Object

Updates prerequisite expiration period flag.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :expiration_periods (long)

    The expiration period of login pages in seconds

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



301
302
303
304
# File 'lib/icontrol/asm/policy.rb', line 301

def set_prerequisite_expiration_period(opts)
  opts = check_params(opts,[:expiration_periods])
  super(opts)
end

#set_violation_flags(opts) ⇒ Object

Updates violation blocking flag.

Parameters:

  • opts (Hash)

Options Hash (opts):

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



314
315
316
317
# File 'lib/icontrol/asm/policy.rb', line 314

def set_violation_flags(opts)
  opts = check_params(opts,[:violations])
  super(opts)
end

#upload_policy(opts) ⇒ Object

Uploads the policy to the device. In order to import a policy two things have to be done in this order - call upload_policy - call import_policy upload_policy uploads the policy to the device to /var/tmp/ directory. The filename is the name of the policy given in policy_name. If the policy is big, it should be uploaded in chunks using a loop on the client side.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The name of the policy. The filename will be the name of the policy in the /var/tmp directory.

  • :file_context (IControl::ASM::FileTransferContext)

    The context of the transfer operation. It has two parts: - file_data: The relevant part of the content of the file - chunk_type: Indicates the current chunk whether it is the first, middle, last chunk or the current call includes the entire file.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



332
333
334
335
# File 'lib/icontrol/asm/policy.rb', line 332

def upload_policy(opts)
  opts = check_params(opts,[:policy_name,:file_context])
  super(opts)
end

#upload_xml_profile_wsdl(opts) ⇒ Object

Uploads the the wsdl and attaches it to a specific xml profile of a policy.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :policy_name (String)

    The name of the policy.

  • :profile_name (String)

    The name of the XML profile.

  • :wsdl_filename (String)

    The WSDL filename which will be attached to the XML profile.

  • :wsdl_text (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



348
349
350
351
# File 'lib/icontrol/asm/policy.rb', line 348

def upload_xml_profile_wsdl(opts)
  opts = check_params(opts,[:policy_name,:profile_name,:wsdl_filename,:wsdl_text])
  super(opts)
end

#versionString

Gets the version information for this interface.

Returns:

  • (String)


183
184
185
# File 'lib/icontrol/asm/policy.rb', line 183

def version
  super
end

#violation_flagsViolation[]

Gets violation blocking flag.

Returns:

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



194
195
196
# File 'lib/icontrol/asm/policy.rb', line 194

def violation_flags
  super
end