Skip to content

Latest commit

 

History

History
98 lines (77 loc) · 7.8 KB

resource-ssl.md

File metadata and controls

98 lines (77 loc) · 7.8 KB

SSL: Understanding Its Functionality

SSL (Secure Socket Layer) is a standard security protocol that establishes a secure connection between a web browser and a web server. SSL ensures that the data transmitted between them remains encrypted and secure. It secures sensitive information such as personal data, login credentials, and credit card numbers, and prevents unauthorized access and data tampering during transmission.

Warning

Although the term SSL is often used interchangeably with Transport Layer Security (TLS), TLS is an updated version of the SSL protocol. TLS has enhanced security measures, and addresses most of SSL vulnerabilities.

How SSL Works

SSL utilizes cryptographic algorithms to encrypt the data during transmission to protect the information from interception.

SSL operates through a process called the SSL Handshake:

  1. Initiation: The client connects to the server, and requests a secure connection.
  2. Authentication: The server presents its SSL certificate (a public key) to the client and validates its identity. For types of SSL certificates, see this section.
  3. Key Exchange: Both parties exchange cryptographic keys to establish a secure session.
    1. The client sends a pre-master secret which is encrypted with the server’s public key.
    2. Both the client and the server use the pre-master secret to generate a shared master key.
    3. The master key is then used by each side to generate their own session key for encryption and decryption.
  4. Encryption: Using the exchanged keys, data transmission between the client and server is encrypted and confidential.

SSL Handshake

Cryptography in SSL

This section explores key elements of SSL security: key length and cryptographic algorithms.

Key Length

Key length, measured in bits, determines the security level. The longer the key, the more secure and complex the encryption becomes. Common key lengths include 128-bit (for most applications) and 256-bit (for added security in sensitive data transmission).

Algorithms

Cryptographic algorithms are mathematical functions used to encrypt and decrypt data. The choice of algorithm determines how secure the communication is against various types of attacks. Common cryptographic algorithms include: • RSA (Rivest-Shamir-Adleman) for key exchange and digital signatures. • DSA (Digital Signature Algorithm) for digital signatures. • ECDH (Elliptic Curve Diffie-Hellman) for efficient key exchange. • ECC (Elliptic Curve Cryptography) for key exchange and digital signatures.

Types of SSL Certificates

Different SSL certificates serve varying security needs:

Certificate Type Purpose Validation Use Case
Domain Validated (DV) Ensures domain ownership Basic validation, often automated through email Blogs, personal websites, small businesses
Organization Validated (OV) Verifies domain ownership and organization Thorough organization details validation Businesses, e-commerce sites for enhanced user trust
Extended Validated (EV) Highest level of validation, emphasizes trust Rigorous validation including legal and physical checks High-profile websites, financial institutions, e-commerce platforms for maximum user confidence
Wildcard Certificates Secures a domain and its subdomains Typically, DV or OV for the main domain, covers subdomains Organizations with multiple subdomains, that need cost-effective security
Multi-Domain (SAN) Secures multiple domains within a single certificate Depends on the type chosen for each domain (DV, OV, EV) Businesses with several websites under different domains
Code Signing Certificates Ensures integrity of software by digitally signing code Verifies publisher's identity and code integrity Software developers and publishers to establish trust in downloaded applications

Obtain an SSL Certificate

To secure your website:

  1. Choose a Certificate Authority (CA): Select a reputable CA, e.g. Let's Encrypt, DigiCert, Sectigo.
  2. Generate a Certificate Signing Request (CSR): Create a CSR on your server, which includes information like your domain name and public key.
  3. Submit CSR to CA: Provide the generated CSR to the chosen CA for validation.
  4. Certificate Issuance: Once validated, the CA issues the SSL certificate (includes a public key and information about your organization).
  5. Install the Certificate: Install the issued certificate on your web server. The installation process varies depending on the server software (e.g. Apache, Nginx, Microsoft IIS). To revoke or renew your SSL certificate, contact your CA.

Note

Let's Encrypt certificates have a short validity period of 90 days.

Benefits and Limitations of SSL

Benefits

  1. Data Encryption: SSL encrypts sensitive information, and makes it more challenging for hackers to intercept and decipher.
  2. Trust and Credibility: SSL displays a padlock icon, and builds user trust in secure connections.
  3. Authentication: SSL certificates verify website identity, and prevent phishing attacks.

Limitations

  1. Mixed Content: Loading insecure elements on a secure page compromises security.
  2. Certificate Expiry: Regularly update and monitor certificates to avoid lapses in security.
  3. SSL Stripping: Implement HSTS to mitigate risks associated with downgrading secure connections.

SL Deployment Best Practices

  1. Use the Latest Protocols: Adopt the latest SSL protocol version for improved security and performance.
  2. Strong Cipher Suites: Choose secure and up-to-date cryptographic algorithms. Prioritize Perfect Forward Secrecy (PFS) algorithms like ECDHE for key exchange.
  3. Key Length Considerations: If you’re using RSA, opt for key lengths of 2048 bits or higher. For ECC (Elliptic Curve Cryptography), consider curves with equivalent strength to RSA keys.
  4. Certificate Management: Ensure SSL certificates are regularly renewed before expiration to avoid service disruptions. Safeguard private keys and use Hardware Security Modules (HSMs) for added security.
  5. Implement HTTP Strict Transport Security (HSTS): Use HSTS headers to instruct browsers to only connect via HTTPS to reduce the risk of man-in-the-middle attacks.
  6. Content Security: Ensure all resources on a secure page are loaded via HTTPS to prevent mixed content issues that can compromise security.
  7. Secure Renegotiation: Mitigate vulnerabilities associated with SSL renegotiation by disabling it, unless necessary.
  8. Security Headers: Implement Content Security Policy (CSP) headers to mitigate risks associated with content injection attacks like XSS (Cross-Site Scripting).
  9. Regular Security Audits: Conduct regular penetration tests to identify and address potential vulnerabilities in your SSL implementation.
  10. Monitoring and Logging: Collect and analyze logs centrally to detect and respond to security incidents promptly.
  11. Disable Deprecated Protocols and Algorithms: Disable deprecated SSL protocols and weak cipher suites to prevent vulnerabilities associated with outdated standards.
  12. Keep Software Updated: Regularly update your web server software and SSL libraries to patch vulnerabilities and stay current with security best practices.
  13. Implement Rate Limiting: Implement rate limits on login pages to defend against brute force attacks.
  14. Compliance with Regulations: Ensure SSL/TLS deployment aligns with regulatory requirements relevant to your industry, such as GDPR or PCI DSS.
  15. Educate Users: Educate users to recognize SSL indicators like padlock icons, which promotes trust in the security of the connection.