Tenable Security Center API: File

/file/upload

Methods
POST

Uploads a File.

NOTE: The filename and tailoringFilename fields should contain the value of the same parameter passed back on a */file/upload::POST* if they are provided. The tailoringOriginalFilename field should contain the value of the tailoring file's original name, prior to upload if it is provided.

Request Payload
Expand
1
2
3
4
5
POST /file/upload HTTP/1.1
Host: <destinationHost>[:<destinationPort>]
Origin: http://<formHost>[:<formPort>]
Content-Length: <contentLength>Content-Type: multipart/form-data; boundary=<dataBoundary>...
<dataBoundary>Content-Disposition: form-data; name="Filedata"; filedata="<baseName>"Content-Type: <contentType> <fileData><dataBoundary>...

returnContentis provided

1
2
...
<dataBoundary>Content-Disposition: form-data; name="returnContent"<returnContent>...

contextis provided

1
2
...
<dataBoundary>Content-Disposition: form-data; name="context"<context>...

MAX_FILE_SIZE is specified

1
2
...
<dataBoundary>Content-Disposition: form-data; name="MAX_FILE_SIZE"<maxFileSize>...

Types and values:

  • destinationHost = <string>
  • destinationPort = <number> OPTIONAL (do not provide the preceding colon if not specified)
  • formHost = <string>
  • formPort = <number> OPTIONAL (do not provide the preceding colon if not specified)
  • contentLength = <number>
  • dataBoundary = <string>
  • maxFileSize = <number> (maximum size allowed for an uploaded file; It is best to check this on the client first if possible)
  • fileData = <string>
  • baseName = <string>
  • returnContent = <string> "false" | "true" DEFAULT "false"
  • context = <string> "auditfile" | "tailoringfile"
Example Response
Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
    "type" : "regular",
    "response" : {
        "filename" : "4fk1r0",
        "originalFilename" : "filename.zip",
        "content" : "",
        "context" : [
            {
                "dataStreamName" : "scap_gov.nist_datastream_USGCB-ie8-1.2.3.1.zip"         }
        ],
        "benchmarkName" : "benchmarkname",
        "profileName" : "profilename",
        "version" : "1.2",
        "type" : "" }
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1404308740
}

/file/clear

Methods
POST

Removes the File associated with {filename}.

Request Parameters
Expand
1
2
{
    "filename" : <string>}
Example Response
Expand
1
2
3
4
5
6
7
8
9
{
    "type" : "regular",
    "response" : {
        "filename" : "\/opt\/sc4\/orgs\/26\/tmp\/\/1.1421854135.bEiuob" },
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1404311344
}