30 Thuật Ngữ Security Mà Developer Cần Biết — Từ Vựng Bảo Mật
Tổng hợp 30 thuật ngữ security mà developer Việt Nam cần biết. Từ vựng bảo mật tiếng Anh có IPA, giải thích dễ hiểu, ví dụ thực tế — từ authentication đến zero-day exploit.
Security không còn là chuyện riêng của team bảo mật — mọi developer đều cần hiểu security. Từ việc viết code an toàn, đọc security audit reports, đến tham gia incident response — bạn sẽ gặp các thuật ngữ bảo mật hàng ngày.
Thực tế phũ phàng: 90% các lỗ hổng bảo mật bắt nguồn từ code của developer, không phải từ hạ tầng. OWASP Top 10, SQL Injection, XSS — những thứ này developer phải biết để phòng tránh từ đầu.
Bài viết này giúp bạn:
Nắm 30 thuật ngữ security quan trọng nhất
Biết cách phát âm chuẩn (IPA) — không còn đọc sai trong meeting
Hiểu ý nghĩa thực tế qua ví dụ code và hệ thống
Phân biệt các khái niệm hay nhầm lẫn
1. Authentication & Authorization — Xác thực & Phân quyền#
Đây là hai khái niệm nền tảng nhất trong security, và cũng hay bị nhầm lẫn nhất:
Thuật ngữ
IPA
Nghĩa tiếng Việt
Giải thích
Authentication (AuthN)
/ɔːˌθɛntɪˈkeɪʃən/
Xác thực
Xác minh bạn là ai — login, mật khẩu, vân tay
Authorization (AuthZ)
/ˌɔːθərəˈzeɪʃən/
Phân quyền
Xác minh bạn được làm gì — role, permission
Multi-Factor Authentication (MFA)
/ˌmʌlti ˈfæktər/
Xác thực đa yếu tố
Kết hợp 2+ phương thức: password + OTP + biometrics
Single Sign-On (SSO)
/ˌsɪŋɡl saɪn ɒn/
Đăng nhập một lần
Login 1 lần, truy cập nhiều hệ thống (Google, Okta)
OAuth 2.0
/əʊˈɔːθ/
Giao thức ủy quyền
Cho phép app truy cập resource thay mặt user
JSON Web Token (JWT)
/dʒɒt/
Token dạng JSON
Token chứa thông tin user, tự xác thực (stateless)
// Authentication — xác thực user
app.post('/login',async(req,res)=>{const{email,password}=req.body;constuser=awaitUser.findByEmail(email);constisValid=awaitbcrypt.compare(password,user.passwordHash);// "Are you really who you claim to be?"
});// Authorization — kiểm tra quyền
app.delete('/api/posts/:id',authorize('admin'),(req,res)=>{// Only admins can delete posts
// "You're logged in, but can you do THIS?"
});
-- ❌ Code dính SQL Injection:
query="SELECT * FROM users WHERE email = '"+userInput+"'"-- Attacker nhập: ' OR '1'='1' --
-- Kết quả: SELECT * FROM users WHERE email = '' OR '1'='1' --'
-- → Trả về TẤT CẢ users!
-- ✅ Fix: Dùng Parameterized Query
query="SELECT * FROM users WHERE email = $1"params=[userInput]
importbcryptimporthashlib# Hashing password — ĐÚNG CÁCHpassword ="mySecurePass123"hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt())# Lưu `hashed` vào DB, KHÔNG BAO GIỜ lưu plaintext password!# Verify passwordis_match = bcrypt.checkpw(password.encode(), hashed)# True# Hashing file — kiểm tra integrityfile_hash = hashlib.sha256(open("app.zip","rb").read()).hexdigest()# So sánh với hash gốc để biết file có bị sửa không
# AWS Security Group — Firewall rulesSecurityGroup:Type:AWS::EC2::SecurityGroupProperties:GroupDescription:"Web server security group"SecurityGroupIngress:- IpProtocol:tcpFromPort:443# HTTPS onlyToPort:443CidrIp:0.0.0.0/0 # Allow from anywhere- IpProtocol:tcpFromPort:22# SSHToPort:22CidrIp:10.0.0.0/8 # Only from internal network ✅# ❌ KHÔNG mở port 22 cho 0.0.0.0/0 (toàn bộ internet)!
# ❌ Sai: Chạy app bằng rootdocker run --user root myapp
# ✅ Đúng: Tạo user riêng với quyền tối thiểudocker run --user appuser:appgroup myapp
# ❌ Sai: IAM policy cho phép tất cả{"Effect": "Allow",
"Action": "*",
"Resource": "*"}# ✅ Đúng: Chỉ cho quyền cần thiết{"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::my-bucket/*"}
# Đoạn code này có bao nhiêu lỗi bảo mật?importospassword ="admin123"# 🔴 Lỗi 1?db_query =f"SELECT * FROM users WHERE name = '{user_input}'"# 🔴 Lỗi 2?os.system(f"ping {host_input}")# 🔴 Lỗi 3?
📝 Đáp án
Hardcoded password — Mật khẩu để trực tiếp trong code → Dùng environment variable
SQL Injection — String interpolation trong query → Dùng parameterized query
Command Injection (RCE) — User input trực tiếp vào os.system → Dùng subprocess với shell=False
Đồng nghiệp submit PR với đoạn code sau. Hãy viết 1 review comment bằng tiếng Anh:
1
2
3
4
5
6
app.post('/api/user',(req,res)=>{consttoken=req.headers.authorization;// No token validation!
db.query(`INSERT INTO users (name) VALUES ('${req.body.name}')`);res.json({success:true});});
📝 Gợi ý
“Two security concerns here:
The authorization token is read but never validated — any request will pass through. We need to verify the JWT before processing.
The SQL query uses string interpolation which is vulnerable to SQL injection. Please use parameterized queries instead.
Both are critical — this should not be merged until fixed.”