Module: Nexpose::CredentialHelper

Included in:
Credential
Defined in:
lib/nexpose/credential_helper.rb

Instance Method Summary collapse

Instance Method Details

#set_as400_service(domain = nil, username = nil, password = nil) ⇒ Object

sets the IBM AS/400 service.



29
30
31
32
33
34
# File 'lib/nexpose/credential_helper.rb', line 29

def set_as400_service(domain = nil, username = nil, password = nil)
  self.domain    = domain
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::AS400
end

#set_cifs_service(domain = nil, username = nil, password = nil) ⇒ Object

sets the Microsoft Windows/Samba (SMB/CIFS) service.



53
54
55
56
57
58
# File 'lib/nexpose/credential_helper.rb', line 53

def set_cifs_service(domain = nil, username = nil, password = nil)
  self.domain    = domain
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::CIFS
end

#set_cifshash_service(domain = nil, username = nil, password = nil) ⇒ Object

sets the Microsoft Windows/Samba LM/NTLM Hash (SMB/CIFS) service.



61
62
63
64
65
66
# File 'lib/nexpose/credential_helper.rb', line 61

def set_cifshash_service(domain = nil, username = nil, password = nil)
  self.domain    = domain
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::CIFSHASH
end

#set_cvs_service(username = nil, password = nil) ⇒ Object

sets the Concurrent Versioning System (CVS) service



7
8
9
10
11
# File 'lib/nexpose/credential_helper.rb', line 7

def set_cvs_service(username = nil, password = nil)
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::CVS
end

#set_db2_service(database = nil, username = nil, password = nil) ⇒ Object

sets the DB2 service



14
15
16
17
18
19
# File 'lib/nexpose/credential_helper.rb', line 14

def set_db2_service(database = nil, username = nil, password = nil)
  self.database  = database
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::DB2
end

#set_ftp_service(username = nil, password = nil) ⇒ Object

sets the File Transfer Protocol (FTP) service



22
23
24
25
26
# File 'lib/nexpose/credential_helper.rb', line 22

def set_ftp_service(username = nil, password = nil)
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::FTP
end

#set_http_service(domain = nil, username = nil, password = nil) ⇒ Object

sets the Web Site HTTP Authentication service.



161
162
163
164
165
166
# File 'lib/nexpose/credential_helper.rb', line 161

def set_http_service(domain = nil, username = nil, password = nil)
  self.domain    = domain
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::HTTP
end

#set_mysql_service(database = nil, username = nil, password = nil) ⇒ Object

sets the MySQL Server service.



69
70
71
72
73
74
# File 'lib/nexpose/credential_helper.rb', line 69

def set_mysql_service(database = nil, username = nil, password = nil)
  self.database  = database
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::MYSQL
end

#set_notes_service(password = nil) ⇒ Object

sets the Lotus Notes/Domino service.



37
38
39
40
# File 'lib/nexpose/credential_helper.rb', line 37

def set_notes_service(password = nil)
  self.notes_id_password = password
  self.service           = Credential::Service::NOTES
end

#set_oracle_service(sid = nil, username = nil, password = nil) ⇒ Object

sets the Oracle service.



77
78
79
80
81
82
# File 'lib/nexpose/credential_helper.rb', line 77

def set_oracle_service(sid = nil, username = nil, password = nil)
  self.database  = sid
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::ORACLE
end

#set_pop_service(username = nil, password = nil) ⇒ Object

sets the Post Office Protocol (POP) service.



85
86
87
88
89
# File 'lib/nexpose/credential_helper.rb', line 85

def set_pop_service(username = nil, password = nil)
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::POP
end

#set_postgresql_service(database = nil, username = nil, password = nil) ⇒ Object

sets the PostgreSQL service.



92
93
94
95
96
97
# File 'lib/nexpose/credential_helper.rb', line 92

def set_postgresql_service(database = nil, username = nil, password = nil)
  self.database  = database
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::POSTGRESQL
end

#set_remote_execution_service(username = nil, password = nil) ⇒ Object

sets the Remote Execution service.



100
101
102
103
104
# File 'lib/nexpose/credential_helper.rb', line 100

def set_remote_execution_service(username = nil, password = nil)
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::REMOTE_EXECUTION
end

#set_snmp_service(community_name = nil) ⇒ Object

sets the Simple Network Management Protocol v1/v2c service.



128
129
130
131
# File 'lib/nexpose/credential_helper.rb', line 128

def set_snmp_service(community_name = nil)
  self.community_name = community_name
  self.service        = Credential::Service::SNMP
end

#set_snmpv3_service(authentication_type = Credential::AuthenticationType::NOAUTH, username = nil, password = nil, privacy_type = Credential::PrivacyType::NOPRIV, privacy_password = nil) ⇒ Object

sets the Simple Network Management Protocol v3 service.



134
135
136
137
138
139
140
141
# File 'lib/nexpose/credential_helper.rb', line 134

def set_snmpv3_service(authentication_type = Credential::AuthenticationType::NOAUTH, username = nil, password = nil, privacy_type = Credential::PrivacyType::NOPRIV, privacy_password = nil)
  self.authentication_type = authentication_type
  self.user_name           = username
  self.password            = password
  self.privacy_type        = privacy_type
  self.privacy_password    = privacy_password
  self.service             = Credential::Service::SNMPV3
end

#set_ssh_key_service(username, pemkey, password = nil, elevation_type = nil, elevation_user = nil, elevation_password = nil) ⇒ Object

sets the Secure Shell (SSH) Public Key service.



117
118
119
120
121
122
123
124
125
# File 'lib/nexpose/credential_helper.rb', line 117

def set_ssh_key_service(username, pemkey, password = nil, elevation_type = nil, elevation_user = nil, elevation_password = nil)
  self.user_name                     = username
  self.password                      = password
  self.pem_format_private_key        = pemkey
  self.permission_elevation_type     = elevation_type || Credential::ElevationType::NONE
  self.permission_elevation_user     = elevation_user
  self.permission_elevation_password = elevation_password
  self.service                       = Credential::Service::SSH_KEY
end

#set_ssh_service(username = nil, password = nil, elevation_type = nil, elevation_user = nil, elevation_password = nil) ⇒ Object

sets the Secure Shell (SSH) service.



107
108
109
110
111
112
113
114
# File 'lib/nexpose/credential_helper.rb', line 107

def set_ssh_service(username = nil, password = nil, elevation_type = nil, elevation_user = nil, elevation_password = nil)
  self.user_name                     = username
  self.password                      = password
  self.permission_elevation_type     = elevation_type || Credential::ElevationType::NONE
  self.permission_elevation_user     = elevation_user
  self.permission_elevation_password = elevation_password
  self.service                       = Credential::Service::SSH
end

#set_sybase_service(database = nil, domain = nil, username = nil, password = nil) ⇒ Object

sets the Sybase SQL Server service.



144
145
146
147
148
149
150
151
# File 'lib/nexpose/credential_helper.rb', line 144

def set_sybase_service(database = nil, domain = nil, username = nil, password = nil)
  self.database         = database
  self.domain           = domain
  self.use_windows_auth = domain.nil?
  self.user_name        = username
  self.password         = password
  self.service          = Credential::Service::SYBASE
end

#set_tds_service(database = nil, domain = nil, username = nil, password = nil) ⇒ Object

sets the Microsoft SQL Server service.



43
44
45
46
47
48
49
50
# File 'lib/nexpose/credential_helper.rb', line 43

def set_tds_service(database = nil, domain = nil, username = nil, password = nil)
  self.database         = database
  self.domain           = domain
  self.use_windows_auth = domain.nil?
  self.user_name        = username
  self.password         = password
  self.service          = Credential::Service::TDS
end

#set_telnet_service(username = nil, password = nil) ⇒ Object

sets the Telnet service.



154
155
156
157
158
# File 'lib/nexpose/credential_helper.rb', line 154

def set_telnet_service(username = nil, password = nil)
  self.user_name = username
  self.password  = password
  self.service   = Credential::Service::TELNET
end