smart_proxy_dns_infoblox 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 93913c19fdbb004b2265f61341b782c234eb4b7d
4
- data.tar.gz: 063e1118acfb2a85593c2b774d382663239493dc
2
+ SHA256:
3
+ metadata.gz: 5cfadf774e686f392163cab090cda18e690ae0c89a2ecfcd54e1c6d916fb7ef5
4
+ data.tar.gz: cc14db4c7b8931fb8e49310aa9eba1d9570b34530c1048f2e556de9b345192a1
5
5
  SHA512:
6
- metadata.gz: 9fd8344ceffca0e6344b0ba7c2b86fd540df89fc2089f51e32d11e3179092f6dcf5137b46673c9a8e73a53acadd644bdc275bb8a32ca9412b661d64c22fea612
7
- data.tar.gz: 90300ea7cc4e2083ed376fe7138c93e00352287847494ab020bbd0cc0eda8668d1be9138631cfc2d9c28fc03c049d00e19e30c5463dcdc68198ecb113e6e855b
6
+ metadata.gz: 2f12f800f8df1cfb0673a3a0e30b0196fae46ee4b42c505d66da87e155311ec02fc375a9ae132a9e558a7779990b93183d1d0343eb83e4ea10ff71b7053451dc
7
+ data.tar.gz: 97d0999844145b63635f671164933b825003b29c2ec656ae1ca6545a69b1ba7a43970aa077dffc34c96c622f81b2b32d089f7346a4a1446019ac1db392b32939
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SmartProxyDnsInfoblox
2
2
 
3
- *Introduction here*
3
+ [![Build Status](https://travis-ci.org/theforeman/smart_proxy_dns_infoblox.svg?branch=master)](https://travis-ci.org/theforeman/smart_proxy_dns_infoblox)
4
4
 
5
5
  This plugin adds a new DNS provider for managing records in MyService.
6
6
 
@@ -11,6 +11,16 @@ for how to install Smart Proxy plugins
11
11
 
12
12
  This plugin is compatible with Smart Proxy 1.10 or higher.
13
13
 
14
+ Example installation command via foreman-installer:
15
+
16
+ ```
17
+ # foreman-installer --enable-foreman-proxy-plugin-dns-infoblox \
18
+ --foreman-proxy-dns-provider infoblox \
19
+ --foreman-proxy-plugin-dns-infoblox-dns-server 192.168.201.2 \
20
+ --foreman-proxy-plugin-dns-infoblox-username admin \
21
+ --foreman-proxy-plugin-dns-infoblox-password infoblox
22
+ ```
23
+
14
24
  ## Configuration
15
25
 
16
26
  To enable this DNS provider, edit `/etc/foreman-proxy/settings.d/dns.yml` and set:
@@ -21,6 +31,43 @@ Configuration options for this plugin are in `/etc/foreman-proxy/settings.d/dns_
21
31
 
22
32
  * example_setting: change this as an example
23
33
 
34
+ ## SSL
35
+
36
+ The plugin enforces HTTPS server certificate verification. Follow a standard CA cert installation procedure for your operating system. It's possible to either download the server certificate from Infoblox web UI or use openssl command to extract it from server response. Here are example steps for Red Hat compatible systems:
37
+
38
+ ```
39
+ # update-ca-trust enable
40
+ # openssl s_client -showcerts -connect 192.168.201.2:443 </dev/null | openssl x509 -text >/etc/pki/ca-trust/source/anchors/infoblox.crt
41
+ # update-ca-trust extract
42
+ ```
43
+
44
+ For Debian-compatible systems:
45
+
46
+ ```
47
+ # openssl s_client -showcerts -connect 192.168.201.2:443 </dev/null | openssl x509 -text >/usr/local/share/ca-certificates/infoblox.crt
48
+ # update-ca-certificates
49
+ ```
50
+
51
+ To test the CA certificate, a simple curl query can be used. This is a positive test:
52
+
53
+ ```
54
+ # curl -u admin:infoblox https://192.168.201.2/wapi/v2.0/network
55
+ [
56
+ {
57
+ "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yMDIuMC8yNC8w:192.168.202.0/24/default",
58
+ "network": "192.168.202.0/24",
59
+ "network_view": "default"
60
+ }
61
+ ]
62
+ ```
63
+
64
+ And a negative one:
65
+
66
+ ```
67
+ # curl -u admin:infoblox https://192.168.201.2/wapi/v2.0/network
68
+ curl: (60) SSL certificate problem: self signed certificate
69
+ ```
70
+
24
71
  ## Contributing
25
72
 
26
73
  Fork and send a Pull Request. Thanks!
@@ -3,7 +3,6 @@ module Proxy::Dns::Infoblox
3
3
  attr_reader :connection
4
4
 
5
5
  def initialize(host, connection, ttl)
6
- ENV['WAPI_VERSION']='2.0'
7
6
  @connection = connection
8
7
  super(host, ttl)
9
8
  end
@@ -1,7 +1,7 @@
1
1
  module Proxy
2
2
  module Dns
3
3
  module Infoblox
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -13,10 +13,12 @@ module Proxy::Dns::Infoblox
13
13
  ::Infoblox::Connection.new(:username => settings[:username],
14
14
  :password => settings[:password],
15
15
  :host => settings[:dns_server],
16
- :ssl_opts => {:verify => false})
16
+ :ssl_opts => { :verify => true },
17
+ :logger => ::Proxy::LogBuffer::Decorator.instance)
17
18
  end)
18
19
  container_instance.dependency :dns_provider,
19
- lambda {::Proxy::Dns::Infoblox::Record.new(
20
+ lambda {
21
+ ::Proxy::Dns::Infoblox::Record.new(
20
22
  settings[:dns_server],
21
23
  container_instance.get_dependency(:connection),
22
24
  settings[:dns_ttl]) }
@@ -15,7 +15,7 @@ class InfobloxProviderWiringTest < Test::Unit::TestCase
15
15
  assert_equal 'user', connection.username
16
16
  assert_equal 'password', connection.password
17
17
  assert_equal 'https://a_host', connection.host
18
- assert_equal({:verify => false}, connection.ssl_opts)
18
+ assert_equal({ :verify => true }, connection.ssl_opts)
19
19
  end
20
20
 
21
21
  def test_dns_provider_wiring
@@ -3,7 +3,6 @@ require 'dns_common/dns_common'
3
3
  require 'infoblox'
4
4
  require 'smart_proxy_dns_infoblox/dns_infoblox_main'
5
5
 
6
-
7
6
  class InfobloxTest < Test::Unit::TestCase
8
7
  class DummyRecord
9
8
  attr_accessor :ipv6addr, :view
@@ -0,0 +1,61 @@
1
+ require 'test_helper'
2
+ require 'dns_common/dns_common'
3
+ require 'smart_proxy_dns_infoblox'
4
+ require 'smart_proxy_dns_infoblox/dns_infoblox_main'
5
+ require "rack/test"
6
+ require 'json'
7
+
8
+ module Proxy::Dns
9
+ module DependencyInjection
10
+ include Proxy::DependencyInjection::Accessors
11
+ def container_instance
12
+ end
13
+ end
14
+ end
15
+
16
+ require 'dns/dns_api'
17
+
18
+ ENV['RACK_ENV'] = 'test'
19
+
20
+ class IntegrationTest < ::Test::Unit::TestCase
21
+ include Rack::Test::Methods
22
+
23
+ class DnsProviderForTesting < Proxy::Dns::Infoblox::Record
24
+ def initialize
25
+ end
26
+ end
27
+
28
+ def app
29
+ app = Proxy::Dns::Api.new
30
+ app.helpers.server = @server
31
+ app
32
+ end
33
+
34
+ def setup
35
+ @server = DnsProviderForTesting.new
36
+ end
37
+
38
+ def test_create_a_record
39
+ @server.expects(:create_a_record).with("test.com", "192.168.33.33")
40
+ post '/', :fqdn => 'test.com', :value => '192.168.33.33', :type => 'A'
41
+ assert last_response.ok?, "Last response was not ok: #{last_response.status} #{last_response.body}"
42
+ end
43
+
44
+ def test_create_ptr_record
45
+ @server.expects(:create_ptr_record).with("test.com", "33.33.168.192.in-addr.arpa")
46
+ post '/', :fqdn => 'test.com', :value => '33.33.168.192.in-addr.arpa', :type => 'PTR'
47
+ assert last_response.ok?, "Last response was not ok: #{last_response.status} #{last_response.body}"
48
+ end
49
+
50
+ def test_delete_a_record
51
+ @server.expects(:remove_a_record).with("test.com")
52
+ delete '/test.com'
53
+ assert last_response.ok?, "Last response was not ok: #{last_response.status} #{last_response.body}"
54
+ end
55
+
56
+ def test_delete_ptr_record
57
+ @server.expects(:remove_ptr_record).with("33.33.168.192.in-addr.arpa")
58
+ delete '/33.33.168.192.in-addr.arpa'
59
+ assert last_response.ok?, "Last response was not ok: #{last_response.status} #{last_response.body}"
60
+ end
61
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_dns_infoblox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Nicholson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-18 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2018-12-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.50.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.50.0
13
27
  description: Infoblox DNS provider plugin for Foreman's smart proxy
14
28
  email:
15
29
  - matthew.a.nicholson@gmail.com
@@ -28,6 +42,7 @@ files:
28
42
  - lib/smart_proxy_dns_infoblox/plugin_configuration.rb
29
43
  - test/configuration_test.rb
30
44
  - test/infoblox_test.rb
45
+ - test/integration_test.rb
31
46
  - test/test_helper.rb
32
47
  homepage: https://github.com/theforeman/smart_proxy_dns_infoblox
33
48
  licenses:
@@ -49,11 +64,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
64
  version: '0'
50
65
  requirements: []
51
66
  rubyforge_project:
52
- rubygems_version: 2.6.12
67
+ rubygems_version: 2.7.6
53
68
  signing_key:
54
69
  specification_version: 4
55
70
  summary: Infoblox DNS provider plugin for Foreman's smart proxy
56
71
  test_files:
57
- - test/infoblox_test.rb
58
72
  - test/test_helper.rb
59
73
  - test/configuration_test.rb
74
+ - test/integration_test.rb
75
+ - test/infoblox_test.rb