mirror of
https://github.com/deadcxap/init_scripts.git
synced 2026-07-02 05:43:40 +03:00
потерял каддифайл
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
{
|
||||
email dead@cxap.space
|
||||
dns cloudflare {$CF_API_TOKEN}
|
||||
|
||||
order authenticate before respond
|
||||
order authorize before respond
|
||||
|
||||
servers {
|
||||
trusted_proxies static private_ranges
|
||||
}
|
||||
|
||||
certificates {
|
||||
automate auth.realy.nothing.help
|
||||
automate *.realy.nothing.help
|
||||
}
|
||||
}
|
||||
|
||||
security {
|
||||
# Локальное хранилище пользователей
|
||||
local identity store localdb {
|
||||
realm local
|
||||
path /data/users.json
|
||||
}
|
||||
|
||||
# Портал аутентификации (используем в site-блоке ниже)
|
||||
authentication portal authportal {
|
||||
# криптополитика и тайминги
|
||||
crypto default token lifetime {$AUTH_TOKEN_LIFETIME:-12h}
|
||||
enable identity store localdb
|
||||
|
||||
# единый cookie для всех поддоменов realy.nothing.help
|
||||
cookie domain realy.nothing.help
|
||||
cookie lifetime {$AUTH_COOKIE_LIFETIME:-12h}
|
||||
cookie idle_timeout {$AUTH_IDLE_TIMEOUT:-30m}
|
||||
cookie samesite lax
|
||||
|
||||
ui {
|
||||
title "Account"
|
||||
# можно добавить ярлыки на часто используемые сервисы
|
||||
links {
|
||||
"Portainer" "https://port.realy.nothing.help"
|
||||
"WhoAmI" "/whoami"
|
||||
}
|
||||
}
|
||||
|
||||
# Всем локальным пользователям — роль admin + требование MFA
|
||||
transform user {
|
||||
match origin local
|
||||
action add role admin
|
||||
# require mfa
|
||||
}
|
||||
# И базовая роль "user" всем аутентифицированным
|
||||
transform user {
|
||||
action add role user
|
||||
}
|
||||
}
|
||||
|
||||
# Политика для API: либо admin-роль, либо API-ключи портала
|
||||
authorization policy apikey_or_admin {
|
||||
set auth url https://auth.realy.nothing.help
|
||||
allow roles admin
|
||||
with api key auth portal authportal realm local
|
||||
|
||||
# Явные ACL с логами
|
||||
acl rule { comment "Accept" match role admin allow stop log info }
|
||||
acl rule { comment "Deny" match any deny log warn }
|
||||
}
|
||||
}
|
||||
|
||||
auth.realy.nothing.help {
|
||||
# сам портал на отдельном хосте
|
||||
route {
|
||||
authenticate with authportal
|
||||
}
|
||||
|
||||
# Базовые security-заголовки
|
||||
header {
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-Frame-Options "DENY"
|
||||
Referrer-Policy "no-referrer"
|
||||
}
|
||||
}
|
||||
|
||||
# Обычная «пользовательская» защита: просто требует валидную сессию,
|
||||
# редиректит на портал, прокидывает клеймы в заголовки.
|
||||
(auth_forward) {
|
||||
authorize {
|
||||
set auth url https://auth.realy.nothing.help
|
||||
inject headers with claims
|
||||
}
|
||||
}
|
||||
|
||||
# Защита API: только admin или по API-ключу (policy объявлена выше)
|
||||
(authorize_apikey_or_admin) {
|
||||
authorize with apikey_or_admin
|
||||
}
|
||||
Reference in New Issue
Block a user