795 lines
22 KiB
Python
795 lines
22 KiB
Python
"""Таблица операций учений «Компрометация worker» (лаба 7, трек 1; правила —
|
||
infra/AGENTS.md, «Трек 1»).
|
||
|
||
Строка — одна операция материалами worker: канал, что делается, исход,
|
||
которого ждут на стенде «до» (её лаба 6, `3e8493b`) и «после» (рабочее
|
||
дерево), где лежит то, чего она касается, и основание доступной «после»
|
||
операции. Исход: `ok`, `denied:<код>` или `n/a` (канала на стенде нет). Отказ —
|
||
только тот код, который строка ждёт: любая другая ошибка запрета не доказывает.
|
||
|
||
Ожидания «после» записаны здесь руками, а не выведены из источников прав: их
|
||
сверяет с `src/db_roles.py`, `infra/rabbitmq/start.sh`,
|
||
`infra/openbao/policies/worker.hcl` и политикой S3 `infra/s3/bootstrap.sh`
|
||
быстрый тест `student-tests/unit/test_track1.py`. Исполняет таблицу
|
||
`probe.py` внутри контейнера worker. Только stdlib, синтаксис Python 3.9.
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from typing import NamedTuple
|
||
|
||
OK = "ok"
|
||
NA = "n/a"
|
||
|
||
# основание доступной «после» строки: нужна коду worker либо остаточный риск
|
||
CODE = "code"
|
||
RESIDUAL = "residual"
|
||
|
||
# OWN — таблицы конвейера, staging / attachments своей базы, своя очередь, два
|
||
# своих пути OpenBao; PROCESS — сам контейнер worker и его сеть; OUTSIDE —
|
||
# остальное: доступных «после» строк там быть не должно (H1)
|
||
OWN = "own"
|
||
PROCESS = "process"
|
||
OUTSIDE = "outside"
|
||
|
||
|
||
class Op(NamedTuple):
|
||
"""Строка таблицы. `args` — параметры исполнителя вида `kind`; `{db}`,
|
||
`{att}`, `{other}` … подставляет пробник. `why` — `(CODE | RESIDUAL,
|
||
чем)` у доступной «после»."""
|
||
|
||
id: str
|
||
channel: str
|
||
title: str
|
||
kind: str
|
||
args: dict
|
||
before: str
|
||
after: str
|
||
scope: str = OUTSIDE
|
||
why: tuple = ()
|
||
|
||
|
||
def denied(code: str) -> str:
|
||
return f"denied:{code}"
|
||
|
||
|
||
# --------------------------------------------------------------- PostgreSQL
|
||
|
||
INSUFFICIENT = denied("42501")
|
||
CHECK = denied("23514")
|
||
PIPELINE_TABLES = ("attachments", "attachment_jobs", "attachment_variants")
|
||
PG_TABLES = (
|
||
"users",
|
||
"sessions",
|
||
"chats",
|
||
"chat_members",
|
||
"messages",
|
||
"message_attachments",
|
||
"idempotency_keys",
|
||
"attachments",
|
||
"attachment_jobs",
|
||
"attachment_variants",
|
||
"attachment_job_replays",
|
||
)
|
||
# что доступно роли worker «после» (сверяет test_track1.py с db_roles.MATRIX)
|
||
PG_SELECT = PIPELINE_TABLES
|
||
PG_INSERT = ("attachment_variants",)
|
||
PG_DELETE: tuple = ()
|
||
PG_UPDATE = {
|
||
"attachments": ("status", "error_code", "updated_at"),
|
||
"attachment_jobs": (
|
||
"state",
|
||
"lease_until",
|
||
"published_at",
|
||
"next_attempt_at",
|
||
"last_error",
|
||
"updated_at",
|
||
),
|
||
}
|
||
# колонка каждой таблицы, которой worker не пишет
|
||
PG_FOREIGN_COLUMN = {
|
||
"users": "password_hash",
|
||
"sessions": "expires_at",
|
||
"chats": "title",
|
||
"chat_members": "position",
|
||
"messages": "text",
|
||
"message_attachments": "position",
|
||
"idempotency_keys": "message_id",
|
||
"attachments": "staging_key",
|
||
"attachment_jobs": "attempt",
|
||
"attachment_variants": "object_key",
|
||
"attachment_job_replays": "operator",
|
||
}
|
||
PG_WHY = {
|
||
"select": (CODE, "claim, finish: src/storage/pipeline.py"),
|
||
"insert": (CODE, "finish_job: variant rows"),
|
||
"update": (CODE, "claim, retry, fail, finish"),
|
||
}
|
||
|
||
|
||
def _priv(name: str, title: str, sql: str, after: str, scope: str, why=()) -> Op:
|
||
return Op(
|
||
f"pg.{name}",
|
||
"PostgreSQL",
|
||
title,
|
||
"pg_priv",
|
||
{"sql": sql},
|
||
OK,
|
||
after,
|
||
scope,
|
||
why,
|
||
)
|
||
|
||
|
||
def _pg_rows() -> list:
|
||
rows = []
|
||
for table in PG_TABLES:
|
||
scope = OWN if table in PIPELINE_TABLES else OUTSIDE
|
||
allowed = table in PG_SELECT
|
||
rows.append(
|
||
_priv(
|
||
f"select.{table}",
|
||
f"SELECT {table}",
|
||
f"SELECT count(*) FROM {table}",
|
||
OK if allowed else INSUFFICIENT,
|
||
scope,
|
||
PG_WHY["select"] if allowed else (),
|
||
)
|
||
)
|
||
allowed = table in PG_INSERT
|
||
rows.append(
|
||
_priv(
|
||
f"insert.{table}",
|
||
f"INSERT {table}",
|
||
f"INSERT INTO {table} DEFAULT VALUES",
|
||
OK if allowed else INSUFFICIENT,
|
||
scope,
|
||
PG_WHY["insert"] if allowed else (),
|
||
)
|
||
)
|
||
for column in PG_UPDATE.get(table, ())[:1] + (PG_FOREIGN_COLUMN[table],):
|
||
allowed = column in PG_UPDATE.get(table, ())
|
||
rows.append(
|
||
_priv(
|
||
f"update.{table}.{column}",
|
||
f"UPDATE {table}.{column}",
|
||
f"UPDATE {table} SET {column} = {column} WHERE false",
|
||
OK if allowed else INSUFFICIENT,
|
||
scope,
|
||
PG_WHY["update"] if allowed else (),
|
||
)
|
||
)
|
||
rows.append(
|
||
_priv(
|
||
f"delete.{table}",
|
||
f"DELETE {table}",
|
||
f"DELETE FROM {table} WHERE false",
|
||
INSUFFICIENT,
|
||
scope,
|
||
)
|
||
)
|
||
server = (
|
||
("ddl.create", "CREATE TABLE", "CREATE TABLE track1_probe (x int)"),
|
||
("ddl.drop", "DROP TABLE users", "DROP TABLE users"),
|
||
("ddl.truncate", "TRUNCATE attachment_jobs", "TRUNCATE attachment_jobs"),
|
||
("server.read_file", "pg_read_file", "SELECT pg_read_file('/etc/hostname')"),
|
||
("server.program", "COPY TO PROGRAM", "COPY (SELECT 1) TO PROGRAM 'true'"),
|
||
("server.authid", "SELECT pg_authid", "SELECT count(*) FROM pg_authid"),
|
||
("server.create_role", "CREATE ROLE", "CREATE ROLE track1_probe"),
|
||
("server.set_role", "SET ROLE pg_read_all_data", "SET ROLE pg_read_all_data"),
|
||
)
|
||
for name, title, sql in server:
|
||
rows.append(_priv(name, title, sql, INSUFFICIENT, OUTSIDE))
|
||
rows.append(
|
||
Op(
|
||
"pg.connect.postgres",
|
||
"PostgreSQL",
|
||
"connect to database postgres",
|
||
"pg_connect",
|
||
{"database": "postgres"},
|
||
OK,
|
||
INSUFFICIENT,
|
||
)
|
||
)
|
||
sha = "'\\x" + "00" * 32 + "'::bytea"
|
||
variant = (
|
||
"INSERT INTO attachment_variants (attachment_id, pipeline_version, "
|
||
"name, content_type, size_bytes, width, height, sha256, created_at, "
|
||
f"object_key) VALUES ('{{att}}', 2, 'thumbnail', 'image/jpeg', 1, 1, 1, "
|
||
f"{sha}, now(), "
|
||
)
|
||
rules = (
|
||
(
|
||
"pending",
|
||
"ready attachment back to pending (cleaner would delete it)",
|
||
"UPDATE attachments SET status = 'pending' WHERE id = '{att}'",
|
||
CHECK,
|
||
(),
|
||
),
|
||
(
|
||
"variant_foreign",
|
||
"variant row with the original key of another attachment",
|
||
variant + "(SELECT object_key FROM attachments WHERE id = '{other}'))",
|
||
CHECK,
|
||
(),
|
||
),
|
||
(
|
||
"variant_dotted",
|
||
"variant row with '..' in the key",
|
||
variant + "'{db}/attachments/{att}/p2/../../{other}/original')",
|
||
CHECK,
|
||
(),
|
||
),
|
||
(
|
||
"variant_other_db",
|
||
"variant row under another database",
|
||
variant + "'other/attachments/{att}/p2/thumbnail.jpg')",
|
||
CHECK,
|
||
(),
|
||
),
|
||
(
|
||
"variant_own",
|
||
"variant row with its own key",
|
||
variant + "'{db}/attachments/{att}/p2/thumbnail.jpg')",
|
||
OK,
|
||
(CODE, "finish_job writes variant rows"),
|
||
),
|
||
(
|
||
"error_unknown",
|
||
"failed with an unknown error_code",
|
||
"UPDATE attachments SET status = 'failed', error_code = 'pwned' "
|
||
"WHERE id = '{att}'",
|
||
CHECK,
|
||
(),
|
||
),
|
||
(
|
||
"error_known",
|
||
"failed with a known error_code",
|
||
"UPDATE attachments SET status = 'failed', "
|
||
"error_code = 'processing_failed' WHERE id = '{att}'",
|
||
OK,
|
||
(CODE, "fail_job"),
|
||
),
|
||
(
|
||
"lease_2100",
|
||
"job lease until 2100 (stuck job)",
|
||
"UPDATE attachment_jobs SET state = 'processing', lease_until = "
|
||
"'2100-01-01' WHERE attachment_id = '{att}'",
|
||
OK,
|
||
(RESIDUAL, "lease is the worker's column; make jobs-audit returns it"),
|
||
),
|
||
(
|
||
"updated_before_created",
|
||
"updated_at earlier than acceptance",
|
||
"UPDATE attachments SET updated_at = created_at - interval '1 day' "
|
||
"WHERE id = '{att}'",
|
||
denied("23514"),
|
||
(),
|
||
),
|
||
(
|
||
"lock_rows",
|
||
"FOR UPDATE of pipeline rows (availability)",
|
||
"SELECT id FROM attachment_jobs FOR UPDATE",
|
||
OK,
|
||
(RESIDUAL, "row locks of own tables until rotate-secret"),
|
||
),
|
||
)
|
||
for name, title, sql, after, why in rules:
|
||
# «до» правил нет: всё, кроме CHECK updated_after_created, проходит
|
||
before = after if name == "updated_before_created" else OK
|
||
rows.append(
|
||
Op(
|
||
f"pg.rule.{name}",
|
||
"PostgreSQL",
|
||
title,
|
||
"pg",
|
||
{"sql": sql},
|
||
before,
|
||
after,
|
||
OWN,
|
||
why,
|
||
)
|
||
)
|
||
return rows
|
||
|
||
|
||
# --------------------------------------------------------------------- S3
|
||
|
||
S3_DENIED = denied("AccessDenied")
|
||
S3_OWN_READ = "{db}/staging/"
|
||
S3_OWN_WRITE = "{db}/attachments/"
|
||
|
||
|
||
def _s3(name, title, method, key, before, after, scope=OUTSIDE, why=(), **extra):
|
||
return Op(
|
||
f"s3.{name}",
|
||
"S3",
|
||
title,
|
||
"s3",
|
||
{"method": method, "key": key, **extra},
|
||
before,
|
||
after,
|
||
scope,
|
||
why,
|
||
)
|
||
|
||
|
||
def _s3_rows() -> list:
|
||
source = "{db}/staging/{probe}"
|
||
result = "{db}/attachments/{probe}/original"
|
||
return [
|
||
_s3(
|
||
"get.staging",
|
||
"GET staging (job source)",
|
||
"get",
|
||
source,
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(CODE, "processing reads the source"),
|
||
),
|
||
_s3(
|
||
"put.attachments",
|
||
"PUT attachments (result)",
|
||
"put",
|
||
result,
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(CODE, "processing writes original and variants"),
|
||
),
|
||
_s3(
|
||
"put.attachments.overwrite",
|
||
"PUT over a ready original",
|
||
"put",
|
||
"{db}/attachments/{att}/original-probe",
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(RESIDUAL, "same PutObject right; make reconcile DEEP=1 finds it"),
|
||
),
|
||
_s3(
|
||
"get.attachments",
|
||
"GET attachments (other users' results)",
|
||
"get",
|
||
"{db}/attachments/{att}/original",
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"head.attachments",
|
||
"HEAD attachments",
|
||
"head",
|
||
"{db}/attachments/{att}/original",
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"put.staging",
|
||
"PUT staging (rewrite a job source)",
|
||
"put",
|
||
source,
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3("delete.staging", "DELETE staging", "delete", source, S3_DENIED, S3_DENIED),
|
||
_s3(
|
||
"delete.attachments",
|
||
"DELETE attachments",
|
||
"delete",
|
||
result,
|
||
S3_DENIED,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"batch_delete",
|
||
"batch DELETE staging",
|
||
"batch_delete",
|
||
source,
|
||
S3_DENIED,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"list.bucket", "LIST bucket", "list", "", denied("AccessDenied"), S3_DENIED
|
||
),
|
||
_s3(
|
||
"list.attachments",
|
||
"LIST attachments prefix",
|
||
"list",
|
||
"{db}/attachments/",
|
||
S3_DENIED,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"get.other_db",
|
||
"GET another database",
|
||
"get",
|
||
"{db}2/staging/{probe}",
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"put.other_db",
|
||
"PUT another database",
|
||
"put",
|
||
"{db}2/attachments/{probe}/original",
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"get.root",
|
||
"GET bucket root object",
|
||
"get",
|
||
".s3-check/probe",
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"put.root", "PUT bucket root object", "put", ".track1/probe", OK, S3_DENIED
|
||
),
|
||
_s3(
|
||
"copy.from_attachments",
|
||
"COPY from attachments",
|
||
"copy",
|
||
result + "-copy",
|
||
OK,
|
||
S3_DENIED,
|
||
source_key="{db}/attachments/{att}/original",
|
||
),
|
||
_s3(
|
||
"multipart.attachments",
|
||
"multipart upload under attachments",
|
||
"multipart",
|
||
result + "-mp",
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(RESIDUAL, "same PutObject right, no other data"),
|
||
),
|
||
_s3(
|
||
"multipart.staging",
|
||
"multipart upload under staging",
|
||
"multipart",
|
||
source + "-mp",
|
||
OK,
|
||
S3_DENIED,
|
||
),
|
||
_s3(
|
||
"acl.public",
|
||
"PUT object ACL public-read",
|
||
"acl",
|
||
result,
|
||
S3_DENIED,
|
||
S3_DENIED,
|
||
),
|
||
_s3("policy.get", "GET bucket policy", "policy", "", S3_DENIED, S3_DENIED),
|
||
_s3(
|
||
"other_bucket",
|
||
"PUT to another bucket",
|
||
"put",
|
||
"probe",
|
||
S3_DENIED,
|
||
S3_DENIED,
|
||
bucket="{bucket}-track1-other",
|
||
),
|
||
_s3(
|
||
"dotted.raw",
|
||
"GET staging/../attachments (raw path)",
|
||
"raw",
|
||
"{db}/staging/../attachments/{att}/original",
|
||
denied("400"),
|
||
denied("400"),
|
||
),
|
||
_s3(
|
||
"dotted.encoded",
|
||
"GET staging/%2e%2e/attachments (encoded)",
|
||
"raw",
|
||
"{db}/staging/%2e%2e/attachments/{att}/original",
|
||
denied("400"),
|
||
denied("400"),
|
||
),
|
||
]
|
||
|
||
|
||
# ------------------------------------------------------------------ брокер
|
||
|
||
REFUSED = denied("ACCESS_REFUSED")
|
||
|
||
|
||
def _amqp(name, title, action, before, after, scope=OUTSIDE, why=()):
|
||
return Op(
|
||
f"amqp.{name}",
|
||
"RabbitMQ",
|
||
title,
|
||
"amqp",
|
||
{"action": action},
|
||
before,
|
||
after,
|
||
scope,
|
||
why,
|
||
)
|
||
|
||
|
||
def _amqp_rows() -> list:
|
||
return [
|
||
_amqp(
|
||
"passive",
|
||
"passive declare of own queue",
|
||
"passive",
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(CODE, "JobConsumer checks the queue"),
|
||
),
|
||
_amqp(
|
||
"get",
|
||
"get and requeue from own queue",
|
||
"get",
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(CODE, "consume"),
|
||
),
|
||
_amqp(
|
||
"purge",
|
||
"purge own queue",
|
||
"purge",
|
||
OK,
|
||
OK,
|
||
OWN,
|
||
(RESIDUAL, "read right; relay republishes, H3"),
|
||
),
|
||
_amqp("publish", "publish into own queue", "publish", OK, REFUSED),
|
||
_amqp("declare", "declare another queue", "declare", OK, REFUSED),
|
||
_amqp("bind", "bind own queue to amq.topic", "bind", OK, REFUSED),
|
||
_amqp("get_other", "get from another queue", "get_other", OK, REFUSED),
|
||
_amqp("delete_other", "delete another queue", "delete_other", OK, REFUSED),
|
||
_amqp(
|
||
"vhost_other",
|
||
"open another vhost",
|
||
"vhost",
|
||
denied("NOT_ALLOWED"),
|
||
denied("NOT_ALLOWED"),
|
||
),
|
||
]
|
||
|
||
|
||
# ----------------------------------------------------------------- OpenBao
|
||
|
||
BAO_FORBIDDEN = denied("403")
|
||
|
||
|
||
def _bao(name, title, method, path, after, scope=OUTSIDE, why=(), body=None):
|
||
return Op(
|
||
f"bao.{name}",
|
||
"OpenBao",
|
||
title,
|
||
"bao",
|
||
{"method": method, "path": path, "body": body},
|
||
NA,
|
||
after,
|
||
scope,
|
||
why,
|
||
)
|
||
|
||
|
||
def _bao_rows() -> list:
|
||
rows = [
|
||
_bao(
|
||
"read.postgres_worker",
|
||
"read messenger/postgres/worker",
|
||
"GET",
|
||
"messenger/data/postgres/worker",
|
||
OK,
|
||
OWN,
|
||
(CODE, "process secrets"),
|
||
),
|
||
_bao(
|
||
"read.s3_worker",
|
||
"read messenger/s3/worker",
|
||
"GET",
|
||
"messenger/data/s3/worker",
|
||
OK,
|
||
OWN,
|
||
(CODE, "process secrets"),
|
||
),
|
||
]
|
||
for path in (
|
||
"postgres/api",
|
||
"postgres/relay",
|
||
"postgres/cleaner",
|
||
"postgres/migrate",
|
||
"s3/api",
|
||
"s3/cleaner",
|
||
"valkey/api",
|
||
):
|
||
rows.append(
|
||
_bao(
|
||
f"read.{path.replace('/', '_')}",
|
||
f"read messenger/{path}",
|
||
"GET",
|
||
f"messenger/data/{path}",
|
||
BAO_FORBIDDEN,
|
||
)
|
||
)
|
||
rows += [
|
||
_bao(
|
||
"list",
|
||
"list messenger/metadata",
|
||
"LIST",
|
||
"messenger/metadata/",
|
||
BAO_FORBIDDEN,
|
||
),
|
||
_bao(
|
||
"write.own",
|
||
"write messenger/s3/worker",
|
||
"POST",
|
||
"messenger/data/s3/worker",
|
||
BAO_FORBIDDEN,
|
||
body={"data": {"x": "y"}},
|
||
),
|
||
_bao(
|
||
"sys.policies",
|
||
"read sys/policies/acl",
|
||
"LIST",
|
||
"sys/policies/acl",
|
||
BAO_FORBIDDEN,
|
||
),
|
||
_bao(
|
||
"token.create",
|
||
"auth/token/create",
|
||
"POST",
|
||
"auth/token/create",
|
||
BAO_FORBIDDEN,
|
||
body={},
|
||
),
|
||
Op(
|
||
"bao.login.api",
|
||
"OpenBao",
|
||
"cert login as role api",
|
||
"bao_login",
|
||
{"role": "api"},
|
||
NA,
|
||
denied("400"),
|
||
),
|
||
]
|
||
return rows
|
||
|
||
|
||
# ------------------------------------------------------------ сеть, процесс
|
||
|
||
|
||
def _net_rows() -> list:
|
||
return [
|
||
Op(
|
||
"net.api_direct",
|
||
"network",
|
||
"API replica directly (api:8080)",
|
||
"tls",
|
||
{"host": "api", "port": 8080, "name": "api"},
|
||
OK,
|
||
denied("tls"),
|
||
),
|
||
Op(
|
||
"net.lb",
|
||
"network",
|
||
"API through the LB (public endpoint)",
|
||
"lb",
|
||
{},
|
||
OK,
|
||
OK,
|
||
PROCESS,
|
||
(RESIDUAL, "public endpoint of every client"),
|
||
),
|
||
Op(
|
||
"net.valkey",
|
||
"network",
|
||
"Valkey without a password",
|
||
"valkey",
|
||
{},
|
||
denied("NOAUTH"),
|
||
denied("NOAUTH"),
|
||
),
|
||
Op(
|
||
"net.otlp",
|
||
"network",
|
||
"OTLP export (otel-collector:4318)",
|
||
"otlp",
|
||
{},
|
||
NA,
|
||
OK,
|
||
PROCESS,
|
||
(CODE, "telemetry of the worker"),
|
||
),
|
||
# «после» :8404 — экспортёр метрик LB по mTLS только для identity
|
||
# otel-collector: пара worker отвергнута после рукопожатия
|
||
Op(
|
||
"net.lb_stats",
|
||
"network",
|
||
"LB metrics and stats :8404",
|
||
"tls",
|
||
{"host": "haproxy", "port": 8404, "name": "localhost"},
|
||
OK,
|
||
denied("tls"),
|
||
),
|
||
# gRPC шлюза S3 допускает только CN разовой пробы make s3-check
|
||
# (allowed_commonNames, перенос 15): leaf worker отвергнут alert-ом TLS.
|
||
# До переноса 15 строка была доступной «после» (любой leaf CA стенда)
|
||
Op(
|
||
"net.s3_grpc",
|
||
"network",
|
||
"S3 gRPC gateway s3:18333 (TLS with the worker leaf)",
|
||
"grpc",
|
||
{"host": "s3", "port": 18333},
|
||
OK,
|
||
denied("tls"),
|
||
),
|
||
Op(
|
||
"net.egress",
|
||
"network",
|
||
"default route out of the stand",
|
||
"route",
|
||
{},
|
||
OK,
|
||
OK,
|
||
PROCESS,
|
||
(RESIDUAL, "egress is not segmented"),
|
||
),
|
||
Op(
|
||
"proc.environ",
|
||
"process",
|
||
"secrets in the process environment",
|
||
"environ",
|
||
{},
|
||
OK,
|
||
denied("absent"),
|
||
),
|
||
Op(
|
||
"proc.key",
|
||
"process",
|
||
"worker private key file",
|
||
"keyfile",
|
||
{},
|
||
NA,
|
||
OK,
|
||
PROCESS,
|
||
(CODE, "mTLS and OpenBao login of the process"),
|
||
),
|
||
Op(
|
||
"proc.mem",
|
||
"process",
|
||
"read /proc/1/mem (RCE in the renderer)",
|
||
"mem",
|
||
{},
|
||
OK,
|
||
OK,
|
||
PROCESS,
|
||
(RESIDUAL, "same UID; the container is the border"),
|
||
),
|
||
Op(
|
||
"proc.root_write",
|
||
"process",
|
||
"write to /",
|
||
"root_write",
|
||
{},
|
||
denied("EROFS"),
|
||
denied("EROFS"),
|
||
),
|
||
Op(
|
||
"proc.capabilities",
|
||
"process",
|
||
"effective capabilities",
|
||
"caps",
|
||
{},
|
||
denied("none"),
|
||
denied("none"),
|
||
),
|
||
]
|
||
|
||
|
||
OPERATIONS: list = _pg_rows() + _s3_rows() + _amqp_rows() + _bao_rows() + _net_rows()
|
||
|
||
|
||
def by_id() -> dict:
|
||
return {op.id: op for op in OPERATIONS}
|