EN_Net_DNS_Security - somaz94/DevOps-Engineer GitHub Wiki

Network: DNS & Security

7. What is DNS?

DNS (Domain Name System) is a system used on the internet to convert host names (domain names) into actual IP addresses.

Root DNS Server

The Root DNS Server is one of the most crucial DNS servers on the internet. These servers are distributed globally and act as the top-level DNS servers for all domain names on the internet, forming the foundation of the entire DNS system.

They manage root domain names, which are the highest-level domain names used on the internet. Root domain names are denoted by a period (.) and, for example, the root domain name for www.aaa.com is .com.

Root DNS Servers know the IP addresses of TLD DNS Servers. So, when a user queries a domain name like www.aaa.com, it first asks the Root DNS Server for the location of that domain's TLD DNS Server. The Root DNS Server then returns the IP address of the TLD DNS Server, and the user's DNS query is forwarded to that TLD DNS Server.

In essence, the Root DNS Server is the starting point for all DNS servers on the internet and plays a crucial role in the entire DNS system. These servers are distributed worldwide and managed by ICANN (Internet Corporation for Assigned Names and Numbers).

TLD DNS Server (Top-Level Domain)

TLD DNS Servers manage the top-level domain names (TLDs) used on the internet, like .com, .org, .edu. They process DNS queries for each domain name.

These servers manage the IP addresses and other DNS record information for each TLD. For instance, the TLD DNS Server for .com domain names processes all DNS queries for .com domains. The primary purpose of these queries is to find the IP address associated with a domain name.

TLD DNS Servers also collaborate with domain name registrars to update information about domain names under their TLD. They receive DNS queries from Root DNS Servers, which know their IP addresses and forward queries for domain names under their management. Thus, TLD DNS Servers play a vital role in processing DNS queries for all domain names on the internet. They are distributed globally and managed by domain name registrars and ICANN.

Second-Level DNS Server (Authoritative DNS Server)

Second-Level DNS is a critical component of DNS, providing IP address information for specific domain names.

Typically, these servers refer to the nameservers of domain/hosting companies and serve as the ultimate responders for information about a domain. For example, if there is a DNS server that knows the IP address for aaa.com, it acts as a Second-Level DNS Server.

DNS Records

DNS records are data entries used in the Domain Name System (DNS) to map domain names to their associated IP addresses. They contain information related to domain names and are used by servers performing DNS queries.

There are various types of DNS records. Here are some common examples:

  • A Record: Maps a domain name to an IP address.
  • CNAME Record: Maps a domain name to another domain name.
  • MX Record: Specifies the priority of mail servers associated with a domain name.
  • NS Record: Identifies the authoritative DNS servers for a domain name.
  • TXT Record: Contains text information associated with a domain name.
  • SPF Record: Used to verify email sending authority to prevent spam.
  • SRV Record: Identifies the location of specific services provided by a DNS server.
  • AAAA Record: Maps a domain name to an IPv6 address.
  • SOA Record: Provides basic settings for a domain name.
  • PTR Record: Maps an IP address back to a domain name, used primarily in reverse DNS queries, especially for email servers.

8. Service Mesh vs API Gateway

Service Mesh

Service Mesh is an infrastructure layer for managing communication between services in distributed applications. In a microservices architecture, an application is composed of several small services that communicate with each other to form a cohesive application. Since this inter-service communication happens over a network, an infrastructure to manage it is necessary.

Service Mesh abstracts and manages the communication between these services, essentially aiding in managing the network infrastructure for inter-service communication. It offers functionalities like distributed tracking, security, logging, and load balancing, which help in handling communication between services safely and efficiently.

Implementation of Service Mesh often uses the sidecar pattern, deploying a sidecar container on each service instance and managing communication through it. This container typically consists of a proxy or agent provided by the Service Mesh solution. Popular Service Mesh solutions in Kubernetes environments include Istio and Linkerd.

Key Features of Service Mesh
  • Distributed Tracking: Facilitates rapid response to issues by tracking and analyzing communication between services.
  • Security: Enhances security through traffic encryption, authentication, authorization, and access control.
  • Logging: Logs details of inter-service communication for troubleshooting.
  • Load Balancing: Distributes traffic among multiple service instances, ensuring stable service delivery.

Major Service Mesh solutions include Istio, Linkerd, and Consul, which simplify the implementation and operation of a Service Mesh.

API Gateway

API Gateway serves as a single point of entry in a microservices architecture, exposing multiple backend services as one API. When clients send HTTP requests to the API Gateway, it invokes internal services, processes the results, and returns them to the clients.

Main Features of API Gateway
  • Authentication and Authorization: Verifies client requests and performs user authentication and authorization checks, ensuring secure API access.
  • Load Balancing: Distributes requests across multiple services, improving service availability and load distribution.
  • Caching: Utilizes cache for repetitive requests, reducing the load on backend services.
  • Logging and Monitoring: Records and monitors client requests and service responses, enabling quick response to issues.
  • API Management: Manages APIs and their versions, allowing deployment of new API versions or removal of old ones.

API Gateway is an essential component in microservices architecture, offering various functionalities and flexibility for efficient application management and operation.

Differences between Service Mesh and API Gateway

API Gateway and Service Mesh are both tools for managing communication in distributed applications but differ in their purpose and methods of implementation.

API Gateway acts as a server that mediates communication between clients and backend services. Clients send requests to the backend services via the API Gateway, which performs necessary authentication, authorization, and logging before forwarding these requests. API Gateway provides a unified entry point, simplifying client-to-backend communication and enhancing security and monitoring.

Conversely, Service Mesh manages communication between services within distributed applications. Each service instance has a sidecar container to facilitate inter-service communication. Service Mesh offers functionalities like distributed tracking, security, logging, and load balancing to ensure safe and efficient communication between services.

Thus, API Gateway mediates communication between clients and backend services, managing and protecting externally accessed services. In contrast, Service Mesh handles communication within distributed applications, safeguarding and stabilizing the operation of these applications.


12. IPsec vs SSL/TLS

IPsec (Internet Protocol Security) and SSL (Secure Socket Layer) along with its successor, TLS (Transport Layer Security), are protocols used for securing network communications. Both provide data integrity, confidentiality, and authentication over the Internet, but they operate at different layers of the network stack.

IPsec

  • Function: Suite of protocols for securing Internet Protocol (IP) communications by authenticating and encrypting each IP packet of a communication session.
  • Layer: Operates at the network layer, capable of securing all traffic that passes through it.
  • Modes: Includes transport mode (encrypts only the payload of each packet) and tunnel mode (encrypts the entire packet).
  • Use Cases: Particularly useful for setting up Virtual Private Networks (VPNs) across untrusted networks like the internet.

SSL/TLS

  • Function: Protocols for securing connections between networked computers, widely used for secure communication over the internet.
  • Layer: Operates at the session layer, securing specific applications that are designed to utilize SSL/TLS.
  • Features: Uses encryption algorithms to encrypt data before transmission and uses certificates for authentication.
  • Use Cases: Commonly used to secure credit card transactions, data transfers, and logins on websites.

Differences

  • Operational Layer:
    • IPsec operates at the network layer.
    • SSL/TLS operates at the session layer.
  • Certificate Management:
    • SSL/TLS typically uses a hierarchy of trusted certificate authorities for endpoint authentication.
    • IPsec can use certificates but often uses pre-shared keys or network-level authentication.
  • Setup and Flexibility:
    • SSL/TLS is generally easier to set up per application.
    • IPsec requires more comprehensive setup as it integrates into the network infrastructure.
  • Usage Scenarios:
    • IPsec is favored for VPNs that secure all network traffic.
    • SSL/TLS is preferred for securing specific applications, particularly for web security over HTTPS.
Feature IPsec SSL/TLS
Layer Network (IP layer) Session (Application)
Security Encrypts entire packet Encrypts session data
Usage VPNs, site-to-site Web browsers, specific applications
Authentication Certificates, pre-shared keys Certificates, often from a CA
Configuration Complex, network-level Simpler, application-specific
Encryption Modes Transport and Tunnel Secure channel per session

IPsec VPN vs SSL/TLS VPN

Characteristics IPsec VPN SSL/TLS VPN
Definition Protocol suite that protects Internet protocol communications by encrypting and authenticating all IP packets (TCP/UDP supported) Protocol that encrypts and protects the connection, encrypting only the data portion (TCP/UDP supported)
Encryption Works at the network layer, encrypting all traffic at the IP level and is ideal for full network encryption Operates at the session layer and encrypts at the application level to secure specific applications or services
Protocol IP TCP
Tier Works at the network layer of the OSI model (3 Layer) Works at the session layer of the OSI model (6 Layer)
Ease of Use More complex to set up and manage. Works at network level and requires more comprehensive configuration Easy to use and implement through your browser for standard secure web browsing
Certification Can use certificates, pre-shared keys, or other forms of network-level authentication Primarily uses certificates and keys managed by a trusted certification authority
Distribution Best for full network access, site-to-site VPNs, or entire subnets requiring secure access Ideal for remote access to individual applications or services via the Internet
Flexibility Provides strong security features with less flexibility in client settings More flexible for web-based access and can be used without installing client software using Web SSL VPN
Typical Use Cases Preferred for securing site-to-site connections, often used in corporate environments Commonly used to secure connections to web applications, SaaS products, and other web-based resources
Security Offers strong security at the cost of complexity, covering all data transmitted over the network Provides good security and is easy to set up and manage over an Internet connection, especially for temporary access
Features Requires 2 server devices, requires software installation, can be used as if connected directly to a private network Requires 1 server device, uses only a web browser, connects through SSL portal

Reference

⚠️ **GitHub.com Fallback** ⚠️