What is authentication vs authorization?
Authentication verifies who you are (login with username/password). Authorization determines what you’re allowed to do (permissions and access control).
What is OAuth 2.0?
OAuth 2.0 is an authorization framework that allows third-party applications to access user resources without sharing passwords. Uses access tokens with limited scope and lifetime.
What is JWT (JSON Web Token)?
JWT is a compact, self-contained token for securely transmitting information between parties. Contains header, payload, and signature. Used for authentication and information exchange.
What is rate limiting?
Rate limiting restricts the number of requests a user can make in a time window. It prevents abuse, DDoS attacks, and ensures fair resource usage. Common algorithms: token bucket, leaky bucket.
What is HTTPS and why is it important?
HTTPS encrypts HTTP traffic using TLS/SSL. It ensures data confidentiality, integrity, and authentication. Prevents eavesdropping, tampering, and man-in-the-middle attacks.
What is SQL injection?
SQL injection is a security vulnerability where attackers insert malicious SQL code through input fields. Prevention: use parameterized queries, input validation, and ORMs.
What is XSS (Cross-Site Scripting)?
XSS allows attackers to inject malicious scripts into web pages viewed by other users. Prevention: sanitize user input, encode output, use Content Security Policy headers.
What is CORS (Cross-Origin Resource Sharing)?
CORS is a security mechanism that controls how web pages from one domain can access resources from another domain. Prevents unauthorized cross-origin requests in browsers.
What is a DDoS attack?
Distributed Denial of Service attack overwhelms a system with traffic from multiple sources, making it unavailable. Mitigation: rate limiting, traffic filtering, CDN, auto-scaling.
What is encryption at rest vs in transit?
At rest: encrypting data stored on disk (databases, files). In transit: encrypting data being transmitted over networks (HTTPS, TLS). Both are needed for comprehensive security.