Skip to content

Commit

Permalink
refactor: Update snort.ps1 to replace snort.conf file
Browse files Browse the repository at this point in the history
The `snort.ps1` script is updated to replace the existing `snort.conf` file with a new version downloaded from a remote repository. This change ensures that the latest configuration file is used for Snort. If the download fails, an appropriate error message is displayed.

Refactor `snort.ps1` to replace snort.conf file
  • Loading branch information
bengo237 committed Sep 5, 2024
1 parent 01c4fdf commit 0b2f2fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/windows/snort.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ function Install-Snort {
Write-Host "ossec.conf file not found."
}

# Download the new snort.conf file
$snortConfUrl = "https://raw.githubusercontent.com/ADORSYS-GIS/wazuh-snort/snortwin/scripts/windows/snort.conf"
$snortConfPath = "$tempDir\snort.conf"
Download-File $snortConfUrl $snortConfPath

# Replace the existing snort.conf file
if (Test-Path $snortConfPath) {
Copy-Item -Path $snortConfPath -Destination $snortConfigPath -Force
Write-Host "snort.conf file replaced."
} else {
Write-Host "Failed to download snort.conf file."
}

# Add configurations to snort.conf
$snortAdditions = @"
output alert_syslog: LOG_AUTH LOG_ALERT
Expand Down

0 comments on commit 0b2f2fc

Please sign in to comment.