chore(github): keep sanitized settings on public main

Production tokens and NETLOGON paths live on kalinamall/papatramp only. Use scripts/Push-PrivateMirror.ps1 after feature pushes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-06-17 11:12:59 +10:00
parent 7f38c00094
commit afa80d169f
3 changed files with 24 additions and 38 deletions
+5 -5
View File
@@ -29,11 +29,11 @@ $QueueMessageCountThreshold = 150
# --- Пилот VIP (рекомендуется для первого запуска) --- # --- Пилот VIP (рекомендуется для первого запуска) ---
# $VipMailboxesOnly = $true # $VipMailboxesOnly = $true
# $VipMailboxes = @( # $VipMailboxes = @(
# 'director@kalinamall.ru', # 'director@example.com',
# 'cfo@kalinamall.ru' # 'cfo@example.com'
# ) # )
# $VipMailboxPatterns = @( # $VipMailboxPatterns = @(
# '*@kalinamall.ru' # опционально: все ящики домена из Get-Mailbox # '*@example.com' # опционально: все ящики домена из Get-Mailbox
# ) # )
# Первый ночной скан: не слать сотни алертов по уже существующим пересылкам # Первый ночной скан: не слать сотни алертов по уже существующим пересылкам
@@ -46,9 +46,9 @@ $QueueMessageCountThreshold = 150
# $SendInboxScanSummary = $true # $SendInboxScanSummary = $true
# Удалённый EMS (если скрипт не на Exchange) # Удалённый EMS (если скрипт не на Exchange)
# $ExchangeServerFqdn = 'fifth.kalinamall.ru' # $ExchangeServerFqdn = 'mail.example.com'
# Не сканировать Inbox rules (битое хранилище правил / Watson на Get-InboxRule) # Не сканировать Inbox rules (битое хранилище правил / Watson на Get-InboxRule)
# $SkipInboxScanMailboxes = @( # $SkipInboxScanMailboxes = @(
# 'k.selezneva@kalinamall.ru' # 'k.selezneva@example.com'
# ) # )
+9 -10
View File
@@ -9,9 +9,8 @@
#> #>
# --- Telegram (или DPAPI Base64 через Encrypt-DpapiForRdpMonitor.ps1) --- # --- Telegram (или DPAPI Base64 через Encrypt-DpapiForRdpMonitor.ps1) ---
# Закрытое зеркало Gitea — доверенный инстанс; в публичном GitHub используйте example без секретов. $TelegramBotToken = 'YOUR_BOT_TOKEN'
$TelegramBotToken = '8239219522:AAEyOZX3cwNfgGOMDkf-mgjTIuoaOh5gF7I' $TelegramChatID = 'YOUR_CHAT_ID'
$TelegramChatID = '2843230'
# $TelegramBotTokenProtectedB64 = '' # $TelegramBotTokenProtectedB64 = ''
# $TelegramChatIDProtectedB64 = '' # $TelegramChatIDProtectedB64 = ''
@@ -30,13 +29,13 @@ $NotifyOrder = 'tg'
# --- Подпись сервера в Telegram и SAC (host.display_name); пусто = $env:COMPUTERNAME --- # --- Подпись сервера в Telegram и SAC (host.display_name); пусто = $env:COMPUTERNAME ---
# $ServerDisplayName = 'UNMS Kalina' # $ServerDisplayName = 'UNMS Kalina'
# --- Явный IPv4 хоста для SAC (опционально; иначе автоопределение) --- # --- Явный IPv4 хоста для SAC (опционально; иначе автоопределение) ---
# $ServerIPv4 = '192.168.160.57' # $ServerIPv4 = '10.0.0.10'
# --- Security Alert Center (SAC) --- # --- Security Alert Center (SAC) ---
# off | exclusive | dual | fallback — см. security-alert-center/docs/agent-integration.md # off | exclusive | dual | fallback — см. security-alert-center/docs/agent-integration.md
$UseSAC = 'fallback' $UseSAC = 'fallback'
$SacUrl = 'https://sac.kalinamall.ru' $SacUrl = 'https://sac.example.com'
$SacApiKey = 'sac_UkOsAT3UWiQS54KK5OJPBDCSucysQDrKFju28wmYiz8' $SacApiKey = 'sac_CHANGE_ME'
# $SacSpoolDir = 'C:\ProgramData\RDP-login-monitor\sac-spool' # $SacSpoolDir = 'C:\ProgramData\RDP-login-monitor\sac-spool'
# $SacTimeoutSec = 12 # $SacTimeoutSec = 12
# $SacTlsSkipVerify = $false # $SacTlsSkipVerify = $false
@@ -66,7 +65,7 @@ $GetInventory = $true
# --- Узкое исключение шумовых сетевых логонов (LogonType=3, Advapi) --- # --- Узкое исключение шумовых сетевых логонов (LogonType=3, Advapi) ---
$IgnoreAdvapiNetworkLogonSourceIps = @( $IgnoreAdvapiNetworkLogonSourceIps = @(
'192.168.160.57' '10.0.0.1'
) )
# --- Exchange noise filter: 4624 + LogonType=3 + IP='-' (часто Outlook/почтовые клиенты) --- # --- Exchange noise filter: 4624 + LogonType=3 + IP='-' (часто Outlook/почтовые клиенты) ---
# Включайте на почтовом сервере, если нужен только полезный интерактивный сигнал. # Включайте на почтовом сервере, если нужен только полезный интерактивный сигнал.
@@ -79,9 +78,9 @@ $MaxBackupDays = 31
# --- Блокировка учётной записи AD (4740) + IP из IIS ActiveSync --- # --- Блокировка учётной записи AD (4740) + IP из IIS ActiveSync ---
# Мониторинг включается только на КД с именем $LockoutMonitorDomainController. # Мониторинг включается только на КД с именем $LockoutMonitorDomainController.
$LockoutMonitorDomainController = 'K6A-DC3' $LockoutMonitorDomainController = 'DC01'
$NetBiosDomainName = 'B26' $NetBiosDomainName = 'CONTOSO'
$ExchangeIisLogPath = '\\fifth.kalinamall.ru\c$\inetpub\logs\LogFiles\W3SVC1' $ExchangeIisLogPath = '\\mail.example.com\c$\inetpub\logs\LogFiles\W3SVC1'
$ExchangeServerHostForIisExclude = '' $ExchangeServerHostForIisExclude = ''
$ExchangeIisLogTailLines = 5000 $ExchangeIisLogTailLines = 5000
$ExchangeIisLogMinutesBeforeLockout = 30 $ExchangeIisLogMinutesBeforeLockout = 30
+10 -23
View File
@@ -4,7 +4,7 @@
.DESCRIPTION .DESCRIPTION
Dlya servera publikatsii (napr. DC3). Po umolchaniyu GitHub (github.com/PTah). Dlya servera publikatsii (napr. DC3). Po umolchaniyu GitHub (github.com/PTah).
Na zakrytom zerkale ukazhite -GitUrl URL vashego Gitea. Na zakrytom zerkale ukazhite -GitUrl URL vashego Gitea.
Posle fetch: vsegda reset --hard na kalinamall/main (bez merge), zatem clean -fd. Posle fetch: vsegda reset --hard na vetku upstream (bez merge), zatem clean -fd.
Kopiruyutsya: polnyj spisok v Docs/deploy-netlogon-publish.md. Kopiruyutsya: polnyj spisok v Docs/deploy-netlogon-publish.md.
.EXAMPLE .EXAMPLE
powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\soft\update-rdp-monitor.ps1 powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\soft\update-rdp-monitor.ps1
@@ -14,8 +14,8 @@
[CmdletBinding(SupportsShouldProcess = $true)] [CmdletBinding(SupportsShouldProcess = $true)]
param( param(
[string]$RepoPath = 'C:\Soft\Git\RDP-login-monitor', [string]$RepoPath = 'C:\Soft\Git\RDP-login-monitor',
[string]$NetlogonDest = '\\b26\NETLOGON\RDP-login-monitor', [string]$NetlogonDest = '\\dc.contoso.local\NETLOGON\RDP-login-monitor',
[string]$GitUrl = 'https://git.kalinamall.ru/PapaTramp/RDP-login-monitor.git', [string]$GitUrl = 'https://github.com/PTah/RDP-login-monitor.git',
[string]$GitBranch = 'main', [string]$GitBranch = 'main',
[string]$LogFile = 'C:\soft\Logs\update-rdp-monitor.log', [string]$LogFile = 'C:\soft\Logs\update-rdp-monitor.log',
[switch]$SkipGitClean [switch]$SkipGitClean
@@ -112,38 +112,25 @@ function Ensure-GitRepository {
function Get-ConfiguredGitRemoteName { function Get-ConfiguredGitRemoteName {
$names = @(Invoke-GitCommand -Arguments @('remote') | ForEach-Object { "$_".Trim() } | Where-Object { $_ }) $names = @(Invoke-GitCommand -Arguments @('remote') | ForEach-Object { "$_".Trim() } | Where-Object { $_ })
if ($names.Count -eq 0) { return $null } if ($names.Count -eq 0) { return $null }
if ('kalinamall' -in $names) { return 'kalinamall' }
foreach ($n in $names) {
$url = (& git -C $RepoPath remote get-url $n 2>$null)
if ($url -match 'git\.kalinamall\.ru') { return $n }
}
if ('origin' -in $names) { return 'origin' } if ('origin' -in $names) { return 'origin' }
return $names[0] return $names[0]
} }
function Ensure-GitKalinamallRemote { function Ensure-GitUpstreamRemote {
$name = Get-ConfiguredGitRemoteName $name = Get-ConfiguredGitRemoteName
if ($null -ne $name) { if ($null -ne $name) {
$url = (& git -C $RepoPath remote get-url $name 2>$null) $url = (& git -C $RepoPath remote get-url $name 2>$null)
if ($url -match 'git\.kalinamall\.ru') { Write-UpdateLog "Using remote: $name ($url)"
Write-UpdateLog "Using remote: $name ($url)" return $name
return $name
}
Write-UpdateLog "Remote $name is not kalinamall ($url); adding kalinamall -> $GitUrl"
} else {
Write-UpdateLog "No remotes; adding kalinamall -> $GitUrl"
} }
if ('kalinamall' -in @(& git -C $RepoPath remote 2>$null)) { Write-UpdateLog "No remotes; adding origin -> $GitUrl"
Invoke-GitCommand -Arguments @('remote', 'set-url', 'kalinamall', $GitUrl) Invoke-GitCommand -Arguments @('remote', 'add', 'origin', $GitUrl)
return 'kalinamall' return 'origin'
}
Invoke-GitCommand -Arguments @('remote', 'add', 'kalinamall', $GitUrl)
return 'kalinamall'
} }
function Update-Repository { function Update-Repository {
Ensure-GitRepository Ensure-GitRepository
$remote = Ensure-GitKalinamallRemote $remote = Ensure-GitUpstreamRemote
Invoke-GitCommand -Arguments @('fetch', '--prune', $remote, $GitBranch) Invoke-GitCommand -Arguments @('fetch', '--prune', $remote, $GitBranch)
$upstream = "${remote}/${GitBranch}" $upstream = "${remote}/${GitBranch}"