Skip to content

Commit

Permalink
Remove event log depends
Browse files Browse the repository at this point in the history
Startup type of delayed automatic means this service will run after event log service
  • Loading branch information
jjxtra committed Jul 17, 2019
1 parent 6c5bbf2 commit 5c4c421
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CreatePackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ param([Parameter(Mandatory=$true)] [String]$version)
Remove-Item ./package -Recurse -ErrorAction Ignore
mkdir ./package
& "c:/program files/dotnet/dotnet.exe" publish IPBan.csproj -f netcoreapp2.2 -o package/linux-x64 -c Release -r linux-x64
& "c:/program files (x86)/dotnet/dotnet.exe" publish IPBan.csproj -f netcoreapp2.2 -o package/win-x86 -c Release -r win-x86
& "c:/program files/dotnet/dotnet.exe" publish IPBan.csproj -f netcoreapp2.2 -o package/win-x64 -c Release -r win-x64
& "c:/program files (x86)/dotnet/dotnet.exe" publish IPBan.csproj -f netcoreapp2.2 -o package/win-x86 -c Release -r win-x86
Compress-Archive -Path ./package/linux-x64/* -DestinationPath ./package/IPBan-Linux-x64.zip
Compress-Archive -Path ./package/win-x86/* -DestinationPath ./package/IPBan-Windows-x86.zip
Compress-Archive -Path ./package/win-x64/* -DestinationPath ./package/IPBan-Windows-x64.zip
Compress-Archive -Path ./package/win-x86/* -DestinationPath ./package/IPBan-Windows-x86.zip
Compress-Archive -Path ./package/IPBan-Linux-x64.zip,./package/IPBan-Windows-x86.zip,./package/IPBan-Windows-x64.zip -DestinationPath ./package/IPBan_$version.zip -CompressionLevel NoCompression
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ auditpol /set /category:"Account Logon" /success:enable /failure:enable
- For Windows Server 2008 or equivalent, you should disable NTLM logins and only allow NTLM2 logins. On Windows Server 2008, there is no way to get the ip address of NTLM logins. Use secpol -> local policies -> security options -> network security restrict ntlm incoming ntlm traffic -> deny all accounts.
- To install as a Windows service use the [sc command](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create) and run the following in an elevated command window:
```
sc create IPBAN type= own start= delayed-auto binPath= c:\path\to\service\DigitalRuby.IPBan.exe DisplayName= IPBAN depend= EventLog
sc create IPBAN type= own start= delayed-auto binPath= c:\path\to\service\DigitalRuby.IPBan.exe DisplayName= IPBAN
sc description IPBAN "Automatically builds firewall rules for abusive login attempts: https://github.com/DigitalRuby/IPBan"
sc start IPBAN
```
or with Powershell use the command [New-Service](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-service) and run the following in an elevated powershell window:
```powershell
New-Service -Name "IPBAN" -BinaryPathName "c:\path\to\service\DigitalRuby.IPBan.exe" -StartupType automatic -DisplayName "IPBAN" -Description "Automatically builds firewall rules for abusive login attempts: https://github.com/DigitalRuby/IPBan" -DependsOn EventLog
New-Service -Name "IPBAN" -BinaryPathName "c:\path\to\service\DigitalRuby.IPBan.exe" -StartupType automatic -DisplayName "IPBAN" -Description "Automatically builds firewall rules for abusive login attempts: https://github.com/DigitalRuby/IPBan"
Get-WmiObject win32_service -Filter "name='IPBAN'"
Start-Service IPBAN
sc.exe config IPBAN start= delayed-auto
Expand Down
2 changes: 1 addition & 1 deletion Windows/Scripts/install.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sc.exe create IPBAN type= own start= delayed-auto binPath= %~dp0DigitalRuby.IPBan.exe DisplayName= "IPBan Service" depend= EventLog
sc.exe create IPBAN type= own start= delayed-auto binPath= %~dp0DigitalRuby.IPBan.exe DisplayName= "IPBan Service"
sc.exe description IPBAN "Automatically builds firewall rules for abusive login attempts: https://github.com/DigitalRuby/IPBan"

0 comments on commit 5c4c421

Please sign in to comment.