Generate server certificate signing request: Request

Prev Next

To generate a new custom server certificate signing request and private key, send the following request:

POST https://<IA_IP_address>:<port_number>/config/v1/x509/server/csr

Note

To use this request, your user account must have sudo access.

Required headers:

Cookie: px=<token>
X-Username: <user>
X-Role: <role>
Content type: application/json

Request body:

{
  "key": {
    "size": int
  },
  "certificate": {
    "country": country,
     "stateOrProvince": "stateOrProvince",
     "locality": "locality",
     "org": {
       "name": "OrgName",
       "unit": "OrgUnit"
     },
     "cn": "CommonName",
     "email": "emailAddress"
   }
}

Options

  • IA_IP_address—The IP address of the NDR appliance running the NDR API.

  • port_number—The port number of the NDR appliance running the NDR API.

  • token—This token authenticates the session. By default, the session times out after 24 hours.

  • user—The user ID.

  • role—The user's role.

  • Content type—Response should be in JSON.

Example

POST https://xxx.xxx.xxx.xxx:443/config/v1/x509/server/csr

Required headers:

Cookie: px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-Username: wheel
X-Role: wheel

Request body:

{
 "key": {
   "size": int
 },
 "certificate": {
   "country": US,
    "stateOrProvince": "Virginia",
    "locality": "Reston",
    "org": {
      "name": "FireEye",
      "unit": "Enterprise Forensics"
    },
    "cn": "localhost",
    "email": "support@fireeye.com"
  }
}

Generate server certificate signing request: Response

HTTP/1.1 [Response Code] [Response Message]				
Server: [Server]
Date: [Date]				
Content-Type: [Content Type]
Content-Disposition: inline; filename="client.csr"
-----BEGIN CERTIFICATE REQUEST-----
<cert-request>
-----END CERTIFICATE REQUEST-----
Response fields
  • Response code—A standard HTTP response code.

    • 200—Request successful; the configuration was successful.

  • Response message—A standard HTTP response message.

    • OK—Request successful; the configuration was successful.

  • Server—The server being used.

  • Date—Standard HTML date format.

  • Content type—The response format.

Example
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 16 Aug 2019 11:31:52 GMT
Content-Type: application/pkcs10
Content-Disposition: inline; filename="client.csr"
-----BEGIN CERTIFICATE REQUEST-----
MIIBwTCCASoCAQAwgYAxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJWQTEPMA0GA1UE
BwwGUmVzdG9uMRAwDgYDVQQKDAdGaXJlRXllMQswCQYDVQQLDAJFRjELMAkGA1UE
AwwCbWUxJzAlBgkqhkiG9w0BCQEWGHJvYmVydC5wZXJyeUBmaXJlZXllLmNvbTCB
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwHCCG7pxq03daKNeq6ujAr5PsxNq
fkkvd7QFH2mK3h3AJcMIhcVdGjDTxGR7DoLSXLYrRIoYy+LbPKkF7o36M9T5TTbw
3j3F2wSJHXCDvXTp2BdUUTxM47a8Z57PFz2Kmv8iaMbV40LphZnLnlnqa/IsKQ0J
JUOH6Eh1PffY7YsCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4GBAKho8kazj0DEQiGp
iK7osJXaDNEDJwP3h/NrDgz4HkewdYnWfpbnrHy0a4w8n22FRfI4K2KVZ8fy0e2f
zWwU0urNz5Q9MkbVGRwnx8BsNkecurMfW2jnChvwLUL5rZEptlUE3/zz756iKwyo
XxLbG8Qxi3MkO7110CjPQcMfEyqL
-----END CERTIFICATE REQUEST-----

cURL code sample: Generate server certificate signing request

curl http://localhost:8085/config/v1/x509/server/csr
-H "X-Username: wheel" 
-H "X-Role: wheel" 
-X POST \
-H "Content-Type: application/json" 
-d '{
  "key": {
    "size": 2048
  },
  "certificate": {
    "country": "US",
    "stateOrProvince": "Virginia",
    "locality": "Reston",
    "org": {
      "name": "FireEye",
      "unit": "Enterprise Forensics"
    },
    "cn": "localhost",
    "email": "support@fireeye.com"
  }
}'

This cURL sample includes the following options:

  • -X POST—Specifies using the POST method.

  • --cookie "px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"—This option specifies the authentication token for this session.

  • -H "Content-Type: application/json"—Specifies that the response should be in JSON.

  • -H "X-Username: wheel"—User name.

  • -H "X-Role: wheel"—User role.

  • https://xxx.xxx.xxx.xxx:443/config/v1/x509/server/csr—The certificate signing request URL. Replace xxx.xxx.xxx.xxx with the IP address of your NDR appliance.

  • -d '{<requestBody>}'—Specifies the request body.

Results

This example generates a custom server certificate signing request.