Here’s how you can decode an SNMP response from an SRX firewall and retrieve certificate details:
To decode the expiration date of a PKI certificate:
By following these steps, you’ll be able to extract and interpret CA certificate details clearly and effectively.
To query certificate details, you need the correct OIDs from the Juniper-Cert-MIB. These are the most relevant ones:
jnxCertValidFrom
jnxCertValidTo
jnxCertIssuer
jnxCertSerialNumber
Use the SNMP walk command to query these OIDs. You can retrieve data in raw or ASCII-decoded format.
walk
Example Command (ASCII Format):root@test> show snmp mib walk ascii 1.3.6.1.4.1.2636.3.39.1.3.1.1
jnxJsLoadedLocalCertSubject."TWM-CA01" = /C=TW/ST=Taipei/O=TWM/OU=VPNs/CN=b08-34jnxJsLoadedLocalCertSubject."aamw-srx-cert" = /C=US/O=G06KJydQ94z1sAxjTLNair8IhOvBwG3J/OU=SRX/CN=EkQgFGmgXwW4t9UBaM8DMHq8D4xI2xdJIRd3RHHhYB7jJXaDzLayVw==/UID=empty/[email protected]jnxJsLoadedLocalCertSubject."test1" = /CN=JN1262EA9JCAjnxJsLoadedLocalCertExpire."TWM-CA01" = 07 e8 05 02 0a 33 03 00 2b 00 00jnxJsLoadedLocalCertExpire."aamw-srx-cert" = 07 f6 01 12 0f 00 00 00 2b 00 00jnxJsLoadedLocalCertExpire."test1" = 07 ed 02 11 0f 0a 17 00 2b 00 00jnxJsLoadedLocalCertIssuer."TWM-CA01" = C = TW, ST = Taipei, L = TPE, O = TWM, OU = CA, CN = TWM-CA01jnxJsLoadedLocalCertIssuer."aamw-srx-cert" = C = US, O = Juniper Networks Inc, OU = SecIntel, CN = SecIntel (junipersecurity.net), emailAddress = [email protected]jnxJsLoadedLocalCertIssuer."test1" = CN = JN1262EA9JCA
Decoding the above values:
/C=TW/ST=Taipei/O=TWM/OU=VPNs/CN=b08-34
/C=US/O=G06KJydQ94z1sAxjTLNair8IhOvBwG3J/OU=SRX/CN=EkQgFGmgXwW4t9UBaM8DMHq8D4xI2xdJIRd3RHHhYB7jJXaDzLayVw==/UID=empty/[email protected]
/CN=JN1262EA9JCA
07 e8 05 02 0a 33 03 00 2b 00 00
07 f6 01 12 0f 00 00 00 2b 00 00
07 ed 02 11 0f 0a 17 00 2b 00 00
The certificate expiration values are in a hex-string format. Use the following mapping to decode the values into a human-readable date:
07 e8
05
02
0a
33
03
Summary of Decoded Certificate Information
C=TW, ST=Taipei, L=TPE, O=TWM, OU=CA, CN=TWM-CA01
/C=US/O=G06KJydQ94z1sAxjTLNair8IhOvBwG3J/..
C=US, O=Juniper Networks Inc, OU=SecIntel...
CN=JN1262EA9JCA
By following the decoding steps above, you can extract and interpret all relevant certificate information from the MIB walk output.