Improved Documentation

This commit is contained in:
Daniel Dayley 2021-07-06 12:58:45 -06:00
parent d343cd2bbf
commit 81c46a31bc
14 changed files with 32 additions and 27 deletions

View File

@ -24,7 +24,8 @@ By default, several plugins are included.
### Usage ### Usage
``` ```
usage: ifxlookup [-h] [-c CONFIG] [-f FILTER] [-j] [-cg] [-b] [-l] [-gc] [-d] [-cms] [-vm] [-r] [-w] [-s] [-fw] [-m] [-v] subjects [subjects ...] usage: ifxlookup [-h] [-c CONFIG] [-f FILTER] [-j] [-cg] [-b] [-l] [-gc] [-d] [-cms] [-vm] [-r] [-w] [-s] [-fw] [-m] [-v]
subjects [subjects ...]
positional arguments: positional arguments:
subjects IP's, hostnames, MAC's, usernames, or other strings to look up. subjects IP's, hostnames, MAC's, usernames, or other strings to look up.
@ -36,18 +37,18 @@ optional arguments:
-f FILTER, --filter FILTER -f FILTER, --filter FILTER
Apply a JSONPath filter to the results (multiple filters may be specified) Apply a JSONPath filter to the results (multiple filters may be specified)
-j, --json Format output as json -j, --json Format output as json
-cg, --vip Return VIP information about the subject (f5) -cg, --vip VIP information about the subject (f5)
-b, --bluecat Return network information about the subject (bluecat) -b, --bluecat Bluecat information about the subject (bluecat)
-l, --ldap Return LDAP information about the subject (ldap) -l, --ldap LDAP information about the subject (ldap)
-gc, --guid_channels Return working channels for GUID -gc, --guid_channels Working channels for GUID
-d, --dns Return DNS resolution about the subject (dns) -d, --dns DNS resolution about the subject (dns)
-cms, --channel Return CMS channel info about the subject (cms) -cms, --channel CMS channel info about the subject (cms)
-vm, --vm Return VMWare information about the subject (vmware) -vm, --vm VMWare information about the subject (vmware)
-r, --vpn Return VPN information about the subject (openvpn) -r, --vpn VPN log information about the subject (openvpn)
-w, --wifi Return wireless connection information about the subject (aruba) -w, --wifi Wireless connection information about the subject (aruba)
-s, --shodan Return Shodan information about the subject (dns) -s, --shodan Shodan information about the subject (dns)
-fw, --rules Return Firewall addresses, groups, and rules relating to the subject -fw, --rules Firewall addresses, groups, and rules relating to the subject
-m, --mac Return vendor OUI from a MAC address (mac) -m, --mac Vendor OUI from a MAC address (mac)
-v, --debug Include debug information in the output. Add 'v's for more output. -v, --debug Include debug information in the output. Add 'v's for more output.
``` ```
@ -110,6 +111,11 @@ To find the email addresses of all LDAP users whose username starts with 'daniel
ifxlookup -l daniel -f '*.ldap.*.mail[0]' ifxlookup -l daniel -f '*.ldap.*.mail[0]'
``` ```
To find the callsign of a channel with channel id '24696f5c20ad4d1490111064f0b32dc1':
```sh
ifxlookup -cms 24696f5c20ad4d1490111064f0b32dc1 -f '*.cms.channels[0].yaml_configuration_version.channel_title'
```
To find the operating systems installed on all VM's with 'ifxes' in the name: To find the operating systems installed on all VM's with 'ifxes' in the name:
```sh ```sh
ifxlookup --vm ifxes -f "*.vmware[*].guest.full_name.default_message" ifxlookup --vm ifxes -f "*.vmware[*].guest.full_name.default_message"
@ -291,4 +297,3 @@ each into a text file for storage.
## Known issues with this version: ## Known issues with this version:
* Caching is not yet implemented * Caching is not yet implemented
* VMWare plugins are not finished

View File

@ -17,7 +17,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return ['-w', '--wifi', 'store_true', 'Return wireless connection information about the subject (aruba)'] return ['-w', '--wifi', 'store_true', 'Wireless connection information about the subject (aruba)']
def startup(self) : def startup(self) :
for requirement in ['host','username','key'] : for requirement in ['host','username','key'] :

View File

@ -13,7 +13,7 @@ class ServiceDelegate(ServiceBase) :
_max_results = 1000 _max_results = 1000
def get_arguments(cls) : def get_arguments(cls) :
return ['-b', '--bluecat', 'store_true', 'Return network information about the subject (bluecat)'] return ['-b', '--bluecat', 'store_true', 'Bluecat information about the subject (bluecat)']
def startup(self) : def startup(self) :
for requirement in ['host','username','key','page_size','max_results'] : for requirement in ['host','username','key','page_size','max_results'] :

View File

@ -7,7 +7,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-cms','--channel', 'store_true', "Return CMS channel info about the subject (cms)" ] return [ '-cms','--channel', 'store_true', "CMS channel info about the subject (cms)" ]
def startup(self) : def startup(self) :
pass pass

View File

@ -8,7 +8,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-d', '--dns', 'store_true', 'Return DNS resolution about the subject (dns)' ] return [ '-d', '--dns', 'store_true', 'DNS resolution about the subject (dns)' ]
def startup(self) : def startup(self) :
self.resolver = dns.resolver.Resolver() self.resolver = dns.resolver.Resolver()

View File

@ -13,7 +13,7 @@ class ServiceDelegate(ServiceBase) :
_partition = 'Common' _partition = 'Common'
def get_arguments(cls) : def get_arguments(cls) :
return ['-cg', '--vip', 'store_true', 'Return VIP information about the subject (f5)'] return ['-cg', '--vip', 'store_true', 'VIP information about the subject (f5)']
def startup(self) : def startup(self) :
for requirement in ['hosts','username','key'] : for requirement in ['hosts','username','key'] :

View File

@ -7,7 +7,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-gc','--guid_channels', 'store_true', 'Return working channels for GUID' ] return [ '-gc','--guid_channels', 'store_true', 'Working channels for GUID' ]
def startup(self) : def startup(self) :

View File

@ -6,7 +6,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-l', '--ldap', 'store_true', 'Return LDAP information about the subject (ldap)' ] return [ '-l', '--ldap', 'store_true', 'LDAP information about the subject (ldap)' ]
def startup(self) : def startup(self) :
for requirement in ['host','bind_string','bind_key','search_base','scope','filter_string'] : for requirement in ['host','bind_string','bind_key','search_base','scope','filter_string'] :

View File

@ -6,7 +6,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-m', '--mac', 'store_true', 'Return vendor OUI from a MAC address (mac)' ] return [ '-m', '--mac', 'store_true', 'Vendor OUI from a MAC address (mac)' ]
def lookup(self,subject) : def lookup(self,subject) :
self.debug('Requesting MAC info from API...',1) self.debug('Requesting MAC info from API...',1)

View File

@ -9,7 +9,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return ['-r', '--vpn','store_true','Return VPN information about the subject (openvpn)'] return ['-r', '--vpn','store_true','VPN log information about the subject (openvpn)']
def startup(self) : def startup(self) :
for requirement in ['hosts','username','key'] : for requirement in ['hosts','username','key'] :

View File

@ -9,7 +9,7 @@ RULE_SEARCH_FIELDS = ['to','from','source','destination']
class ServiceDelegate(ServiceBase) : class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return ['-fw', '--rules', 'store_true', 'Return Firewall addresses, groups, and rules relating to the subject'] return ['-fw', '--rules', 'store_true', 'Firewall addresses, groups, and rules relating to the subject']
def startup(self) : def startup(self) :
if not self.config_valid() : if not self.config_valid() :

View File

@ -11,7 +11,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-s', '--shodan', 'store_true', 'Return Shodan information about the subject (dns)' ] return [ '-s', '--shodan', 'store_true', 'Shodan information about the subject (dns)' ]
def startup(self) : def startup(self) :
for requirement in ['keys'] : for requirement in ['keys'] :

View File

@ -8,7 +8,7 @@ class ServiceDelegate(ServiceBase) :
def get_arguments(cls) : def get_arguments(cls) :
"""Returns an array of information used to construct an argumentparser argument.""" """Returns an array of information used to construct an argumentparser argument."""
return [ '-vm', '--vm', 'store_true', "Return VMWare information about the subject (vmware)" ] return [ '-vm', '--vm', 'store_true', "VMWare information about the subject (vmware)" ]
def startup(self) : def startup(self) :
# Verify config # Verify config

View File

@ -14,6 +14,6 @@ setup(name='ifxlookup',
package_data={"": ['plugins/*.py']}, package_data={"": ['plugins/*.py']},
install_requires=['dnspython','jsonpath-ng','paramiko','PyYAML','requests','shodan','ldap3','vsphere-automation-sdk @ git+https://github.com/vmware/vsphere-automation-sdk-python.git'], install_requires=['dnspython','jsonpath-ng','paramiko','PyYAML','requests','shodan','ldap3','vsphere-automation-sdk @ git+https://github.com/vmware/vsphere-automation-sdk-python.git'],
scripts=['bin/ifxlookup'], scripts=['bin/ifxlookup'],
long_description=open('README').read(), long_description=open('README.md').read(),
zip_safe=True zip_safe=True
) )