A new Flexera Community experience is coming on November 25th. Click here for more information.
This article teaches you how to read and work with the public member functions and attributes provided in the Flexera Software Package System of the Software Vulnerability Manager. This information is essential to understand how to script your custom packages and create advanced package designs that suit your general or more specific use-case needs. After going through this article, you should be able to understand the SPS scripts and modify them in your own advantage.
The functions outlined below are useful as standard functions to log messages, get file names, calculate the Sha1sum (security), extract files from the SPS package to a location and report the number of files within a package. The script contains Public member functions usable in Jscript, PowerShell and VBScript. The examples below show how to integrate them:
server.
It can be defined as the machine where the package is executed and can also be the package itself.
Explanation:
server = Localhost.package
Public member functions:
logMessage ("Hello World")
This will write Hello World to the log.
getFilename (1)
This function will derive the filename from the first file within the SPS package.
getSHA1Sum (1)
Returns the saved SHA1 sum of the first embedded file.
extractFile (1, "C:\\Windows")
Will extract file number 1 to the C:\\Windows\ path on the system
getSHA1Sum ("C\\Windows\testinstaller.exe")
Calculates the SHA1 sum of C\\Windows\testinstaller.exe
numberOfFiles
will return the number of files embedded in a package
LOG SPS.EXE
When creating an SPS file within the CSI console (Step 2 of the SPS Wizard) you can also create a log to s specific file. In order to do this, navigate (using CMD) to the location where the SPS.exe has been created and use the following command :
sps.exe -d debug.txt -v
This will create a custom log that can help you identify errors within the package execution flow script.
SPS SERVER CLASS REFERENCE
Public Member Functions |
|
void |
logMessage (string message) |
string |
getFilename () |
string |
getSHA1Sum (int index) |
void |
extractFile (int index, string destination) |
string |
getSHA1Sum (string path) |
void |
sleep (int millisecs) |
|
|
FastArray |
args |
int |
numberOfFiles |
Additional training video:
“Secunia SPS Training: The Custom Package” is an older video that is still valid, however.
You can use it for mastering custom packages configuration in the current Software Vulnerability Manager and re-use some of its examples in the current SPS system successfully.
on Nov 15, 2018 05:34 PM - edited on Sep 25, 2019 06:30 AM by RDanailov