Commit Graph

432 Commits

Author SHA1 Message Date
emelinda
c7dcc2efc4 add ldap debug 2026-11-13 12:21:13 +03:00
ivan
b591cf3095 stand: istio-config — маршруты documentations, processing, cde, transmittal 2026-11-13 14:00:13 +05:00
ivan
1328aa3ec7 stand: свой istio-config по образцу uralkal — хост sarex.stand.sarex.tech с маршрутами к развёрнутым сервисам, сертификат stand-sarex-tls, JWKS ключа стенда, ServiceEntry JWKS Zitadel 2026-11-13 13:52:02 +05:00
ivan
2b707e9816 uralkal: camunda keycloak — keytab с principal HTTP/camunda-keycloak.sarex.local.uralkali.com 2026-11-12 15:31:18 +05:00
emelinda
1a163c48e0 fix uralkali 2026-11-10 19:11:48 +03:00
d6223b4fb1 ++ uralkal request authentication 2026-11-09 12:09:28 +03:00
emelinda
8c58d5b55e security-audit: add audit-duckdb pod (ad-hoc DuckDB queries to audit parquet in MinIO) 2026-11-09 04:15:07 +03:00
emelinda
b37ed4d4f0 change audit-processor image 2026-11-09 03:47:04 +03:00
emelinda
05e127d1a5 security-audit: enable idp_events pipeline (zitadel events to idp-events/ Parquet) 2026-11-09 03:10:26 +03:00
emelinda
b74a740523 security-audit: watch user.signed.out and user.pat.added/removed in zitadel idp events 2026-11-09 03:00:59 +03:00
emelinda
8b76780e00 istio-config/uralkal: drop audit-jwt RequestAuthentication — zitadel console uses opaque tokens, jwt_authn rejects them (401 "Jwt is not in the form") 2026-11-09 02:09:36 +03:00
emelinda
f6b8a20880 istio-config/uralkal: drop unconfirmed Identity header from audit-jwt fromHeaders (breaks zitadel console) 2026-11-09 01:39:37 +03:00
emelinda
7548569329 fix jwks 2026-11-09 01:20:56 +03:00
emelinda
793d1e8eed change audit-processor image 2026-11-09 01:06:34 +03:00
emelinda
27cd73d3a3 security-audit: enable idp-actions-bootstrap (Zitadel events), PAT from dedicated security-audit-zitadel secret 2026-11-09 00:47:56 +03:00
emelinda
a0899630ca uralkal: postpone vault audit journal (overlay and vault_audit pipeline) — rollout planned separately 2026-11-09 00:23:26 +03:00
emelinda
f4c136c39e change audit-processor image 2026-11-09 00:14:09 +03:00
emelinda
e5092ff66b uralkal: enable vault audit journal (vault/uralkal-audit overlay, vault_audit pipeline in audit-processor) 2026-11-08 23:52:03 +03:00
emelinda
1864c0f587 istio-config/uralkal: temporarily drop metadata user_id/company_ids mappings (503 invalid header value) until the claim format is confirmed 2026-11-08 23:25:15 +03:00
emelinda
d49f178603 istio-config/uralkal: harden decode-zitadel-headers — replace only with numeric ids, drop the header otherwise 2026-11-08 22:54:49 +03:00
emelinda
4ca206722b istio-config/uralkal: map zitadel metadata user_id/company_ids to headers (as prod),
add decode-zitadel-headers Lua filter, switch audit-jwt to outputClaims (chart 0.1.1
drops outputClaimToHeaders silently)
2026-11-08 22:39:02 +03:00
emelinda
f00238b9c9 change transform/mask 2026-11-08 22:18:29 +03:00
emelinda
1190e8283c change audit-processor image 2026-11-08 21:59:30 +03:00
emelinda
d66d0e9662 security-audit: audit-processor image 2b4fc5d7 (kind traces), enable telemetry.traces pipeline 2026-11-08 21:32:36 +03:00
emelinda
33c3f91df3 opentelemetry-collector/uralkal: set overlay namespace so the NetworkPolicy lands in opentelemetry-collector 2026-11-08 20:12:37 +03:00
emelinda
14d3cf0ca3 - istio-config/uralkal: RequestAuthentication audit-jwt (zitadel + camunda-keycloak
issuers; claims to x-sarex-audit-sub/org and x-user-id), zitadel-jwks ServiceEntry;
  istio-pilot/uralkal: PILOT_JWT_ENABLE_REMOTE_JWKS=envoy
- opentelemetry-collector/uralkal: transform/mask strips tokens and JWTs from span
  URL attributes before export (same rules as access-collector)
- security-audit: access journal is mesh-wide now (Telemetry mesh-audit-access,
  access-collector NetworkPolicy/AuthorizationPolicy allow all mesh sources on 4317)
2026-11-08 19:29:15 +03:00
emelinda
5ba7149e20 uralkal: route traces through Kafka into audit-processor instead of direct S3
- opentelemetry-collector/uralkal: kafka exporter (telemetry.traces, otlp_proto,
  SASL_SSL, creds from otel-collector-kafka + kafka-ca), NetworkPolicy egress to kafka ns
- security-audit: add {topic: telemetry.traces, kind: traces} pipeline to
  audit-processor config (requires k8s-audit-processor image with traces support —
  update the pinned digest after CI build)
2026-11-08 18:56:13 +03:00
emelinda
338e98ad2f uralkal: export istio and app traces to S3 via opentelemetry-collector
- add opentelemetry-collector/uralkal overlay: otlp + zipkin receivers,
  awss3 exporter to the contour MinIO (10.133.0.245:9000, bucket "security-audit",
  prefix traces/, hourly partitions, gzip, otlp_proto), credentials from
  otel-collector-minio secret (same keys as security-audit-minio)
- harden per security-audit conventions: NetworkPolicy (ingest ports + MinIO
  egress only), PDB, pod anti-affinity, non-root, no sidecar (HTTP ServiceEntry
  on :9000 would shadow direct-IP egress to MinIO)
- istio-pilot/uralkal: enable mesh tracing (zipkin to otel-collector), sampling 100
- istio-config/uralkal: add-traceparent EnvoyFilter for all app namespaces
- clusters/uralkal: wire the collector overlay

Rollout order: apply the iac overlay first (creates the namespace), then
terragrunt apply in infra/terraform (branch contour, env uralkal) which rolls
regcred + otel-collector-minio + otel-collector-kafka secrets into the
opentelemetry-collector namespace and adds the traces/ lifecycle rule.
2026-11-08 18:23:55 +03:00
emelinda
df3840e70d remove {topic: security.k8s-audit, kind: k8s_audit} 2026-11-07 20:27:40 +03:00
emelinda
772cef5cef security-audit: fix pipelines placement in processor config — top-level key
config.Pipelines is a root-level key in k8s-audit; nested under kafka: it
was ignored and the service fell back to the single kafka.topic fallback.
2026-11-07 20:18:47 +03:00
emelinda
d0bed7033a security-audit: enable mesh-access pipeline, audit-processor pinned by digest
Config: pipelines security.k8s-audit (k8s_audit) + security.mesh-access
(mesh_access); kafka.topic kept for rollback (pre-pipelines image ignores
the pipelines key). Image pinned to digest sha256:56a23bec… (k8s-audit@05a186a,
pipelines support) per repo policy п.38. Kafka ACL and MinIO policy need no
changes (no ACLs; bucket user has s3:* on the whole bucket). Companion
terraform change: ILM rule expire-mesh-access-90d.
2026-11-07 20:12:54 +03:00
emelinda
a2da49804a security-audit: audit-processor 47297469, flush_interval 1m
Bump processor image and deliver events to MinIO within a minute
(more small parquet files; compaction is stage 3 of k8s-audit).
2026-11-07 18:46:32 +03:00
emelinda
ff931e1708 security-audit: audit-processor flush_interval 5m -> 1m
Deliver audit events to MinIO within a minute for near-real-time
investigation; trade-off is more small parquet files (compaction
is planned in stage 3 of k8s-audit).
2026-11-07 18:07:36 +03:00
emelinda
a6a176d6c5 security-audit: audit-processor af50e663, drop retention config section
New image removes the bucket lifecycle check (retention is owned by terraform
minio-buckets lifecycle_rules), so the retention section is dropped from the
processor config map.
2026-11-07 17:24:47 +03:00
emelinda
a60b171bea security-audit: IsMap guards in transform/audit delete_key statements
Some events (e.g. deletecollection) carry requestObject as a slice, not a map:
indexing it with "metadata" failed with "unable to resolve an integer index in
slice" and spammed the collector log (error_mode: ignore — events were not lost).
IsMap chains rely on OTTL short-circuit `and` evaluation (verified against
v0.121 sources).
2026-11-07 16:23:46 +03:00
emelinda
cf2689aea0 security-audit: fix filter/audit config key — log_record (singular), filterprocessor 0.121
The processor rejected "log_records": LogFilters.LogConditions is mapstructure
"log_record" in v0.121 (collector failed to start: failed to get config).
2026-11-07 16:00:24 +03:00
emelinda
0b8318f547 security-audit: drop flux-system read polling from apiserver audit pipeline
filter/audit in audit-collector drops get/list/watch events from
system:serviceaccount:flux-system:* (helm/kustomize/source controllers polling
fluxcd resources every few seconds — the bulk of the topic volume). GitOps
mutations are kept: they are the actual trail of cluster changes.
2026-11-07 15:45:37 +03:00
emelinda
1960ef495c security-audit: add audit-processor — ship apiserver audit from Kafka to MinIO (Parquet)
base/processor-*.yaml: Deployment (1 replica, image k8s-audit-processor:394b6f9d),
ConfigMap with config.yaml, ServiceAccount, NetworkPolicy (DNS, kafka:9092,
external MinIO 10.133.0.245:9000). Contour-specific values for uralkal are set
via env patch in the overlay (K8S_AUDIT_*), same pattern as the collectors.
Credentials reuse the static Secrets (security-audit-kafka, kafka-ca,
security-audit-minio) via a projected volume at /vault/secrets.

app.env=stand: the contour's external MinIO has no TLS, so strict validation
(minio.secure) would fail. log.s3_echo=true is temporary for flow verification
(per security req. 20: disable after debugging).
2026-11-07 14:54:08 +03:00
emelinda
9cb62ea9f0 security-audit: nil-guards в transform/audit — удаление managedFields/annotations
У части событий requestObject есть, а metadata/annotations в нём nil —
statement падал с "expected pcommon.Map but got nil" и засорял лог
(error_mode: ignore, события не терялись).
2026-11-06 18:03:30 +03:00
emelinda
d4bbc5fd14 security-audit: отложить события Zitadel — отключить Job idp-actions-bootstrap
PAT machine user'а security-audit-bootstrap не заведён (ни Vault-роль, ни статический
Secret), Job не сможет настроить Target/Execution'ы. Пайплайн logs/idp в access-collector
оставлен и инертен: без Target'а Zitadel ничего не отправляет. Обратное включение:
раскомментировать idp-actions-bootstrap в base/kustomization.yaml и его патч в оверлее
uralkal, добавить ключ zitadel_pat в Secret security-audit-kafka.
2026-11-06 17:34:05 +03:00
emelinda
3162679524 security-audit: креды Kafka и PAT Zitadel — из статических Secret'ов вместо Vault Agent
В контуре uralkal роли Vault (security-audit, security-audit-bootstrap) не заведены.
Коллекторы и Job idp-actions-bootstrap монтируют Secret'ы namespace (security-audit-kafka,
kafka-ca) projected volume'ом в /vault/secrets под теми же именами файлов — конфиг
коллекторов (${file:...}, ca_file) не меняется. Из NetworkPolicy убран egress в Vault,
из оверлея uralkal — dependsOn на HelmRelease vault.
2026-11-06 17:22:20 +03:00
ivan
4dac264303 uralkal: camunda keycloak — debug-логи org.keycloak.storage.ldap 2026-11-05 15:12:24 +05:00
ivan
0398df0901 uralkal: camunda keycloak — Secret keycloak-keytab из sarex.keytab через secretGenerator 2026-11-05 12:50:53 +05:00
ivan
6855db88b8 uralkal: camunda keycloak — доверие корневому CA BER-CA1 для LDAPS к AD
ConfigMap uralkali-ca с PEM BER-CA1 монтируется в /opt/uralkali-ca,
KC_TRUSTSTORE_PATHS=/opt/uralkali-ca/ber-ca1.crt добавляет его в Truststore SPI
Keycloak 25 поверх системных корней, без пересборки образа.
2026-11-05 11:39:25 +05:00
ivan
b456e8a5da uralkal: zitadel — доверие корневому CA BER-CA1 для LDAPS к AD
ConfigMap uralkali-ca с PEM BER-CA1 (DC=local,DC=uralkali,DC=com) монтируется
в /etc/ssl/uralkali, SSL_CERT_DIR=/etc/ssl/uralkali:/etc/ssl/certs. Образ на
scratch без пересборки: Go берёт доп. корни из SSL_CERT_DIR. Чинит
"x509: certificate signed by unknown authority" при входе через AD.
2026-11-05 11:18:07 +05:00
emelinda
49040e0da8 Enable plain client manifest for istio-mtls-check 2026-11-05 09:01:41 +03:00
emelinda
919253808b add istio-mtls-check deployments 2026-11-05 08:50:25 +03:00
emelinda
ad28069436 Add Istio mTLS check manifests to uralkal cluster 2026-11-05 03:23:43 +03:00
emelinda
67985010ce Fix uralkal Istio EnvoyFilter patch target for HTTP routes 2026-11-05 02:26:55 +03:00
emelinda
fa989aafdc Add istio-config-contour chart and enforce HTTPS/TLS/HSTS for uralkal ingress 2026-11-04 23:38:14 +03:00