Module: PWN::AWS::WAFRegional
- Defined in:
- lib/pwn/aws/waf_regional.rb
Overview
This module provides a client for making API requests to AWS WAF Regional.
Constant Summary collapse
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
-
0day Inc.
-
.connect(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::AWS::WAFRegional.connect( region: ‘required - region name to connect (eu-west-1, ap-southeast-1, ap-southeast-2, eu-central-1, ap-northeast-2, ap-northeast-1, us-east-1, sa-east-1, us-west-1, us-west-2)’, access_key_id: ‘required - Use AWS STS for best privacy (i.e. temporary access key id)’, secret_access_key: ‘required - Use AWS STS for best privacy (i.e. temporary secret access key’, sts_session_token: ‘optional - Temporary token returned by STS client for best privacy’ ).
-
.disconnect(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::AWS::WAFRegional.disconnect( waf_regional_obj: ‘required - waf_regional_obj returned from #connect method’ ).
-
.help ⇒ Object
Display Usage for this Module.
Class Method Details
.authors ⇒ Object
- Author(s)
-
0day Inc. <[email protected]>
65 66 67 68 69 |
# File 'lib/pwn/aws/waf_regional.rb', line 65 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.connect(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::AWS::WAFRegional.connect(
region: 'required - region name to connect (eu-west-1, ap-southeast-1, ap-southeast-2, eu-central-1, ap-northeast-2, ap-northeast-1, us-east-1, sa-east-1, us-west-1, us-west-2)', access_key_id: 'required - Use AWS STS for best privacy (i.e. temporary access key id)', secret_access_key: 'required - Use AWS STS for best privacy (i.e. temporary secret access key', sts_session_token: 'optional - Temporary token returned by STS client for best privacy'
)
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pwn/aws/waf_regional.rb', line 19 public_class_method def self.connect(opts = {}) region = opts[:region].to_s.scrub.chomp.strip access_key_id = opts[:access_key_id].to_s.scrub.chomp.strip secret_access_key = opts[:secret_access_key].to_s.scrub.chomp.strip sts_session_token = opts[:sts_session_token].to_s.scrub.chomp.strip @@logger.info('Connecting to AWS WAFRegional...') if sts_session_token == '' waf_regional_obj = Aws::WAFRegional::Client.new( region: region, access_key_id: access_key_id, secret_access_key: secret_access_key ) else waf_regional_obj = Aws::WAFRegional::Client.new( region: region, access_key_id: access_key_id, secret_access_key: secret_access_key, session_token: sts_session_token ) end @@logger.info("complete.\n") waf_regional_obj rescue StandardError => e raise e end |
.disconnect(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::AWS::WAFRegional.disconnect(
waf_regional_obj: 'required - waf_regional_obj returned from #connect method'
)
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/pwn/aws/waf_regional.rb', line 52 public_class_method def self.disconnect(opts = {}) waf_regional_obj = opts[:waf_regional_obj] @@logger.info('Disconnecting...') waf_regional_obj = nil @@logger.info("complete.\n") waf_regional_obj rescue StandardError => e raise e end |
.help ⇒ Object
Display Usage for this Module
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/pwn/aws/waf_regional.rb', line 73 public_class_method def self.help puts "USAGE: waf_regional_obj = #{self}.connect( region: 'required - region name to connect (eu-west-1, ap-southeast-1, ap-southeast-2, eu-central-1, ap-northeast-2, ap-northeast-1, us-east-1, sa-east-1, us-west-1, us-west-2)', access_key_id: 'required - Use AWS STS for best privacy (i.e. temporary access key id)', secret_access_key: 'required - Use AWS STS for best privacy (i.e. temporary secret access key', sts_session_token: 'optional - Temporary token returned by STS client for best privacy' ) puts waf_regional_obj.public_methods #{self}.disconnect( waf_regional_obj: 'required - waf_regional_obj returned from #connect method' ) #{self}.authors " end |