Skip to main content

Enrolling Cisco ASA for certificates via terminal

This procedure is largely the same as in IOS.


Generate Keys:

ciscoasa(config)# crypto key generate rsa general-keys modulus 1024
INFO: The name for the keys will be:
Keypair generation process begin. Please wait...


Verify keys have been generated:

ciscoasa(config)# show crypto key mypubkey rsa
Key pair was generated at: 14:56:09 UTC Apr 5 2013
Key name:
 Usage: General Purpose Key
 Modulus Size (bits): 1024
 Key Data:

  30819f30 0d06092a 864886f7 0d010101 05000381 8d003081 89028181 00c0a355



Create trustpoint for root CA:

ciscoasa(config)# crypto ca trustpoint ORCA1-CA
ciscoasa(config-ca-trustpoint)# enrollment terminal

ciscoasa(config)# crypto ca authenticate ORCA1-CA
Enter the base 64 encoded CA certificate.
End with the word "quit" on a line by itself
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----

quit

INFO: Certificate has the following attributes:
Fingerprint:     e9fd8a22 e82c13ef 5db781a7 616ad113
Do you accept this certificate? [yes/no]: yes

Trustpoint CA certificate accepted.

% Certificate successfully imported

While IOS shows both MD5 and SHA1 fingerprints, ASA shows only MD5. My certificate template is configured to use SHA1 as hashing algorithm. In order to compare the thumbprints, I had to use an external hashing utility. I used MD5Summer. We need to hash the certificate in .CRT  or binary .CER format (binary DER – Distinguished Encoding Rules - encoded).  




Create truspoint for subordinate CA:

ciscoasa(config)# crypto ca trustpoint IssuingCA-DC1
ciscoasa(config-ca-trustpoint)# enrollment terminal

ciscoasa(config)# crypto ca authenticate IssuingCA-DC1
Enter the base 64 encoded CA certificate.
End with the word "quit" on a line by itself
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
quit

INFO: Certificate has the following attributes:
Fingerprint:     537adc87 22cc6e2b 07fdf2e0 18d8ba8b
Do you accept this certificate? [yes/no]: yes

Certificate validated - Signed by existing trustpoint CA certificate.

Trustpoint CA certificate accepted.

% Certificate successfully imported

Verify the thumbprint:




Verify trustpoints:

ciscoasa# show crypto ca trustpoints

Trustpoint ORCA1-CA:
    Subject Name:
    cn=ORCA1-CA
          Serial Number: 37a15821a55dd2864b62a67b6efd5429
    Certificate configured.

Trustpoint IssuingCA-DC1:
    Subject Name:
    cn=IssuingCA-DC1
    dc=kp
    dc=local
          Serial Number: 4d00000002924dec093140270b000000000002
    Certificate configured.



Generate Certificate Signing Request (CSR):

ciscoasa(config)# crypto ca enroll IssuingCA-DC1

Would you like to continue with this enrollment? [yes/no]: yes
% Start certificate enrollment ..

% The fully-qualified domain name in the certificate will be: ciscoasa

% Include the device serial number in the subject name? [yes/no]: yes

% The serial number in the certificate will be: 123456789AB

Display Certificate Request to terminal? [yes/no]: yes
Certificate Request follows:
-----BEGIN CERTIFICATE REQUEST-----
-----END CERTIFICATE REQUEST-----

Redisplay enrollment request? [yes/no]: no


Sign the request:

C:\> certreq -submit -attrib CertificateTemplate:RouterCert .\asa1.csr asa1.pem

Import certificate:

ciscoasa(config)# crypto ca import IssuingCA-DC1 certificate


Verify certificates:

ciscoasa# show crypto ca certificates

Certificate
  Status: Available
  Certificate Serial Number: 6d00000040400187689d214e1e000000000040
  Certificate Usage: General Purpose
  Public Key Type: RSA (1024 bits)
  Signature Algorithm: SHA1 with RSA Encryption
  Issuer Name:
    cn=IssuingCA-DC1
    dc=kp
    dc=local
  Subject Name:
    hostname=ciscoasa
    serialNumber=123456789AB
  CRL Distribution Points:
    [1]  http://dc1.kp.local/pki/IssuingCA-DC1.crl
  Validity Date:
    start date: 15:35:33 UTC Apr 5 2013
    end   date: 12:54:58 UTC Mar 14 2014
  Associated Trustpoints: IssuingCA-DC1

CA Certificate
  Status: Available
  Certificate Serial Number: 4d00000002924dec093140270b000000000002
  Certificate Usage: Signature
  Public Key Type: RSA (2048 bits)
  Signature Algorithm: SHA1 with RSA Encryption
  Issuer Name:
    cn=ORCA1-CA
  Subject Name:
    cn=IssuingCA-DC1
    dc=kp
    dc=local
  CRL Distribution Points:
    [1]  http://dc1.kp.local/ORCA1-CA.crl
  Validity Date:
    start date: 12:44:58 UTC Mar 14 2013
    end   date: 12:54:58 UTC Mar 14 2014
  Associated Trustpoints: IssuingCA-DC1

CA Certificate
  Status: Available
  Certificate Serial Number: 37a15821a55dd2864b62a67b6efd5429
  Certificate Usage: Signature
  Public Key Type: RSA (2048 bits)
  Signature Algorithm: SHA1 with RSA Encryption
  Issuer Name:
    cn=ORCA1-CA
  Subject Name:
    cn=ORCA1-CA
  Validity Date:
    start date: 15:03:12 UTC Mar 13 2013
    end   date: 15:13:12 UTC Mar 13 2023
  Associated Trustpoints: ORCA1-CA



Comments

Popular posts from this blog

x.509 Certificates - Critical vs non-critical extensions

Extensions are used to associate additional information with the user or the key.  Each certificate extension has three attributes - extnID, critical, extnValue extnID - Extension ID - an OID that specifies the format and definitions of the extension critical - Critical flag - Boolean value extnValue - Extension value  Criticality flag specifies whether the information in an extension is important. If an application doesn't recognize the extension marked as critical, the certificate cannot be accepted. If an extension is not marked as critical (critical value False) it can be ignored by an application. In Windows, critical extensions are marked with a yellow exclamation mark,  View certificate extensions using OpenSSL: # openssl x509 -inform pem -in cert.pem -text -noout (output abbreviated)         X509v3 extensions:             X509v3 Key Usage: critical                 Digital Signature, Key Encipherment             X509v3 Subject Key Identifier

DNS response and error types

In this post we explore common DNS response codes. We will cover the following responses: NOERROR SERVFAIL NXDOMAIN NODATA REFUSED Throughout article we’ll refer to the following RFCs: RFC 1034 - DOMAIN NAMES - CONCEPTS AND FACILITIES RFC 2308 - Negative Caching of DNS Queries (DNS NCACHE) RFC 2136 - Dynamic Updates in the Domain Name System (DNS UPDATE) RFC 8914 - Extended DNS Errors Response Codes - RCODEs The DNS RCODES are best defined in RFC2316 .  They signify what type of response was sent by the server. “RCODE   Response code - this four bit field is undefined in requests and set in responses.”   The table below shows the summary of the currently defined RCODEs. Mnemonic Val Description NOERROR 0 No error condition.

DNS blocking in Indonesia

DNS based censorship and domain blocking in Indonesia is very inconsistent among ISPs. There’s a government mandated black list which the ISPs operating in the country should enforce. However, Indonesia lacks centralised internet infrastructure and has many separate ISPs. In addition, the Indonesian government granted ISPs the authority to block content at their own discretion. All of this leads to a very inconsistent DNS blocking in Indonesia. Official DNS domain blacklist in Indonesia The Government mandated DNS blacklist is published in a redacted form and can be downloaded here: https://trustpositif.kominfo.go.id/ . This is where the blocked domains get redirected to. We can search the database and check if a domain is blocked. In the screenshot below we can see that a popular cryptocurrency exchange is blocked (Ada) and that wikipedia.org is not (Tidak Ada) - thanks to Google Translate. Examples of blocked DNS queries dig binance.com @182.253.45.122 ;; global options: +cmd ;; Got