Denetim olayları
Başlıklar ve tablolar Türkçe; açıklamalar koddan üretildiği için İngilizce.
Audit'e yazılan her aksiyon bir olaydır. Veritabanında tutulur (Yönetim → Denetim Logları, CSV dışa aktarma) ve LOG_INCLUDE_AUDIT=true ile (varsayılan) stdout'a tek satır olarak yazılır; böylece aynı alanlar hem arayüzde hem log platformunuzda filtrelenebilir. ECS adları LOG_FORMAT=ecs ile geçerlidir; json düz adları kullanır.
Okumalar da audit'e yazılır (deployment.list, pod.get, pod.logs), reddedilenler dahil. Arayüzün kendi kendine yenilediği listeler yazılmaz (X-OpenConsole-Refresh: auto gönderirler); HTTP istek logunda yine her istek vardır. API anahtarıyla bu header yok sayılır: her okuma audit'e yazılır.
Alanlar
| Alan | ECS | Anlamı |
|---|---|---|
event | event.action | The action, <resource type>.<verb>: deployment.restart, secret.reveal, user.login. |
verb | openconsole.verb | What was done (see Verbs below). |
outcome | openconsole.outcome | How it ended (see Outcomes below). In ECS also event.outcome: success or failure. |
reason | event.reason | Why it was denied or failed: forbidden, feature_disabled, admin_only, api_access_policy, k8s_forbidden, not_found, conflict, invalid, bad_password, … |
user | user.name | Who: the signed-in user (for a failed sign-in, the name typed). |
auth_source | openconsole.auth_source | Where the account signs in: local, ldap or azure. |
cluster | openconsole.cluster | The cluster the action targeted. Empty for actions that don't run on a cluster (sign-ins, users, roles, settings, saved views). A permission grant records the grant's cluster (empty = all clusters). |
cluster_id | openconsole.cluster_id | The id of that cluster. |
namespace | openconsole.namespace | The target's namespace. |
resource_type | openconsole.resource_type | Singular resource type: deployment, pod, user, api_key, … |
resource_name | openconsole.resource_name | The target's name; * for a list. |
request_id | http.request.id | Same as the http.request log line of the request, and the X-Request-Id response header. |
remote_ip | source.ip | Client address: the first X-Forwarded-For entry, else X-Real-Ip, else the connection's address. |
user_agent | user_agent.original | The client's User-Agent. |
api_key_id | openconsole.api_key.id | The API key the action was taken with; empty for a web session. |
api_key_name | openconsole.api_key.name | That key's name. |
Aksiyonlar
Aksiyon <resource type>.<verb> biçimindedir. Handler'ların kodundan okunur; her aksiyon, bitebileceği bütün sonuçlarla listelenir. <resource>, kontrolün yapıldığı herhangi bir Kubernetes kaynak türünün yerine geçer (pod, deployment, …).
| Aksiyon | Sonuçlar |
|---|---|
<resource>.apply | success, denied, failed, rate_limited |
<resource>.get | denied |
<resource>.list | denied |
api_key.create | success, denied, failed |
api_key.delete | success, denied, failed |
api_key.export | success, denied, failed |
api_key.get | success, denied |
api_key.list | success, denied, failed |
api_key.regenerate | success, denied, failed |
api_key.revoke | success, denied, failed |
api_key.update | success, denied, failed |
api_key.use | denied, rate_limited |
backup.create | success, failed |
backup.download | success, denied, failed |
cluster.activate | success |
cluster.create | success |
cluster.deactivate | success |
cluster.delete | success |
cluster.select | success, denied, failed |
cluster.update | success |
cluster.use | denied |
cluster.view_overview | success, denied, failed |
configmap.get | success, denied |
configmap.list | success, denied |
cronjob.get | success, denied |
cronjob.list | success, denied |
daemonset.get | success, denied |
daemonset.list | success, denied |
deployment.get | success, denied |
deployment.list | success, denied |
deployment.logs | success, denied, rate_limited |
deployment.restart | success, denied, failed, rate_limited |
deployment.scale | success, denied, failed, rate_limited |
group.create | success, denied, failed |
group.delete | success, denied, failed |
group.export | success |
group.update | success, denied, failed |
hpa.get | success, denied |
hpa.list | success, denied |
ingress.get | success, denied |
ingress.list | success, denied |
job.get | success, denied |
job.list | success, denied |
job.logs | success, denied, rate_limited |
namespace.get | success |
namespace.list | success |
node.get | success, denied, failed |
node.list | success, denied, failed |
permission.create | success, denied, failed |
permission.delete | success, denied, failed |
pod.exec | success, denied, failed, rate_limited |
pod.get | success, denied |
pod.list | success, denied |
pod.logs | success, denied, failed, rate_limited |
recording.create | success, failed |
recording.delete | success, denied, failed |
recording.download | success, denied, failed |
recording.evict | success |
recording.purge | success |
recording.view | success, denied, failed |
role.create | success, denied, failed |
role.delete | success, denied, failed |
role.update | success, denied, failed |
saved_view.create | success, denied |
saved_view.delete | success, denied |
saved_view.share | success, denied |
secret.get | success, denied |
secret.list | success, denied |
secret.reveal | success, denied, failed |
secret.view_yaml | success, denied, failed |
service.get | success, denied |
service.list | success, denied |
session.revoke | success |
settings.delete | success, denied, failed |
settings.update | success, denied, failed |
statefulset.get | success, denied |
statefulset.list | success, denied |
statefulset.scale | success, denied, failed, rate_limited |
user.change_password | success, denied |
user.create | success, denied, failed |
user.delete | success, denied, failed |
user.export | success |
user.get | success, failed |
user.import | success |
user.login | success, failed, locked |
user.reset_password | success, denied, failed |
user.update | success, denied, failed |
İşlem türleri
| İşlem türü | Anlamı |
|---|---|
list | listed (* as the name) |
get | read one object |
logs | read or followed logs |
exec | opened a shell (phase start / end) or ran one command (mode command) |
restart | rolling restart |
scale | changed the replica count |
apply | applied YAML (dry_run true for the dry run) |
view_yaml | opened the YAML (for a Secret: the editor, which shows the values) |
reveal | revealed one Secret value |
view | played a session recording |
download | downloaded a session recording |
create | created |
update | changed |
delete | deleted |
share | shared or unshared a saved view |
select | picked a cluster to work on |
activate | made a cluster the default |
deactivate | deactivated |
revoke | revoked a session or an API key |
export | exported a CSV |
import | imported users from LDAP |
login | signed in |
change_password | changed one's own password |
reset_password | an admin set a new password for a local user |
evict | deleted a recording to stay within the disk quota |
purge | deleted recordings past their retention |
view_overview | opened the admin overview |
regenerate | replaced an API key's secret |
use | presented an API key, or worked on a cluster named per request (X-OpenConsole-Cluster; recorded only when it was refused or rate limited) |
Sonuçlar
| Sonuç | Anlamı |
|---|---|
success | done |
denied | refused by OpenConsole: permission, feature flag, API key policy, admin only |
failed | allowed, but it didn't work: Kubernetes refused it, not found, conflict, bad password |
rate_limited | too many at once: open shells per user, API key requests per second |
locked | sign-in refused while the account is locked after failed attempts |
Ayrıntılar
Türü belli, sabit bir anahtar kümesi; her biri log satırında ayrı bir alandır. Hiçbir zaman secret değeri, YAML gövdesi, parola ya da token taşımaz. Tür, deploy/elk içindeki Elasticsearch türüdür.
| Anahtar | Tür | ECS | Anlamı |
|---|---|---|---|
account_source | keyword | openconsole.account_source | user.*: the target account's source |
admin_scope | boolean | openconsole.admin_scope | api_key.*: the key holds the Admin API scope |
all | boolean | openconsole.all | session.revoke, api_key.revoke: every one of the user's |
api_access | keyword | openconsole.api_access | role.update, user.update: API access mode (off, safe_read, full, roles) |
auto_provisioned | boolean | openconsole.auto_provisioned | user.create: created on first LDAP sign-in |
by_admin | boolean | openconsole.by_admin | api_key.revoke: an admin revoked another user's key |
bytes_in | long | openconsole.bytes_in | pod.exec shell end: bytes typed |
bytes_out | long | openconsole.bytes_out | pod.exec: bytes of output |
changed | keyword | openconsole.changed | *.update: names of the fields changed, never their values |
command | keyword | openconsole.command | pod.exec shell: the shell started (/bin/sh, …) |
comment | text | openconsole.comment | api_key.revoke: the admin's reason |
container | keyword | openconsole.container | pod.exec, pod.logs, recording.create: the container |
count | long | openconsole.count | *.export, *.list of API keys, user.import, recording.purge, api_key.revoke all: how many |
dry_run | boolean | openconsole.dry_run | *.apply: true for the server-side dry run |
duration_ms | long | openconsole.duration_ms | pod.exec, recording.create: how long it ran |
error | text | error.message | failed events: the error message (in ECS error.message) |
exit_code | long | openconsole.exit_code | pod.exec: the exit code |
expires_at | date | openconsole.expires_at | api_key.*: expiry |
grant | keyword | openconsole.grant | permission.*: resource:action |
groups | long | openconsole.groups | user.*, user.import: number of groups |
id | long | openconsole.id | api_key.*, permission.*, recording.delete: the id |
is_active | boolean | openconsole.is_active | user.update: active after the change |
is_admin | boolean | openconsole.is_admin | user.*: admin after the change |
key | keyword | openconsole.key | secret.reveal: the key name (never the value) |
linked_by | keyword | openconsole.linked_by | user.login with Azure AD: the claim a pre-created account was matched by (UPN or e-mail) |
login_method | keyword | openconsole.login_method | user.login: local, ldap or azure |
max_sessions | long | openconsole.max_sessions | pod.exec rate limited: the per-user limit |
mode | keyword | openconsole.mode | pod.exec: command for one command over the API |
must_change | boolean | openconsole.must_change | user.reset_password: the user must choose a new password |
owner | keyword | openconsole.owner | recording.evict, saved_view.*, api_key.revoke by an admin: whose it is |
phase | keyword | openconsole.phase | pod.exec shell: start or end |
pod | keyword | openconsole.pod | recording.create, recording.evict: the pod of the shell |
pods | long | openconsole.pods | deployment.logs, job.logs: how many pods the stream follows |
previous | boolean | openconsole.previous | pod.logs: logs of the previous (crashed) container |
program | keyword | openconsole.program | pod.exec command: the program only (first element), never the arguments |
recording_id | keyword | openconsole.recording_id | pod.exec command: the session recording's id |
replicas_from | long | openconsole.replicas_from | *.scale: replicas before |
replicas_to | long | openconsole.replicas_to | *.scale: replicas requested |
restarted_at | date | openconsole.restarted_at | deployment.restart: the time written to the pod template |
retention_days | long | openconsole.retention_days | recording.purge: the retention applied |
role | keyword | openconsole.role | permission.*: the role |
session_id | keyword | openconsole.session_id | session.revoke: the sign-in session revoked |
shared | boolean | openconsole.shared | saved_view.*: shared with everyone |
signed_in_as | keyword | openconsole.signed_in_as | user.login with Azure AD: the name the user signed in with |
size_bytes | long | openconsole.size_bytes | recording.*: file size (recording.purge: bytes freed) |
started_at | date | openconsole.started_at | recording.evict: when the recorded session started |
summary | text | openconsole.summary | settings.update, api_key.*, user.import: a short summary of what was set |
truncate_reason | keyword | openconsole.truncate_reason | pod.exec end: why the recording stopped early (size cap, disk quota) |
yaml_from | keyword | openconsole.yaml_from | *.apply: sha256 prefix of the object before (never the YAML) |
yaml_to | keyword | openconsole.yaml_to | *.apply: sha256 prefix of the YAML applied |