Lucene search
K

Nutanix Settings

🗓️ 25 Apr 2022 00:00:00Reported by TenableType 
nessus
 nessus
🔗 www.tenable.com👁 16 Views

Set Nutantix Integration authentication settings to perform authenticated security check

Code
#TRUSTED 26126317cf3553fd0112e54f992103170859c093929175b336b6b948792fb605f5f3ab0c24e197075690b33ae3b30800506c6dc634538c494b1adbf8644b96a017d59b29d316413b08d5ed492697a034bb9cea1bd11336cfb8c4fcd4b9d8e0becca2795bc1a233f9d35454cb7d86c04506670f5b41344c8d497fd58a5ffac33ba32b8e5e44cecd3eab8d50c7b990f6b5c9af95325eb88fc73cb5861b2fbe06c30c4ac80c09249964af7ce65c0f176a1e97de40003b82f4f89dfad2dcb863a80eb20250e1a06f574ea7636c406772d3a6a3417b424efc0b020491c5b2fc0ebc1f08959f9999ec69fd8768c3c9690783cc45d882dea94c6478e1896874dbb961be9acc7ec1015e22aaa040af55e97a3bf43906869d507c46b25e1dc7fcc4e437351615cff9ab2391799884d2da3438a938c671a2cd94dfdaa69118f183313e4685157309289901009c895b4f4ec865e917c8f00751f7beb0960b42c2ddc00482cdf0feb39029aa0d7ef04debda6bd29c04e184a7b69df0b9e6f3d21b475a61cf7f7f18e269126f971bf8e51bded1e01606727cca1080212f2657191b094ccb217f835cba6119d591557e88848542403d93d22a925c8ab528451ac9637703c4e62993a238d167b972522748d99cc8f16a2ea8957fc58eb2bd461d2e74f92c76c12de7ea54cf28980fad61e29d2ffe1a54f593eb77b60aa238d7d182b4130517e954
#TRUST-RSA-SHA256 46f2c7680d131ef8bb6e8eb00a2877c8d1aa4313144aced0b8d5d3160cfa90159cb2e046693eb80bef8f3a7f00f36433fa274ba529e34caf40a62efd735dfff0ca34857f3d4ee375cdc11459b42ef4ca01303e9b7fdc2768b93f4e535805eb495a3dd460e3252ac689f9b70e94c88d719df0ded939bc239069d600564a95835d4497b2b3ce97c4d77af37306ec9b4d0432cb56e6f7d3f34b01089321149a706d9fbe6e2e4c525fdfb2cbb1ad7de38cae0e86a80928fd0ef0481923e6083c5e03bf299002ec52fefe3925c9c7f485e8a35810fbd33fd7b78f82212272e6ce9e5bc646f56c35eff01c34554eabff5cecd4c216475497ced7173d8539186dbf47365500d52973100e2a0e15f4dc2d9ce07008953284d82946e8a76681d69ddab71efd4d9d2ff1dbabe1dadd5533bfac8df48cc92a9ff893d475623e02e29d51968d9a13f4da1bdcf822f1ab3ba252d0ae89858b6572b109940ab278dbd55e6ab9856f2650ad9201958d4db54c0bc02bb21c188791460048827a7d4533e4ec07dcc820ad07d428b3aa811bc838a90b37e1e4a2021c63f4e17bcd8d8dc2e03dd8c7a1c95ec2c18b913e56dc8ef9ccbf0619747a766c6fd8de020e54bab83bb57e3da1ab444015402de0afcf1d983bd8819992505a18df79ff936d1b45b58bcd66e9e1282fb817a50d4803728e7176d59beb1974f6de17757181482afe9c0faf7d1b3d
#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#
# This script is released under one of the Tenable Script Licenses and may not
# be used from within scripts released under another license without the
# authorization from Tenable Network Security, Inc.
#
# @NOGPL@
#
# Revision: 1
#

include('deprecated_nasl_level.inc');
include("compat.inc");

if (description)
{
  script_id(160184);
  script_version("1.4");
  
  script_name(english:"Nutanix Settings");
  script_summary(english:"Set Nutantix Integration authentication settings to perform authenticated security checks");

  script_set_attribute(attribute:"synopsis", value:"This plugin configures the Nutanix Integration.");
  script_set_attribute(attribute:"description", value:"This plugin configures the Nutanix Integration.");
  script_set_attribute(attribute:"solution", value:"n/a");
  script_set_attribute(attribute:"risk_factor", value:"None");
  script_set_attribute(attribute:"cpe", value:"x-cpe:/o:nutanix:pc");
  script_set_attribute(attribute:"plugin_publication_date", value:"2022/04/25");
  script_set_attribute(attribute:"plugin_modification_date", value:"2026/01/13");
  script_set_attribute(attribute:"plugin_type", value:"settings");
  script_end_attributes();

  script_family(english:"Settings");
  script_category(ACT_SETTINGS);
  script_copyright(english:"This script is Copyright (C) 2022-2026 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_add_preference(name:"Nutanix host : ", type:"entry", value:"");
  script_add_preference(name:"Nutanix port : ", type:"entry", value:"9440");
  script_add_preference(name:"Nutanix username : ", type:"entry", value:"");
  script_add_preference(name:"Nutanix password : ", type:"password", value:"");
  script_add_preference(name:"SSL : ", type:"checkbox", value:"yes");
  script_add_preference(name:"Verify SSL Certificate : ", type:"checkbox", value:"no");
  
  script_add_preference(name:"Auto Discover Managed Nutanix Hosts : ", type:"checkbox", value:"yes");
  script_add_preference(name:"Auto Discover Managed Virtual Machines : ", type:"checkbox", value:"yes");

  exit(0);
}

include("nutanix.inc");
include("pam_get_credentials.inc");

var nutanix_prefix = "";
var nutanix_postfix = " : ";
var password;

# Check authenticaton method for nutanix PAM Support
var auth_method = script_get_preference("Nutanix Authentication Method : ");
#set auth_method to username if security center does not have support for PAM 
if (empty_or_null(auth_method))
{
  auth_method = "Username";
}

var host = script_get_preference("Nutanix host : ");
var port = script_get_preference("Nutanix port : ");

var username = script_get_preference("Nutanix username : ");

# Check if using PAM for Nutanix Prism Central Authentication Method
if ("Username" >< auth_method)
{
  password = script_get_preference(nutanix_prefix + "Nutanix password" + nutanix_postfix);

  if (isnull(password))
  {
    password = script_get_preference(nutanix_prefix + "Nutanix Settings[password]:Nutanix password (unsafe!)" + nutanix_postfix);
  }
}
else
{
  var pam_creds = pamcreds::get_creds_from_pam(username:username, prefix:nutanix_prefix, postfix:nutanix_postfix, auth_method:auth_method);
  username = pam_creds.username;
  password = pam_creds.password;
}

var ssl = script_get_preference("SSL : ");
# using `script_get_preference("Verify SSL Certificate : ");` doesn't work here, because
# it may unintentionally pull the value for "Nutanix Settings[checkbox]:PAM Verify SSL Certificate"
# and we have to be able to set them to different things (i.e. verify PAM cert but don't verify Nutanix cert)
var verify = get_preference("Nutanix Settings[checkbox]:Verify SSL Certificate :");

var auto_discovery_hosts = script_get_preference("Auto Discover Managed Nutanix Hosts : ");
var auto_discovery_vms = script_get_preference("Auto Discover Managed Nutanix Virtual Machines : ");

if (!host && !port && !username && !password && !ssl && !verify)
{
  exit(0, "Nutanix settings are not configured.");
}
else if (!host || !port || !username || !password || !ssl || !verify)
{
  exit(0, "One or more Nutanix settings are not configured.");
}

set_kb_item(name:"Host/Nutanix/config/host", value:host);
set_kb_item(name:"Host/Nutanix/config/port", value:port);
set_kb_item(name:"Secret/Nutanix/config/username", value:username);
set_kb_item(name:"Secret/Nutanix/config/password", value:password);
set_kb_item(name:"Host/Nutanix/auth_method", value:auth_method);

if (ssl && "yes" >< ssl)
{
  set_kb_item(name:"Host/Nutanix/config/ssl", value:TRUE);
}
else
{
  set_kb_item(name:"Host/Nutanix/config/ssl", value:FALSE);
}

if (verify && "yes" >< verify)
{
  set_kb_item(name:"Host/Nutanix/config/ssl_verify", value:TRUE);
}
else
{
  set_kb_item(name:"Host/Nutanix/config/ssl_verify", value:FALSE);
}

if (auto_discovery_hosts && "yes" >< auto_discovery_hosts)
{
  set_kb_item(name:"Host/Nutanix/config/auto_discovery_hosts", value:TRUE);
}
else
{
  set_kb_item(name:"Host/Nutanix/config/auto_discovery_hosts", value:FALSE);
}

if (auto_discovery_vms && "yes" >< auto_discovery_vms)
{
  set_kb_item(name:"Host/Nutanix/config/auto_discovery_vms", value:TRUE);
}
else
{
  set_kb_item(name:"Host/Nutanix/config/auto_discovery_vms", value:FALSE);
}

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation