Skip to main content

SSH Scanner Commands Reference

This document provides a comprehensive reference of all commands used by the NopeSight v3 SSH scanner for Linux/Unix/AIX system discovery and data collection.

Overview

The SSH scanner (ssh_scanner.py) performs comprehensive system discovery on Linux/Unix/AIX systems via SSH connections. It collects system information, hardware details, network configurations, installed software, and active connections to build a complete infrastructure inventory.

Supported Operating Systems

  • Linux: Ubuntu, Debian, RHEL, CentOS, Fedora, Oracle Linux, SUSE
  • Unix: Various Unix variants
  • IBM AIX: Power systems (POWER7, POWER8, POWER9, POWER10)

Permission Requirements Overview

The scanner operates in two modes based on available privileges:

ModeUser TypeAccess LevelData Collected
Basic ModeRegular userNon-privilegedSystem info, network config, processes, user accounts, installed packages
Enhanced ModeRoot or sudo userPrivilegedAll basic data + hardware details, BIOS info, disk health, virtualization

Minimum Required Permissions

For Basic Discovery (Non-Root):

  • SSH access with password or key-based authentication
  • Read access to /etc/passwd, /proc/*, /sys/* (Linux) or /etc/* (AIX)
  • Execute access to standard system commands (ps, df, netstat/ss, hostname)

For Complete Discovery (Root/Sudo):

  • All basic permissions
  • Root access via sudo or direct root login
  • Execute access to hardware inspection tools (dmidecode, smartctl, lspci on Linux; lscfg, prtconf on AIX)
  • Access to virtualization tools (docker, virsh) if applicable

LINUX COMMANDS

Basic Commands (Non-Root Access)

These commands can be executed with regular user privileges and provide fundamental system information.

Required Permissions: Regular user account with SSH access Required Roles: No special roles required File Access: Read access to /proc/*, /sys/*, /etc/*

System Identification

CommandPurposePermissionsData Collected
hostnameGet system hostnameAny userSystem hostname
uname -aGet kernel and system informationAny userOS name, kernel version, architecture, build date
uname -rGet kernel release versionAny userKernel version string
cat /etc/os-releaseGet OS distribution detailsRead /etc/os-releaseDistribution name, version, codename, ID
cat /etc/issueGet OS issue string (fallback)Read /etc/issueOS identification string

Example Output:

hostname
# → server01.example.com

uname -a
# → Linux server01 5.4.0-99-generic #112-Ubuntu SMP x86_64 GNU/Linux

cat /etc/os-release
# → NAME="Ubuntu"
# → VERSION="20.04.3 LTS (Focal Fossa)"
# → ID=ubuntu

Hardware Information

CommandPurposePermissionsData Collected
cat /proc/cpuinfoGet CPU informationRead /proc/cpuinfoCPU model, cores, speed, cache, flags
lscpuGet detailed CPU architectureAny userArchitecture, CPU op-modes, byte order, cores
cat /proc/cpuinfo | grep "model name" | head -1Get CPU model nameRead /proc/cpuinfoCPU model string
free -hGet memory usage (human-readable)Any userTotal, used, free, available memory
cat /proc/meminfoGet detailed memory informationRead /proc/meminfoMemTotal, MemFree, Buffers, Cached, SwapTotal
df -hGet disk space (human-readable)Any userFilesystem, size, used, available, mount points
df -k / | tail -1 | awk '{print $2}'Get root disk size in KBAny userTotal disk size in kilobytes

Example Output:

free -h
# → total used free shared buff/cache available
# → Mem: 62Gi 8.2Gi 40Gi 1.2Gi 13Gi 51Gi

df -h
# → Filesystem Size Used Avail Use% Mounted on
# → /dev/sda1 1.0T 450G 550G 45% /

Purpose: Collects hardware specifications including CPU model, core count, total memory, and disk capacity.

System Model Information

CommandPurposePermissionsData Collected
cat /sys/devices/virtual/dmi/id/product_nameGet system product nameRead /sys/devices/virtual/dmi/id/*Hardware model (e.g., "PowerEdge R740")
cat /sys/devices/virtual/dmi/id/sys_vendorGet system manufacturerRead /sys/devices/virtual/dmi/id/*Manufacturer (e.g., "Dell Inc.")
cat /sys/devices/virtual/dmi/id/product_serialGet system serial numberRead /sys/devices/virtual/dmi/id/*Serial number
dmidecode -s system-serial-numberGet serial (fallback)Root/sudo or read /dev/memSerial number

Example Output:

cat /sys/devices/virtual/dmi/id/product_name
# → PowerEdge R740

cat /sys/devices/virtual/dmi/id/sys_vendor
# → Dell Inc.

Network Configuration

CommandPurposePermissionsData Collected
ip addr showGet network interface informationAny userInterface names, IPs, MACs, states
hostname -IGet local IP addressesAny userAll assigned IP addresses
ip route show defaultGet default gateway (modern)Any userDefault route, gateway IP
route -nGet default gateway (legacy)Any userRouting table, gateway IP
ss -tuanGet network connections (modern)Any userTCP/UDP connections, states, ports
netstat -tuanGet network connections (legacy)Any userTCP/UDP connections, states, ports

Example Output:

ip addr show
# → 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
# → inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
# → inet6 fe80::a00:27ff:fe4e:66a1/64 scope link

ip route show default
# → default via 192.168.1.1 dev eth0 proto static metric 100

route -n
# → Kernel IP routing table
# → Destination Gateway Genmask Flags Metric Ref Use Iface
# → 0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0

ss -tuan
# → Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
# → tcp ESTAB 0 0 192.168.1.100:22 192.168.1.10:54321

Purpose: Collects network interface configurations, IP addresses, and active network connections.

User Accounts

CommandPurposePermissionsData Collected
cat /etc/passwdGet user account informationRead /etc/passwdUsernames, UIDs, GIDs, home directories, shells
last -5Get recent login historyRead /var/log/wtmpLast 5 user logins with timestamps

Example Output:

cat /etc/passwd
# → root:x:0:0:root:/root:/bin/bash
# → user1:x:1000:1000:User One:/home/user1:/bin/bash

last -5
# → user1 pts/0 192.168.1.10 Mon Jan 8 14:23 still logged in

Purpose: Lists user accounts and recent login activity for security and compliance analysis.

Process Information

CommandPurposePermissionsData Collected
ps -eo pid,ppid,user,start_time,cmdGet running processes with detailsAny userPIDs, parent PIDs, users, start times, commands
readlink -f /proc/$pid/exeGet process executable pathRead /proc/$pid/exeFull path to process executable

Example Output:

ps -eo pid,ppid,user,start_time,cmd
# → PID PPID USER START COMMAND
# → 1 0 root Jan08 /sbin/init
# → 1234 1 www-data 14:23 /usr/sbin/apache2 -k start

readlink -f /proc/1234/exe
# → /usr/sbin/apache2

Purpose: Lists all running processes with their paths, enabling connection-to-process mapping and application inventory.

Software Inventory

CommandPurposePermissionsData Collected
dpkg -lGet installed packages (Debian/Ubuntu)Any userPackage names, versions, descriptions
rpm -qaGet installed packages (RHEL/CentOS)Any userPackage names with versions

Example Output:

dpkg -l
# → ii apache2 2.4.41-4ubuntu3.8 amd64 Apache HTTP Server

rpm -qa
# → httpd-2.4.6-97.el7.centos.x86_64

Purpose: Inventories installed software packages for security, compliance, and license management.


Root-Level Commands (Requires Root/Sudo)

These commands require elevated privileges and provide deeper system information.

Required Permissions: Root access or sudo privileges Required Roles: root or user in sudo/wheel group File Access: Full system access including /dev/*, /sys/*, hardware devices

Hardware Details

CommandPurposePermissionsData Collected
dmidecode -t systemGet system hardware informationRoot/sudoProduct name, manufacturer, serial, UUID
dmidecode -t biosGet BIOS informationRoot/sudoBIOS vendor, version, release date
dmidecode -t processorGet processor detailsRoot/sudoProcessor family, voltage, max speed
dmidecode -t memoryGet memory module informationRoot/sudoMemory type, speed, size, manufacturer

Example Output:

sudo dmidecode -t system
# → System Information
# → Manufacturer: Dell Inc.
# → Product Name: PowerEdge R740
# → Serial Number: ABC123XYZ
# → UUID: 4c4c4544-0042-4a10-8043-b7c04f313233

Purpose: Provides detailed hardware specifications including BIOS version, processor details, and physical memory configuration.

Storage Details

CommandPurposePermissionsData Collected
fdisk -lGet disk partition informationRoot/sudoDisk devices, partitions, sizes, types
lsblk -d -o name -nList block devicesAny userBlock device names
smartctl -a /dev/$deviceGet disk SMART health dataRoot/sudoDisk health, temperature, errors, hours

Example Output:

sudo fdisk -l
# → Disk /dev/sda: 1000 GB
# → /dev/sda1 * 2048 2099199 2097152 1G 83 Linux

sudo smartctl -a /dev/sda
# → Model Family: Seagate Barracuda
# → Device Model: ST1000DM003-1SB102
# → SMART Health Status: PASSED

Purpose: Shows disk partitions, SMART health data, and storage device details for capacity planning and failure prediction.

Advanced Network and System Information

CommandPurposePermissionsData Collected
lspci -vGet PCI device informationAny user (root for full details)PCI devices, drivers, capabilities
lsof -i -n -PGet detailed network connectionsRoot/sudoConnections with file descriptors, full process info
ss -tupanGet connections with process IDsRoot/sudoConnections with PIDs and program names
ip -o -4 addr show | awk '{print $2, $4}'Get interface IPsAny userInterface names with IP/netmask

Example Output:

sudo lsof -i -n -P
# → COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
# → sshd 1234 root 3u IPv4 12345 0t0 TCP 192.168.1.100:22->192.168.1.10:54321 (ESTABLISHED)

Virtualization Detection

CommandPurposePermissionsData Collected
docker infoGet Docker informationRoot/sudo or docker groupDocker version, containers, images, storage
virsh list --allGet virtualization informationRoot/sudoVirtual machines, states, IDs

Example Output:

sudo docker info
# → Server Version: 20.10.12
# → Containers: 5
# → Images: 12

sudo virsh list --all
# → Id Name State
# → 1 vm-web01 running

Purpose: Detects containerization and virtualization platforms for infrastructure mapping.


Special Detection Commands

Oracle Database Detection

CommandPurposePermissionsData Collected
which sqlplusCheck if Oracle client installedAny userPath to sqlplus binary
$ORACLE_HOME/bin/sqlplus -VGet Oracle versionOracle user or environmentOracle version string
cat /etc/oratabGet Oracle database instancesRead /etc/oratabOracle SIDs, homes, startup flags

Example Output:

which sqlplus
# → /u01/app/oracle/product/19.3.0/dbhome_1/bin/sqlplus

cat /etc/oratab
# → ORCL:/u01/app/oracle/product/19.3.0/dbhome_1:Y

Purpose: Detects Oracle database installations and configurations for database inventory and license management.


AIX COMMANDS

Basic Commands (Non-Root Access)

These commands can be executed with regular user privileges on IBM AIX systems.

Required Permissions: Regular user account with SSH access Required Roles: No special roles required File Access: Read access to /etc/*, /proc/* (if available)

System Identification

CommandPurposePermissionsData Collected
hostnameGet system hostnameAny userSystem hostname
uname -aGet kernel and system informationAny userAIX version, node name, machine ID
oslevel -sGet AIX service pack levelAny userExact AIX version (e.g., 7200-05-03-2148)
oslevelGet base AIX versionAny userBase OS level (e.g., 7.2.5.0)
uname -MGet hardware modelAny userSystem model (e.g., IBM,9119-MHE)
uname -uGet system serial numberAny userSystem unique ID/serial

Example Output:

hostname
# → aix-prod01

uname -a
# → AIX aix-prod01 3 7 00F9C1354C00

oslevel -s
# → 7200-05-03-2148

uname -M
# → IBM,9119-MHE

Purpose: Identifies AIX system name, version, service pack level, and hardware platform.

Hardware Information

CommandPurposePermissionsData Collected
lsdev -Cc processorList processorsAny userProcessor device names, states
lsattr -El proc0 -a type -a smt_threadsGet CPU detailsAny userProcessor type (POWER9, etc.), SMT threads
svmon -GGet memory usage summaryAny userMemory in pages, used, free
lsattr -El sys0 -a realmemGet total physical memoryAny userReal memory in KB
df -gGet disk space in GBAny userFilesystems, sizes in GB
df -k / | tail -1 | awk '{print $2}'Get root disk size in KBAny userTotal root filesystem size

Example Output:

lsdev -Cc processor
# → proc0 Available 00-00 Processor
# → proc1 Available 00-01 Processor
# → proc2 Available 00-02 Processor
# → proc3 Available 00-03 Processor

lsattr -El proc0 -a type
# → type PowerPC_POWER9 Processor type False

lsattr -El sys0 -a realmem
# → realmem 16777216 Amount of usable physical memory in Kbytes False

df -g
# → Filesystem GB blocks Free %Used Iused %Iused Mounted on
# → /dev/hd4 2.00 1.56 22% 1234 5% /

Purpose: Collects AIX hardware specifications including Power processor details, memory, and disk capacity.

Network Configuration

CommandPurposePermissionsData Collected
ifconfig -aGet network interface informationAny userInterface names, IPs, netmasks, states
ifconfig -a | grep "inet " | awk '{print $2}'Get local IP addressesAny userAll IPv4 addresses
netstat -rnGet routing table / default gatewayAny userRoutes, gateway IPs, flags
netstat -anGet network connectionsAny userTCP/UDP connections, states, addresses

Example Output:

ifconfig -a
# → en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
# → inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255

netstat -rn
# → Routing tables
# → Destination Gateway Flags Refs Use If Exp Groups
# → default 192.168.1.1 UGSc 0 0 en0 - -
# → 192.168.1.0/24 link#2 UCSc 1 0 en0 - -

netstat -an
# → Active Internet connections (including servers)
# → Proto Recv-Q Send-Q Local Address Foreign Address (state)
# → tcp4 0 0 192.168.1.100.22 192.168.1.10.54321 ESTABLISHED

Purpose: Collects AIX network interface configurations, IP addresses, and active connections.

User Accounts

CommandPurposePermissionsData Collected
cat /etc/passwdGet user account informationRead /etc/passwdUsernames, UIDs, home directories
last | head -5Get recent login historyRead /var/adm/wtmpLast 5 user logins

Purpose: Lists AIX user accounts and recent login activity.

Process Information

CommandPurposePermissionsData Collected
ps -efGet running processesAny userPIDs, PPIDs, users, start times, commands
procfiles -n $pidGet process files (if available)Any userOpen files for process
readlink -f /proc/$pid/object/a.outGet process executable pathRead /proc/$pid/*Full path to executable

Example Output:

ps -ef
# → UID PID PPID C STIME TTY TIME CMD
# → root 1 0 0 Jan 08 - 0:45 /etc/init
# → oracle 1234 1 0 14:23 - 1:23 ora_pmon_ORCL

Purpose: Lists running processes on AIX for application inventory and monitoring.

Software Inventory

CommandPurposePermissionsData Collected
lslpp -LcGet installed software filesetsAny userFileset names, levels, states, descriptions

Example Output:

lslpp -Lc
# → #Package Name:Fileset:Level:State:PTF Id:Fix State:Type:Description:Destination Dir
# → bos:bos.rte:7.2.5.0:COMMITTED::COMMITTED:0:Base Operating System Runtime:/
# → xlC:xlC.rte:16.1.0.0:COMMITTED::COMMITTED:0:IBM XL C/C++ Runtime:/usr/lib

Purpose: Inventories installed AIX software packages (filesets) for license and patch management.


Root-Level Commands (Requires Root/Sudo) - AIX

These commands require elevated privileges on AIX systems.

Required Permissions: Root access or sudo privileges Required Roles: root or authorized sudo user File Access: Full system access including hardware devices

Hardware Details

CommandPurposePermissionsData Collected
prtconfGet complete system configurationRoot/sudoAll hardware: CPU, memory, adapters, devices
lsattr -El proc0Get detailed CPU attributesRoot/sudoCPU type, frequency, cache sizes
lsdev -Cc memoryList memory devicesRoot/sudoMemory module information
lspvList physical volumesRoot/sudoDisk volumes, VG assignments, sizes
lsdev -Cc diskList disk devicesRoot/sudoDisk device names, locations, descriptions
lsdev -Cc adapterList adapters (PCI devices)Root/sudoNetwork, storage, and other adapters
lscfg -vpGet VPD (Vital Product Data)Root/sudoHardware serial numbers, part numbers, FRUs
lparstat -iGet LPAR configurationRoot/sudo (LPAR only)Partition name, ID, type, entitled capacity

Example Output:

sudo prtconf
# → System Model: IBM,9119-MHE
# → Machine Serial Number: 12345AB
# → Processor Type: PowerPC_POWER9
# → Processor Implementation Mode: POWER 9
# → Number Of Processors: 4
# → Processor Clock Speed: 3800 MHz
# → CPU Type: 64-bit
# → Kernel Type: 64-bit
# → Memory Size: 16384 MB

sudo lparstat -i
# → Node Name : aix-prod01
# → Partition Name : prod_lpar1
# → Partition Number : 5
# → Type : Shared-SMT-4
# → Mode : Uncapped
# → Entitled Capacity : 2.00
# → Partition Group-ID : 32769
# → Online Virtual CPUs : 4
# → Maximum Virtual CPUs : 8

Purpose: Provides complete AIX hardware configuration including LPAR settings for Power systems.

Storage Details

CommandPurposePermissionsData Collected
lspvList physical volumesRoot/sudoPV names, VG names, states
lsdev -Cc diskList all disk devicesRoot/sudoDisk names, locations, descriptions

Example Output:

sudo lspv
# → hdisk0 00f9c13500000000 rootvg active
# → hdisk1 00f9c13500000001 datavg active

Purpose: Shows AIX disk configuration, volume groups, and physical volume assignments.

Advanced Network Information

CommandPurposePermissionsData Collected
lsdev -Cc ifList network interfacesRoot/sudoInterface device names, descriptions
netstat -anpGet connections with PIDsRoot/sudoConnections with process IDs

Example Output:

sudo lsdev -Cc if
# → en0 Available 03-00 Standard Ethernet Network Interface
# → lo0 Available Loopback Network Interface

Oracle Database Detection (AIX)

CommandPurposePermissionsData Collected
which sqlplusCheck if Oracle client installedAny userPath to sqlplus
$ORACLE_HOME/bin/sqlplus -VGet Oracle versionOracle userOracle version
cat /etc/oratabGet Oracle instancesRead /etc/oratabOracle SIDs and homes

Purpose: Same as Linux - detects Oracle installations on AIX Power systems.


Data Processing and Formatting

Network Connection Analysis

The scanner processes network connection data from ss, netstat (Linux), or netstat -an (AIX) output:

  1. Protocol Detection: Identifies TCP/UDP protocols

  2. State Mapping: Maps connection states to Windows-compatible numeric values:

    • LISTEN → 2 (LISTENING)
    • ESTAB / ESTABLISHED → 5 (ESTABLISHED)
    • TIME-WAIT / TIME_WAIT → 11 (TIME_WAIT)
    • FIN-WAIT-1 / FIN_WAIT1 → 8 (FIN_WAIT_1)
    • FIN-WAIT-2 / FIN_WAIT2 → 9 (FIN_WAIT_2)
    • CLOSE-WAIT / CLOSE_WAIT → 7 (CLOSE_WAIT)
    • SYN-SENT / SYN_SENT → 3 (SYN_SENT)
    • SYN-RECV / SYN_RECV → 4 (SYN_RECEIVED)
    • CLOSING → 10 (CLOSING)
    • LAST-ACK / LAST_ACK → 11 (LAST_ACK)
  3. Process Mapping: Links connections to processes using PID information

  4. Address Resolution: Handles IPv4 and IPv6 addresses, converts wildcards

Data Collected:

  • Local IP address and port
  • Remote IP address and port
  • Connection state (numeric code)
  • Protocol (TCP/UDP)
  • Process ID, name, and full executable path
  • Is local IP (boolean flag)

Software Inventory Processing

The scanner processes package manager output:

  1. Linux Debian/Ubuntu: Parses dpkg -l output
    • Package name, version, architecture, description
  2. Linux Red Hat/CentOS: Parses rpm -qa output
    • Package name with version string
  3. AIX: Parses lslpp -Lc colon-delimited output
    • Fileset name, level, state, description

Standardization: All converted to consistent format:

{
"name": "package-name",
"version": "1.2.3",
"vendor": "IBM|RedHat|Canonical",
"install_date": "2024-01-01",
"install_location": "/usr/bin",
"description": "Package description"
}

Memory Information Extraction

Linux:

  1. Primary: Parses /proc/meminfo for MemTotal in KB
  2. Fallback: Uses free -h output with unit conversion (G/M/K to GB)
  3. Calculation: Converts KB → GB (divide by 1024²)

AIX:

  1. Primary: Uses lsattr -El sys0 -a realmem for total memory in KB
  2. Fallback: Parses svmon -G output
  3. Calculation: Same as Linux (KB → GB)

Output: Consistent memory_gb field (floating point number)

CPU Information Processing

Linux:

  1. Model Name: Extracts from /proc/cpuinfo "model name" field
  2. Core Count: Counts unique physical processor IDs
  3. Details: Additional info from lscpu command

AIX:

  1. Model Name: Extracts from lsattr -El proc0 -a type (e.g., PowerPC_POWER9)
  2. Core Count: Counts processor devices from lsdev -Cc processor
  3. Fallback: Uses prtconf "Number Of Processors"

Output: Consistent cpu_model string and processor_count integer

Disk Information Extraction

Both Linux and AIX:

  1. Parses df -h (Linux) or df -g (AIX) output
  2. Sums total disk space across all filesystems
  3. Handles units: T (terabytes), G (gigabytes), M (megabytes)
  4. Fallback: Uses df -k / for root filesystem size

Output: Consistent disk_gb field (floating point number)


Security and Privacy Considerations

Information Sensitivity

The scanner collects potentially sensitive information that should be protected:

Highly Sensitive Data

  • User Accounts: Complete list of system users with UIDs and home directories
  • Login History: User login times and source IPs
  • Network Connections: Active connections revealing application communication patterns
  • Process Information: Running applications with full command-line arguments (may contain credentials)
  • System Serial Numbers: Hardware identifiers for asset tracking

Moderately Sensitive Data

  • Hardware Configuration: System model, CPU, memory specifications
  • Installed Software: Complete software inventory (license implications)
  • Network Configuration: IP addresses, network topology
  • Oracle Configurations: Database homes and SIDs

Low Sensitivity Data

  • OS Version: Operating system and kernel versions
  • Hostname: System name
  • Disk Space: Filesystem usage statistics

Data Protection Requirements

In Transit:

  • All data transmitted via encrypted SSH protocol (minimum SSHv2)
  • No credentials transmitted in clear text
  • Secure key-based authentication recommended

At Rest:

  • Credentials stored using Windows DPAPI encryption (agent side)
  • Scan results stored in MongoDB with encryption at rest (backend)
  • Access controlled via JWT authentication

Access Controls:

  • Backend API requires authentication tokens
  • Multi-tenant data isolation by department/organization
  • Role-based access control (RBAC) for viewing scan results

Compliance Considerations

GDPR/Privacy:

  • User account data may constitute personal information
  • Login history contains personally identifiable information (PII)
  • Ensure proper consent and data processing agreements

SOX/Financial Compliance:

  • System inventory required for IT general controls
  • Software licensing compliance tracking
  • Change management audit trails

HIPAA/Healthcare:

  • Healthcare systems require additional data protection
  • Audit logging of all access to scan data
  • Encryption requirements for data at rest and in transit

PCI-DSS:

  • Network segmentation verification
  • Security configuration validation
  • Regular system inventory for cardholder data environment
  1. Principle of Least Privilege:

    • Use non-root accounts when possible
    • Only use root/sudo for enhanced discovery when necessary
    • Create dedicated service accounts for scanning
  2. Credential Management:

    • Use SSH key-based authentication instead of passwords
    • Rotate credentials regularly (90 days recommended)
    • Never store credentials in plain text
  3. Access Auditing:

    • Log all SSH access attempts
    • Monitor for unauthorized scan activities
    • Review scan logs regularly
  4. Data Retention:

    • Define retention policies for scan data (e.g., 90 days)
    • Securely delete old scan results
    • Archive historical data if required for compliance
  5. Network Security:

    • Use jump hosts/bastion servers for production systems
    • Implement network segmentation
    • Restrict SSH access to scanner IP addresses via firewall rules

Output Format

All collected data from both Linux and AIX is formatted into a standardized structure compatible with Windows WMI format for unified backend processing:

{
"status": "success",
"timestamp": "2025-01-10T14:30:00.000Z",
"ip_address": "192.168.1.100",
"hostname": "server01.example.com",
"is_root": false,
"auth_method": "password",
"data": {
"hostname": "server01.example.com",
"operating_system": "Ubuntu 20.04.3 LTS",
"model": "Dell PowerEdge R740",
"manufacturer": "Dell Inc.",
"serial_number": "ABC123XYZ",
"memory_gb": 64.0,
"disk_gb": 1024.0,
"cpu_model": "Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz",
"processor_count": 2,
"domain": "",
"users": ["user1", "user2", "admin"],
"network_interfaces": [
{
"name": "eth0",
"interface_name": "eth0",
"interface_description": "",
"interface_type": "physical",
"mac_address": "00:0a:95:9d:68:16",
"connection_name": "eth0",
"speed": 1000,
"ip_addresses": [
{
"ip_address": "192.168.1.100",
"subnet_mask": "24",
"address_family": "IPv4"
}
],
"default_gateway": ["192.168.1.1"],
"dhcp_enabled": false,
"dhcp_server": "",
"dns_servers": []
}
],
"network_connections": [
{
"protocol": "TCP",
"local_address": "192.168.1.100",
"local_port": 22,
"remote_address": "192.168.1.10",
"remote_port": 54321,
"state": 5,
"process_id": 1234,
"process_name": "sshd",
"process_path": "/usr/sbin/sshd",
"is_local_ip": true
}
],
"installed_applications": [
{
"name": "apache2",
"vendor": "Canonical",
"version": "2.4.41-4ubuntu3.8",
"install_date": "",
"install_location": "/usr/sbin",
"description": "Apache HTTP Server"
}
]
}
}

AIX Example Output:

{
"status": "success",
"hostname": "aix-prod01",
"operating_system": "IBM AIX 7200-05-03-2148",
"model": "IBM,9119-MHE",
"manufacturer": "IBM",
"serial_number": "12345AB",
"memory_gb": 16.0,
"disk_gb": 500.0,
"cpu_model": "IBM POWER9",
"processor_count": 4
}

This ensures consistent data structure across Windows (WMI), Linux (SSH), and AIX (SSH) discovery methods for unified CMDB processing.


Command Execution Flow

  1. Connection Establishment: SSH client connects using stored credentials (password or key-based)
  2. OS Detection: Executes uname -s to determine Linux vs AIX
  3. Privilege Detection: Checks if user has root access via id -u (returns "0" for root)
  4. Basic Collection: Executes non-privileged commands based on OS type
  5. Enhanced Collection: Executes root commands if privileges available
  6. Special Detection: Runs Oracle and other service-specific detection
  7. Data Formatting: Converts raw command output to WMI-compatible JSON structure
  8. Result Return: Provides structured data to backend for CMDB processing

Timeout Protection: All commands have execution timeouts (default 30 seconds, configurable):

  • Standard commands: 30 seconds
  • Package inventory: 60 seconds
  • Disk health checks: 120 seconds
  • Hardware inspection: 30-60 seconds

Error Handling:

  • Individual command failures don't stop the scan
  • Partial data collection on errors
  • Fallback methods for critical information
  • Detailed error logging for troubleshooting

Performance Optimization

Performance Mode

Set SSH_PERFORMANCE_MODE=1 to reduce data collection for faster scans:

Command CategoryStandard ModePerformance Mode
CPU infoFull /proc/cpuinfoFirst 50 lines
Process listAll processes200 processes max
Process paths200 top processes50 top processes
Package inventoryAll packages500 packages max
SMART disk checks4 disks2 disks
lsof connections2000 connections500 connections

Environment Variables:

# Enable performance mode
export SSH_PERFORMANCE_MODE=1

# Adjust timeouts
export SSH_COMMAND_TIMEOUT=30
export SSH_MAX_OUTPUT_SIZE=10485760

# Disable expensive operations
export SSH_DISABLE_SMART_INFO=1
export SSH_DISABLE_LSOF=1
export SSH_DISABLE_PROCESS_PATHS=1

Troubleshooting Common Issues

Permission Denied Errors

Symptom: Permission denied when accessing /sys/devices/virtual/dmi/id/*

Solution:

  • These files require root access on some systems
  • Scanner will fall back to dmidecode commands
  • Ensure root/sudo access for complete hardware inventory

Timeout Errors

Symptom: Commands exceed timeout limits

Solution:

  • Enable performance mode: SSH_PERFORMANCE_MODE=1
  • Increase timeout: SSH_COMMAND_TIMEOUT=60
  • Disable slow collectors: SSH_DISABLE_LSOF=1, SSH_DISABLE_SMART_INFO=1

Missing Commands

Symptom: command not found errors for lsof, smartctl, etc.

Solution:

  • Install missing packages (lsof, smartmontools)
  • Scanner has fallback methods for most commands
  • Root-level commands are optional; basic scan will still succeed

AIX-Specific Issues

Symptom: Process paths not collected on AIX

Solution:

  • AIX /proc filesystem may not be mounted
  • Ensure procfs is mounted: mount | grep proc
  • Mount if needed: mount -v procfs /proc