Class: Nexpose::SharedCredentialSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/shared_cred.rb

Direct Known Subclasses

SharedCredential

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#all_sitesObject

Boolean to indicate whether this credential applies to all sites.



39
40
41
# File 'lib/nexpose/shared_cred.rb', line 39

def all_sites
  @all_sites
end

#domainObject

Domain or realm.



33
34
35
# File 'lib/nexpose/shared_cred.rb', line 33

def domain
  @domain
end

#idObject

Unique ID assigned to this credential by Nexpose.



27
28
29
# File 'lib/nexpose/shared_cred.rb', line 27

def id
  @id
end

#last_modifiedObject

When this credential was last modified.



41
42
43
# File 'lib/nexpose/shared_cred.rb', line 41

def last_modified
  @last_modified
end

#nameObject

Name to identify this credential.



29
30
31
# File 'lib/nexpose/shared_cred.rb', line 29

def name
  @name
end

#privilege_usernameObject

User name to use when elevating permissions (e.g., sudo).



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

def privilege_username
  @privilege_username
end

#typeObject

The credential type. See Nexpose::Credential::Type.



31
32
33
# File 'lib/nexpose/shared_cred.rb', line 31

def type
  @type
end

#usernameObject

User name.



35
36
37
# File 'lib/nexpose/shared_cred.rb', line 35

def username
  @username
end

Class Method Details

.from_json(json) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/nexpose/shared_cred.rb', line 43

def self.from_json(json)
  cred = new
  cred.id = json['credentialID']['ID']
  cred.name = json['name']
  cred.type = json['service']
  cred.domain = json['domain']
  cred.username = json['username']
  cred.privilege_username = json['privilegeElevationUsername']
  cred.all_sites = json['scope'] == 'ALL_SITES_ENABLED_DEFAULT'
  cred.last_modified = Time.at(json['lastModified']['time'] / 1000)
  cred
end

Instance Method Details

#delete(nsc) ⇒ Object

Delete this credential from the security console.

Parameters:

  • nsc (Connection)

    An active connection to the security console.



60
61
62
# File 'lib/nexpose/shared_cred.rb', line 60

def delete(nsc)
  nsc.delete_shared_credential(@id)
end