API Anahtarları ve Denetim Günlüğü Kaydı
Parolalar yerine kapsamları belirlenmiş API anahtarlarıyla programatik erişimi güvenceye alın; Elasticsearch denetim günlüğünü etkinleştirip okuyarak kimin ne yaptığını kanıtlayın.
API Anahtarları ve Denetim Günlüğü Kaydı, CoddyKit'te ücretsiz bir Elasticsearch & Full Text Search Systems dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Elasticsearch & Full Text Search Systems öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Elasticsearch & Full Text Search Systems kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Beyond Passwords
Applications should not authenticate with a human's username and password. Elasticsearch provides API keys: scoped, revocable credentials ideal for services. Pair them with audit logging to track every security-relevant action.
What Is an API Key
An API key is a credential tied to a set of permissions, with an optional expiration. It can be limited to a subset of the creating user's privileges, following the principle of least privilege.
Creating a Key
Use the create API key endpoint. The response includes an id and api_key value shown only once, so store it securely.
POST /_security/api_key
{
"name": "logging-app",
"expiration": "30d"
}Restricting a Key
Attach role_descriptors to limit what the key can do, even if the creating user has more power. Here the key may only read one index.
POST /_security/api_key
{
"name": "reader",
"role_descriptors": {
"ro": {
"indices": [{ "names": ["logs-*"], "privileges": ["read"] }]
}
}
}Using a Key
Send the base64-encoded id:api_key pair in the Authorization header with the ApiKey scheme.
GET /logs-2024/_search
Authorization: ApiKey VnVhQ2ZHY0JDZGJrU...Revoking Keys
Compromised or retired keys are invalidated immediately, without changing any user's password. You can revoke by id, by name, or all keys owned by a user.
DELETE /_security/api_key
{
"name": "logging-app"
}Why Audit Logging
Audit logs answer the compliance question: who did what, when, and from where. They record authentication attempts, access grants and denials, and configuration changes.
Enabling the Audit Log
Audit logging is turned on in elasticsearch.yml. It is disabled by default because it generates significant volume.
xpack.security.audit.enabled: trueFiltering Events
Tune which events are captured with include/exclude lists to avoid drowning in noise. Common choices keep access_denied and authentication_failed while dropping routine reads.
xpack.security.audit.logfile.events.exclude: [ access_granted ]Reading Audit Output
Audit events are written as structured JSON to a dedicated log file. Each line includes the event type, user, client IP, request path, and outcome, making it easy to ship into Kibana for analysis.
Best Practices
Rotate API keys regularly, scope them tightly, store the audit log on durable storage separate from the cluster, and alert on repeated authentication_failed events that may signal an attack.
Quick Check
Test your understanding of API keys.
Recap
You learned to secure access and accountability:
- API keys are scoped, expiring, revocable credentials for applications.
- Use
role_descriptorsto enforce least privilege. - Audit logging records who did what, when, and from where.
- Filter audit events to manage volume and alert on failed authentications.
Sıkça Sorulan Sorular
“API Anahtarları ve Denetim Günlüğü Kaydı” dersi ücretsiz mi?
Evet — “API Anahtarları ve Denetim Günlüğü Kaydı” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Elasticsearch & Full Text Search Systems kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Elasticsearch & Full Text Search Systems kursu toplamda 4 dersten oluşur.
“API Anahtarları ve Denetim Günlüğü Kaydı” dersinde ne öğreneceğim?
Parolalar yerine kapsamları belirlenmiş API anahtarlarıyla programatik erişimi güvenceye alın; Elasticsearch denetim günlüğünü etkinleştirip okuyarak kimin ne yaptığını kanıtlayın. Elasticsearch & Full Text Search Systems ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Elasticsearch & Full Text Search Systems öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Elasticsearch & Full Text Search Systems, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.
“API Anahtarları ve Denetim Günlüğü Kaydı” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Elasticsearch & Full Text Search Systems dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Elasticsearch & Full Text Search Systems dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Kullanıcı Kimlik Doğrulama ve Roller
- Alan ve Belge Düzeyinde Güvenlik
- TLS/SSL ve Ağ Güvenliği
- API Anahtarları ve Denetim Günlüğü Kaydı