mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-15 17:12:14 +03:00
Merge pull request #3452 from A13501350/v2/test-ci-windows
Add CMake and CI Pipeline for ModSecurityIIS in ModSecurity V2
This commit is contained in:
325
.github/workflows/test-ci-windows.yml
vendored
Normal file
325
.github/workflows/test-ci-windows.yml
vendored
Normal file
@@ -0,0 +1,325 @@
|
||||
name: CI/CD for IIS Module
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x64, x86]
|
||||
config: [Release, RelWithDebInfo]
|
||||
runs-on: windows-latest
|
||||
|
||||
# For Caching
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Install Apache for x86
|
||||
if: matrix.arch == 'x86'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$apachePath = "${{ github.workspace }}\apache-x86"
|
||||
New-Item -ItemType Directory -Path $apachePath -Force
|
||||
choco install apache-httpd -y --force --forcex86 --no-progress -r --params="'/installLocation:$apachePath /noService'"
|
||||
echo "APACHE_ROOT=$apachePath\Apache24" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Set Apache path for x64
|
||||
if: matrix.arch == 'x64'
|
||||
shell: pwsh
|
||||
run: |
|
||||
echo "APACHE_ROOT=C:\tools\Apache24" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2
|
||||
with:
|
||||
msystem: ${{ matrix.arch == 'x86' && 'MINGW32' || 'UCRT64' }}
|
||||
update: true
|
||||
install: >
|
||||
git
|
||||
make
|
||||
autoconf
|
||||
automake
|
||||
libtool
|
||||
${{ matrix.arch == 'x86' && 'mingw-w64-i686-gcc' || 'mingw-w64-ucrt-x86_64-gcc' }}
|
||||
${{ matrix.arch == 'x86' && 'mingw-w64-i686-pkg-config' || 'mingw-w64-ucrt-x86_64-pkg-config' }}
|
||||
|
||||
- name: Clone and build ssdeep
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
MSYS2_WORKSPACE=$(cygpath -u '${{ github.workspace }}')
|
||||
|
||||
git clone https://github.com/ssdeep-project/ssdeep.git --depth 1
|
||||
cd ssdeep
|
||||
autoreconf -i
|
||||
|
||||
if [ "${{ matrix.arch }}" = "x86" ]; then
|
||||
./configure --enable-shared --disable-static CFLAGS="-O3" CXXFLAGS="-O3" --build=i686-pc-mingw32
|
||||
else
|
||||
./configure --enable-shared --disable-static CFLAGS="-O3" CXXFLAGS="-O3"
|
||||
fi
|
||||
|
||||
make dll
|
||||
|
||||
mkdir -p "${MSYS2_WORKSPACE}/ssdeep-install/"
|
||||
cp -v fuzzy.dll "${MSYS2_WORKSPACE}/ssdeep-install/"
|
||||
cp -v fuzzy.h "${MSYS2_WORKSPACE}/ssdeep-install/"
|
||||
cp -v fuzzy.def "${MSYS2_WORKSPACE}/ssdeep-install/"
|
||||
|
||||
- name: Restore vcpkg cache
|
||||
id: vcpkg-cache
|
||||
uses: TAServers/vcpkg-cache@e848939f754daf406a06006be2e05eb5b17cc481
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
prefix: vcpkg-iis-module-${{ matrix.arch }}/
|
||||
|
||||
- uses: ammaraskar/msvc-problem-matcher@1ebcb382869bfdc2cc645e8a2a43b6d319ea1cc0
|
||||
|
||||
- name: Configure CMake for IIS Module
|
||||
env:
|
||||
VCPKG_FEATURE_FLAGS: "binarycaching"
|
||||
VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-windows
|
||||
run: |
|
||||
$archFlag = "${{ matrix.arch }}"
|
||||
$cmakeArch = if ($archFlag -eq "x86") { "Win32" } else { "x64" }
|
||||
$installDir = if ($archFlag -eq "x86") { "x86" } else { "amd64" }
|
||||
|
||||
cmake `
|
||||
-DAPACHE_ROOT="$env:APACHE_ROOT" `
|
||||
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\iis\release\$installDir" `
|
||||
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" `
|
||||
-DSSDEEP_ROOT="${{ github.workspace }}\ssdeep-install" `
|
||||
-DWITH_SSDEEP=ON `
|
||||
-A $cmakeArch `
|
||||
-DWITH_LUA=ON `
|
||||
-DWITH_YAJL=ON `
|
||||
-S IIS -B "iis\build"
|
||||
|
||||
- name: Build IIS Module
|
||||
shell: pwsh
|
||||
run: |
|
||||
cmake --build "iis\build" --config ${{ matrix.config }}
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: iis-module-${{ matrix.arch }}-${{ matrix.config }}
|
||||
path: iis/build/${{ matrix.config }}/
|
||||
|
||||
package:
|
||||
needs: build
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
config: [Release, RelWithDebInfo]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Download x64 artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: iis-module-x64-${{ matrix.config }}
|
||||
path: iis/release/amd64/
|
||||
|
||||
- name: Download x86 artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: iis-module-x86-${{ matrix.config }}
|
||||
path: iis/release/x86/
|
||||
|
||||
- name: Generate MSI files
|
||||
shell: pwsh
|
||||
run: |
|
||||
heat dir "iis\release\amd64" -cg ModSec64Components -dr inetsrv64 -gg -sreg -srd -var var.ModSecurityIISRelease64 -out "iis\ModSec64.wxs"
|
||||
heat dir "iis\release\x86" -cg ModSec32Components -dr inetsrv32 -gg -sreg -srd -var var.ModSecurityIISRelease32 -out "iis\ModSec32.wxs"
|
||||
candle.exe -ext WixUtilExtension -ext WixUIExtension "iis\installer.wxs" "iis\ModSec64.wxs" -arch x64 -dModSecurityIISRelease64="iis\release\amd64\" -out iis\
|
||||
candle.exe -ext WixUtilExtension -ext WixUIExtension "iis\ModSec32.wxs" -arch x86 -dModSecurityIISRelease32="iis\release\x86\" -out iis\
|
||||
light.exe -ext WixUtilExtension -ext WixUIExtension "iis\installer.wixobj" "iis\ModSec32.wixobj" "iis\ModSec64.wixobj" -out "iis\modsecurityiis.msi"
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: modsecurityiis-installers-${{ matrix.config }}
|
||||
path: iis/modsecurityiis.msi
|
||||
|
||||
test:
|
||||
needs: package
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
config: [Release, RelWithDebInfo]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Download MSI files
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: modsecurityiis-installers-${{ matrix.config }}
|
||||
path: ${{ github.workspace }}/
|
||||
|
||||
- name: Install MSI
|
||||
shell: pwsh
|
||||
run: |
|
||||
$msiPath = "${{ github.workspace }}\modsecurityiis.msi"
|
||||
if (-not (Test-Path $msiPath)) {
|
||||
Write-Error "MSI file not found at $msiPath"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Install with logging for debugging
|
||||
$installLog = "${{ github.workspace }}\install.log"
|
||||
$installResult = Start-Process -FilePath "msiexec.exe" -ArgumentList @(
|
||||
"/i", "`"$msiPath`"",
|
||||
"/qn",
|
||||
"/norestart",
|
||||
"/l*", "`"$installLog`""
|
||||
) -Wait -PassThru
|
||||
|
||||
if ($installResult.ExitCode -ne 0) {
|
||||
Write-Error "MSI installation failed with exit code $($installResult.ExitCode)"
|
||||
Get-Content $installLog | Write-Host
|
||||
exit 1
|
||||
}
|
||||
|
||||
$installDir = "C:\Program Files\ModSecurity IIS"
|
||||
$requiredFiles = @(
|
||||
"modsecurity.conf",
|
||||
"modsecurity_iis.conf"
|
||||
)
|
||||
|
||||
foreach ($file in $requiredFiles) {
|
||||
$filePath = Join-Path $installDir $file
|
||||
if (-not (Test-Path $filePath)) {
|
||||
Write-Error "Required file $file not found in installation directory"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
- name: Install OWASP Core Rules
|
||||
shell: pwsh
|
||||
run: |
|
||||
$crsVersion = "v4.18.0"
|
||||
$crsUrl = "https://github.com/coreruleset/coreruleset/archive/refs/tags/$crsVersion.tar.gz"
|
||||
$crsDir = "C:\Program Files\ModSecurity IIS\coreruleset"
|
||||
$modSecurityConfigDir = "C:\Program Files\ModSecurity IIS"
|
||||
|
||||
try {
|
||||
New-Item -ItemType Directory -Path $crsDir -Force
|
||||
Invoke-WebRequest -Uri $crsUrl -OutFile "$crsDir\$crsVersion.tar.gz"
|
||||
tar -xzf "$crsDir\$crsVersion.tar.gz" -C $crsDir --strip-components=1
|
||||
|
||||
Get-ChildItem "$crsDir" -Recurse -Filter "*.example" | ForEach-Object {
|
||||
$newName = $_.Name.Replace(".example", "")
|
||||
Rename-Item -Path $_.FullName -NewName $newName
|
||||
}
|
||||
|
||||
$modSecurityConfigFile = "$modSecurityConfigDir\modsecurity_iis.conf"
|
||||
|
||||
$crsRules = @(
|
||||
"Include coreruleset/crs-setup.conf",
|
||||
"Include coreruleset/plugins/*-config.conf",
|
||||
"Include coreruleset/plugins/*-before.conf",
|
||||
"Include coreruleset/rules/*.conf",
|
||||
"Include coreruleset/plugins/*-after.conf"
|
||||
)
|
||||
|
||||
Add-Content -Path $modSecurityConfigFile -Value $crsRules
|
||||
|
||||
(Get-Content -Path $modSecurityConfigDir\modsecurity.conf) -replace 'SecRuleEngine DetectionOnly', 'SecRuleEngine On' | Set-Content -Path $modSecurityConfigDir\modsecurity.conf
|
||||
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to install OWASP Core Rules: $($_.Exception.Message)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Test IIS Module
|
||||
shell: pwsh
|
||||
run: |
|
||||
$iisConfigDir = "C:\Program Files\ModSecurity IIS\"
|
||||
|
||||
Restart-Service W3SVC -Force
|
||||
|
||||
$modules = & "$env:SystemRoot\system32\inetsrv\appcmd.exe" list modules
|
||||
Write-Host "IIS modules: $modules"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "appcmd failed with exit code $LASTEXITCODE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (-not ($modules -match "ModSecurity")) {
|
||||
Write-Error "ModSecurity module not found in IIS modules"
|
||||
Write-Host "IIS modules: $modules"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$testCases = @(
|
||||
@{Url = "http://localhost/"; Description = "Normal request"; ExpectedCode = 200},
|
||||
@{Url = "http://localhost/?id=1' OR '1'='1"; Description = "SQL injection attempt"; ExpectedCode = 403},
|
||||
@{Url = "http://localhost/?q=<script>alert('test')</script>"; Description = "XSS attempt"; ExpectedCode = 403}
|
||||
)
|
||||
|
||||
foreach ($test in $testCases) {
|
||||
try {
|
||||
$response = Invoke-WebRequest $test.Url -UseBasicParsing -SkipHttpErrorCheck -TimeoutSec 30
|
||||
|
||||
if ($response.StatusCode -eq $test.ExpectedCode) {
|
||||
Write-Host "PASS: $($test.Description) - returned $($response.StatusCode)"
|
||||
}
|
||||
else {
|
||||
Write-Host "FAIL: $($test.Description) - expected $($test.ExpectedCode) but got $($response.StatusCode)"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "ERROR: $($test.Description) - request failed: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Check event log
|
||||
$badMessagePattern = 'Failed to find the RegisterModule entrypoint|The description for Event ID|The data is the error|dll failed to load'
|
||||
|
||||
$events = Get-EventLog -LogName Application -Newest 100 |
|
||||
Where-Object { $_.Message -match $badMessagePattern } |
|
||||
Where-Object { $_.Source -match 'IIS|W3SVC|mscor|IIS-W3SVC|IIS-W3WP|ModSecurity' }
|
||||
|
||||
if ($events -and $events.Count -gt 0) {
|
||||
Write-Host '::error:: Found errors in event log'
|
||||
$events | Select-Object TimeGenerated, Source, EntryType, EventID, Message | Format-List
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Get-EventLog -LogName Application -Source ModSecurity | Format-List
|
||||
|
||||
- name: Install go-ftw
|
||||
shell: pwsh
|
||||
run: |
|
||||
go install github.com/coreruleset/go-ftw@latest
|
||||
|
||||
# Certain rules are disabled due to specific IIS behavior patterns.
|
||||
# Using go-ftw in cloud mode as the IIS connector does not generate logs in file format.
|
||||
# Technically, Event logs can be streamed to files, but this requires implementing rate limits to avoid log overflow.
|
||||
- name: Test ModSecurity Rules
|
||||
shell: pwsh
|
||||
run: |
|
||||
$testRuleDir = "C:\Program Files\ModSecurity IIS\coreruleset\tests\regression\tests"
|
||||
$goBinPath = ""
|
||||
if ($env:GOBIN) {
|
||||
$goBinPath = $env:GOBIN
|
||||
} elseif ($env:GOPATH) {
|
||||
$goBinPath = Join-Path $env:GOPATH "bin"
|
||||
} else {
|
||||
$goBinPath = Join-Path $env:USERPROFILE "go\bin"
|
||||
}
|
||||
|
||||
& "$goBinPath\go-ftw.exe" run -d $testRuleDir --cloud -e "920100-2$|920100-4$|920100-8$|920100-12$|920272-5$|920290-1$|920620-1$|920380-1$" --show-failures-only
|
||||
|
||||
1
iis/.gitignore
vendored
Normal file
1
iis/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
build/
|
||||
348
iis/CMakeLists.txt
Normal file
348
iis/CMakeLists.txt
Normal file
@@ -0,0 +1,348 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(ModSecurityIIS C CXX)
|
||||
|
||||
find_package(LibXml2 CONFIG REQUIRED)
|
||||
find_package(PCRE2 CONFIG REQUIRED)
|
||||
find_package(CURL CONFIG REQUIRED)
|
||||
find_package(APR CONFIG REQUIRED)
|
||||
|
||||
set(IIS_MODULE_NAME "modsecurityiis")
|
||||
|
||||
set(IIS_APACHE_SOURCES
|
||||
../apache2/mod_security2.c
|
||||
../apache2/apache2_config.c
|
||||
../apache2/apache2_io.c
|
||||
../apache2/apache2_util.c
|
||||
../apache2/re.c
|
||||
../apache2/re_operators.c
|
||||
../apache2/re_actions.c
|
||||
../apache2/re_tfns.c
|
||||
../apache2/re_variables.c
|
||||
../apache2/msc_logging.c
|
||||
../apache2/msc_xml.c
|
||||
../apache2/msc_multipart.c
|
||||
../apache2/modsecurity.c
|
||||
../apache2/msc_parsers.c
|
||||
../apache2/msc_util.c
|
||||
../apache2/msc_pcre.c
|
||||
../apache2/persist_dbm.c
|
||||
../apache2/msc_reqbody.c
|
||||
../apache2/msc_geo.c
|
||||
../apache2/msc_gsb.c
|
||||
../apache2/msc_crypt.c
|
||||
../apache2/msc_tree.c
|
||||
../apache2/msc_unicode.c
|
||||
../apache2/acmp.c
|
||||
../apache2/msc_lua.c
|
||||
../apache2/msc_release.c
|
||||
../apache2/msc_status_engine.c
|
||||
../apache2/msc_remote_rules.c
|
||||
../apache2/msc_json.c
|
||||
../apache2/libinjection/libinjection_html5.c
|
||||
../apache2/libinjection/libinjection_sqli.c
|
||||
../apache2/libinjection/libinjection_xss.c
|
||||
)
|
||||
|
||||
set(IIS_STANDALONE_SOURCES
|
||||
../standalone/api.c
|
||||
../standalone/buckets.c
|
||||
../standalone/config.c
|
||||
../standalone/filters.c
|
||||
../standalone/hooks.c
|
||||
../standalone/regex.c
|
||||
../standalone/server.c
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(ARCHITECTURE "x64")
|
||||
else()
|
||||
set(ARCHITECTURE "x86")
|
||||
endif()
|
||||
|
||||
set(IIS_RESOURCE_MC "${CMAKE_CURRENT_SOURCE_DIR}/ModSecurityIISMessage.mc")
|
||||
|
||||
set(MC_GENERATED_RC "${CMAKE_CURRENT_BINARY_DIR}/ModSecurityIISMessage.rc")
|
||||
set(MC_GENERATED_H "${CMAKE_CURRENT_BINARY_DIR}/ModSecurityIISMessage.h")
|
||||
add_custom_command(
|
||||
OUTPUT ${MC_GENERATED_RC} ${MC_GENERATED_H}
|
||||
COMMAND mc.exe
|
||||
ARGS -U -h "${CMAKE_CURRENT_BINARY_DIR}/" -r "${CMAKE_CURRENT_BINARY_DIR}/" "${IIS_RESOURCE_MC}"
|
||||
DEPENDS "${IIS_RESOURCE_MC}"
|
||||
COMMENT "Generating resource files from ${IIS_RESOURCE_MC}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# Source files for IIS-specific components
|
||||
set(IIS_MODULE_SOURCES
|
||||
main.cpp
|
||||
moduleconfig.cpp
|
||||
mymodule.cpp
|
||||
mymodule.def
|
||||
${MC_GENERATED_RC}
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
${MC_GENERATED_RC}
|
||||
${MC_GENERATED_H}
|
||||
PROPERTIES GENERATED TRUE
|
||||
)
|
||||
|
||||
add_library(${IIS_MODULE_NAME} SHARED
|
||||
${IIS_APACHE_SOURCES}
|
||||
${IIS_STANDALONE_SOURCES}
|
||||
${IIS_MODULE_SOURCES}
|
||||
)
|
||||
|
||||
# Set the output name and extension
|
||||
set_target_properties(${IIS_MODULE_NAME} PROPERTIES
|
||||
OUTPUT_NAME ${IIS_MODULE_NAME}
|
||||
PREFIX ""
|
||||
SUFFIX ".dll"
|
||||
)
|
||||
|
||||
target_include_directories(${IIS_MODULE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../apache2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../apache2/libinjection
|
||||
${LIBXML2_INCLUDE_DIR}/libxml
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../standalone
|
||||
${PCRE2_INCLUDE_DIRS}
|
||||
${CURL_INCLUDE_DIRS}
|
||||
${APR_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
if(APACHE_ROOT)
|
||||
if(NOT EXISTS "${APACHE_ROOT}")
|
||||
message(FATAL_ERROR "APACHE_ROOT is defined but the directory '${APACHE_ROOT}' does not exist. Please set APACHE_ROOT to a valid Apache installation directory.")
|
||||
endif()
|
||||
if(NOT EXISTS "${APACHE_ROOT}/lib")
|
||||
message(FATAL_ERROR "APACHE_ROOT/lib directory does not exist. Expected: '${APACHE_ROOT}/lib'. Please ensure Apache libraries are available.")
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${APACHE_ROOT}" APACHE_ROOT)
|
||||
|
||||
# Create imported targets for Apache libraries
|
||||
add_library(Apache::httpd SHARED IMPORTED)
|
||||
set_target_properties(Apache::httpd PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${APACHE_ROOT}/include"
|
||||
IMPORTED_IMPLIB "${APACHE_ROOT}/lib/libhttpd.lib"
|
||||
IMPORTED_LOCATION "${APACHE_ROOT}/bin/libhttpd.dll"
|
||||
)
|
||||
|
||||
add_library(Apache::apr SHARED IMPORTED)
|
||||
set_target_properties(Apache::apr PROPERTIES
|
||||
IMPORTED_IMPLIB "${APACHE_ROOT}/lib/libapr-1.lib"
|
||||
IMPORTED_LOCATION "${APACHE_ROOT}/bin/libapr-1.dll"
|
||||
)
|
||||
|
||||
add_library(Apache::aprutil SHARED IMPORTED)
|
||||
set_target_properties(Apache::aprutil PROPERTIES
|
||||
IMPORTED_IMPLIB "${APACHE_ROOT}/lib/libaprutil-1.lib"
|
||||
IMPORTED_LOCATION "${APACHE_ROOT}/bin/libaprutil-1.dll"
|
||||
)
|
||||
|
||||
add_library(Apache::apriconv SHARED IMPORTED)
|
||||
set_target_properties(Apache::apriconv PROPERTIES
|
||||
IMPORTED_IMPLIB "${APACHE_ROOT}/lib/libapriconv-1.lib"
|
||||
IMPORTED_LOCATION "${APACHE_ROOT}/bin/libapriconv-1.dll"
|
||||
)
|
||||
|
||||
target_include_directories(${IIS_MODULE_NAME} PRIVATE
|
||||
${APACHE_ROOT}/include
|
||||
)
|
||||
endif()
|
||||
|
||||
set(MODSECURITY_VERSION_FLAG "VERSION_IIS") # Define the version flag string
|
||||
target_compile_definitions(${IIS_MODULE_NAME} PRIVATE
|
||||
inline=APR_INLINE
|
||||
AP_DECLARE_STATIC
|
||||
WITH_CURL
|
||||
WITH_REMOTE_RULES
|
||||
MSC_LARGE_STREAM_INPUT
|
||||
WITH_YAJL
|
||||
${MODSECURITY_VERSION_FLAG}
|
||||
)
|
||||
|
||||
option(WITH_LUA "Enable Lua support" OFF)
|
||||
if(WITH_LUA)
|
||||
find_package(Lua CONFIG REQUIRED)
|
||||
target_compile_definitions(${IIS_MODULE_NAME} PRIVATE WITH_LUA)
|
||||
target_include_directories(${IIS_MODULE_NAME} PRIVATE ${LUA_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
option(WITH_YAJL "Enable YAJL support" OFF)
|
||||
if(WITH_YAJL)
|
||||
# Manually find YAJL if config.cmake is not available (e.g., from vcpkg)
|
||||
find_path(YAJL_INCLUDE_DIR yajl/yajl_common.h
|
||||
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build/vcpkg_installed/${ARCHITECTURE}-windows/include"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_library(YAJL_LIBRARY NAMES yajl
|
||||
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build/vcpkg_installed/${ARCHITECTURE}-windows/lib"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
|
||||
set(YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR})
|
||||
set(YAJL_LIBRARIES ${YAJL_LIBRARY})
|
||||
target_compile_definitions(${IIS_MODULE_NAME} PRIVATE WITH_YAJL)
|
||||
target_include_directories(${IIS_MODULE_NAME} PRIVATE ${YAJL_INCLUDE_DIRS})
|
||||
else()
|
||||
message(WARNING "YAJL not found. YAJL_INCLUDE_DIR: '${YAJL_INCLUDE_DIR}', YAJL_LIBRARY: '${YAJL_LIBRARY}'. Please ensure yajl is installed via vcpkg in the vcpkg_installed directory. Disabling YAJL support.")
|
||||
option(WITH_YAJL "Enable YAJL support" OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(WITH_SSDEEP "Enable SSDEEP support" OFF)
|
||||
if(WITH_SSDEEP)
|
||||
|
||||
if(NOT EXISTS "${SSDEEP_ROOT}")
|
||||
message(WARNING "SSDEEP_ROOT is not defined or path does not exist. Current SSDEEP_ROOT: '${SSDEEP_ROOT}'. Please set SSDEEP_ROOT to the ssdeep installation directory. Disabling SSDEEP support.")
|
||||
set(WITH_SSDEEP OFF CACHE BOOL "Enable SSDEEP support" FORCE)
|
||||
else()
|
||||
|
||||
file(TO_CMAKE_PATH "${SSDEEP_ROOT}" SSDEEP_ROOT)
|
||||
|
||||
find_path(SSDEEP_INCLUDE_DIR fuzzy.h
|
||||
PATHS "${SSDEEP_ROOT}"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if(SSDEEP_INCLUDE_DIR)
|
||||
target_compile_definitions(${IIS_MODULE_NAME} PRIVATE WITH_SSDEEP)
|
||||
target_include_directories(${IIS_MODULE_NAME} PRIVATE ${SSDEEP_INCLUDE_DIR})
|
||||
|
||||
set(SSDEEP_DEF_FILE "${SSDEEP_ROOT}/fuzzy.def")
|
||||
if(NOT EXISTS "${SSDEEP_DEF_FILE}")
|
||||
message(WARNING "fuzzy.def not found at ${SSDEEP_DEF_FILE}. Disabling SSDEEP support.")
|
||||
set(WITH_SSDEEP OFF CACHE BOOL "Enable SSDEEP support" FORCE)
|
||||
else()
|
||||
set(SSDEEP_GENERATED_LIB "${CMAKE_CURRENT_BINARY_DIR}/fuzzy.lib")
|
||||
set(SSDEEP_GENERATED_dll "${CMAKE_CURRENT_BINARY_DIR}/fuzzy.dll")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${SSDEEP_GENERATED_LIB}
|
||||
COMMAND lib.exe /machine:${ARCHITECTURE} /def:${SSDEEP_DEF_FILE} /out:${SSDEEP_GENERATED_LIB}
|
||||
DEPENDS "${SSDEEP_DEF_FILE}"
|
||||
COMMENT "Generating SSDEEP .lib from .def for MSVC"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
set_source_files_properties(${SSDEEP_GENERATED_LIB} PROPERTIES GENERATED TRUE)
|
||||
|
||||
add_custom_target(generate_ssdeep_lib ALL
|
||||
DEPENDS ${SSDEEP_GENERATED_LIB}
|
||||
COMMENT "Ensuring ssdeep lib is generated"
|
||||
)
|
||||
|
||||
add_dependencies(${IIS_MODULE_NAME} generate_ssdeep_lib)
|
||||
|
||||
add_library(SSDEEP::fuzzy SHARED IMPORTED)
|
||||
set_target_properties(SSDEEP::fuzzy PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SSDEEP_INCLUDE_DIR}"
|
||||
IMPORTED_LOCATION "${SSDEEP_GENERATED_dll}"
|
||||
IMPORTED_IMPLIB "${SSDEEP_GENERATED_LIB}"
|
||||
)
|
||||
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "fuzzy.h not found at ${SSDEEP_INCLUDE_DIR}. Disabling SSDEEP support.")
|
||||
set(WITH_SSDEEP OFF CACHE BOOL "Enable SSDEEP support" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(${IIS_MODULE_NAME} PRIVATE
|
||||
/nologo
|
||||
/W3
|
||||
/wd4244
|
||||
/wd4018
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${IIS_MODULE_NAME} PRIVATE
|
||||
LibXml2::LibXml2
|
||||
PCRE2::8BIT
|
||||
CURL::libcurl
|
||||
ws2_32
|
||||
iphlpapi
|
||||
)
|
||||
|
||||
if(APACHE_ROOT)
|
||||
target_link_libraries(${IIS_MODULE_NAME} PRIVATE
|
||||
Apache::httpd
|
||||
Apache::apr
|
||||
Apache::aprutil
|
||||
Apache::apriconv
|
||||
)
|
||||
else()
|
||||
message(WARNING "APACHE_ROOT is not defined or path does not exist. Current APACHE_ROOT: '${APACHE_ROOT}'. Please set APACHE_ROOT to the Apache installation directory.")
|
||||
endif()
|
||||
|
||||
if(WITH_LUA)
|
||||
target_link_libraries(${IIS_MODULE_NAME} PRIVATE ${LUA_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WITH_YAJL)
|
||||
target_link_libraries(${IIS_MODULE_NAME} PRIVATE ${YAJL_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WITH_SSDEEP AND SSDEEP_INCLUDE_DIR AND SSDEEP_GENERATED_LIB)
|
||||
target_link_libraries(${IIS_MODULE_NAME} PRIVATE SSDEEP::fuzzy)
|
||||
endif()
|
||||
|
||||
if(APACHE_ROOT AND EXISTS "${APACHE_ROOT}/bin")
|
||||
add_custom_command(TARGET ${IIS_MODULE_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${APACHE_ROOT}/bin/libhttpd.dll"
|
||||
$<TARGET_FILE_DIR:${IIS_MODULE_NAME}>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${APACHE_ROOT}/bin/libaprutil-1.dll"
|
||||
$<TARGET_FILE_DIR:${IIS_MODULE_NAME}>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${APACHE_ROOT}/bin/libapriconv-1.dll"
|
||||
$<TARGET_FILE_DIR:${IIS_MODULE_NAME}>
|
||||
COMMENT "Copying Apache DLLs to output directory"
|
||||
)
|
||||
else()
|
||||
message(WARNING "APACHE_ROOT is not defined or path does not exist. Current APACHE_ROOT: '${APACHE_ROOT}'. Please set APACHE_ROOT to the Apache installation directory.")
|
||||
endif()
|
||||
|
||||
if(WITH_SSDEEP AND SSDEEP_ROOT AND EXISTS "${SSDEEP_ROOT}/fuzzy.dll")
|
||||
add_custom_command(TARGET ${IIS_MODULE_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${SSDEEP_ROOT}/fuzzy.dll"
|
||||
$<TARGET_FILE_DIR:${IIS_MODULE_NAME}>
|
||||
COMMENT "Copying SSDEEP DLL to output directory"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# Install target - copy to release files directory
|
||||
install(TARGETS ${IIS_MODULE_NAME}
|
||||
RUNTIME DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
)
|
||||
|
||||
if(APACHE_ROOT AND EXISTS "${APACHE_ROOT}/bin")
|
||||
install(FILES
|
||||
"${APACHE_ROOT}/bin/libhttpd.dll"
|
||||
"${APACHE_ROOT}/bin/libaprutil-1.dll"
|
||||
"${APACHE_ROOT}/bin/libapriconv-1.dll"
|
||||
DESTINATION .
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_SSDEEP AND SSDEEP_ROOT AND EXISTS "${SSDEEP_ROOT}/fuzzy.dll")
|
||||
install(FILES
|
||||
"${SSDEEP_ROOT}/fuzzy.dll"
|
||||
DESTINATION .
|
||||
)
|
||||
endif()
|
||||
|
||||
# Also install the PDB file if it's generated
|
||||
install(FILES $<TARGET_PDB_FILE:${IIS_MODULE_NAME}> DESTINATION . OPTIONAL)
|
||||
@@ -25,9 +25,11 @@
|
||||
<RegistrySearch Id="ConfigureIISRegistrySearch" Type="raw" Root="HKLM" Key="SOFTWARE\ModSecurity\ModSecurity" Name="ModSecurityConfigureIIS" Win64="no" />
|
||||
</Property>
|
||||
<?endif?>
|
||||
<!-- Detect the major version of IIS -->
|
||||
<Property Id="IIS">
|
||||
<RegistrySearch Id="IISInstalledVersion" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Type="raw" Name="MajorVersion" />
|
||||
</Property>
|
||||
<!-- Detect if ModSecurity IIS module and its dependent DLL files exist -->
|
||||
<Property Id="FILEEXISTS" Secure="yes">
|
||||
<DirectorySearch Id="CheckFileDir1" Path="C:\Windows\System32\inetsrv" Depth="0">
|
||||
<FileSearch Id="CheckFile1" Name="ModSecurityIIS.dll" />
|
||||
@@ -87,24 +89,28 @@
|
||||
<FileSearch Id="CheckFile19" Name="fuzzy.dll" />
|
||||
</DirectorySearch>
|
||||
</Property>
|
||||
<!-- Detect the WWW root directory of IIS -->
|
||||
<Property Id="WWWROOT">
|
||||
<RegistrySearch Id="FindInetPubFolder" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Name="PathWWWRoot" Type="directory" />
|
||||
</Property>
|
||||
<!-- Define MSI properties, enable real administrator detection for MSI, and disable repair and modify options in "Programs and Features" -->
|
||||
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
|
||||
<!-- Define installation conditions -->
|
||||
<Condition Message="This setup requires IIS 7.0, 8.0 or 10.0. If that's the case, please ensure that the installer is running as administrator or try running it from the 'Apps and features' or 'Add/Remove Programs' menu"><![CDATA[(IIS="#7") OR (IIS="#8") OR (IIS="#10")]]></Condition>
|
||||
<!-- Version 2.7.5 had an uninstall issue that leaves some files behind. Asking the user to manually hash this out. -->
|
||||
<Condition Message="A older version of ModSecurityIIS was found in your computer. Please complete uninstall by removing the following file: [FILEEXISTS]. You may have to remove ModSecurity module from IIS, use the IIS Manager to do so."><![CDATA[(NOT FILEEXISTS) OR (Installed)]]></Condition>
|
||||
<Condition Message="64-bit operating system was detected, please use the 64-bit installer.">
|
||||
<!-- - Defines 64/32-bit ModSecurity IIS module and its dependent DLL file components and IIS configuration Schema directory through conditional compilation. -->
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
VersionNT64
|
||||
<?else?>
|
||||
NOT VersionNT64
|
||||
<?endif?></Condition>
|
||||
|
||||
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />
|
||||
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
|
||||
|
||||
<!-- Define media information for the installation package -->
|
||||
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
|
||||
<!-- Define the directory structure of the installation package -->
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<Directory Id="SystemFolder" Name="SystemFolder">
|
||||
@@ -131,401 +137,73 @@
|
||||
</Directory>
|
||||
<?endif?>
|
||||
<Directory Id="$(var.PlatformProgramFilesFolder)">
|
||||
<Directory Id="INSTALLFOLDER" Name="ModSecurity IIS">
|
||||
<!--
|
||||
<Component Id="OWASP_CRS_V_3_0_2_SETUP" DiskId="1" Guid="64629082-F6A2-4675-9E3E-4EA363CD6500">
|
||||
<File Id="CRS_SETUP.CONF.EXAMPLE" Name="crs-setup.conf.example" Source="release\owasp_crs\crs-setup.conf.example" />
|
||||
</Component>
|
||||
-->
|
||||
<!--
|
||||
<Directory Id="OWASP_CRS" Name="owasp_crs">
|
||||
<Component Id="OWASP_CRS_V_3_0_2" DiskId="1" Guid="64629082-F6A2-4675-9E3E-4EA363CD6502">
|
||||
<File Id="CHANGES" Name="CHANGES" Source="release\owasp_crs\CHANGES" />
|
||||
<File Id="CONTRIBUTORS" Name="CONTRIBUTORS" Source="release\owasp_crs\CONTRIBUTORS" />
|
||||
<File Id="IDNUMBERING" Name="IDNUMBERING" Source="release\owasp_crs\IDNUMBERING" />
|
||||
<File Id="INSTALL" Name="INSTALL" Source="release\owasp_crs\INSTALL" />
|
||||
<File Id="LICENSE" Name="LICENSE" Source="release\owasp_crs\LICENSE" />
|
||||
<File Id="KNOWN_BUGS" Name="KNOWN_BUGS" Source="release\owasp_crs\KNOWN_BUGS" />
|
||||
<File Id="README.MD" Name="README.md" Source="release\owasp_crs\README.md" />
|
||||
</Component>
|
||||
<Directory Id="DOCUMENTATION" Name="documentation">
|
||||
<Component Id="README" DiskId="1" Guid="F06FC044-52E6-412E-80E6-6644486A522B">
|
||||
<File Id="README" Name="README" Source="release\owasp_crs\documentation\README" />
|
||||
</Component>
|
||||
<Directory Id="OWASP_CRS_DOCUMENTATION" Name="OWASP-CRS-Documentation">
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="ID_RENUMBERING" Name="id_renumbering">
|
||||
<Component Id="ID_NUMBERING" DiskId="1" Guid="F06FC044-52E6-412E-80E6-6644486A522D">
|
||||
<File Id="IDNUMBERING_1" Name="IDNUMBERING" Source="release\owasp_crs\id_renumbering\IDNUMBERING" />
|
||||
<File Id="IDNUMBERING.CSV" Name="IdNumbering.csv" Source="release\owasp_crs\id_renumbering\IdNumbering.csv" />
|
||||
<File Id="UPDATE.PY" Name="update.py" Source="release\owasp_crs\id_renumbering\update.py" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="RULES" Name="rules">
|
||||
<Component Id="RULES" DiskId="1" Guid="66EB7DE9-E12D-4360-B096-75CAB0498E88">
|
||||
<File Id="CRAWLERS_USER_AGENTS.DATA" Name="crawlers-user-agents.data" Source="release\owasp_crs\rules\crawlers-user-agents.data" />
|
||||
<File Id="IIS_ERRORS.DATA" Name="iis-errors.data" Source="release\owasp_crs\rules\iis-errors.data" />
|
||||
<File Id="JAVA_CODE_LEAKAGES.DATA" Name="java-code-leakages.data" Source="release\owasp_crs\rules\java-code-leakages.data" />
|
||||
<File Id="JAVA_ERRORS.DATA" Name="java-errors.data" Source="release\owasp_crs\rules\java-errors.data" />
|
||||
<File Id="LFI_OS_FILES.DATA" Name="lfi-os-files.data" Source="release\owasp_crs\rules\lfi-os-files.data" />
|
||||
<File Id="PHP_CONFIG_DIRECTIVES.DATA" Name="php-config-directives.data" Source="release\owasp_crs\rules\php-config-directives.data" />
|
||||
<File Id="PHP_ERRORS.DATA" Name="php-errors.data" Source="release\owasp_crs\rules\php-errors.data" />
|
||||
<File Id="PHP_FUNCTION_NAMES_933150.DATA" Name="php-function-names-933150.data" Source="release\owasp_crs\rules\php-function-names-933150.data" />
|
||||
<File Id="PHP_FUNCTION_NAMES_933151.DATA" Name="php-function-names-933151.data" Source="release\owasp_crs\rules\php-function-names-933151.data" />
|
||||
<File Id="PHP_VARIABLES.DATA" Name="php-variables.data" Source="release\owasp_crs\rules\php-variables.data" />
|
||||
<File Id="REQUEST_900_EXCLUSION_RULES_BEFORE_CRS.conf.example" Name="REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf" Source="release\owasp_crs\rules\REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf" />
|
||||
<File Id="REQUEST_901_INITIALIZATION.conf" Name="REQUEST-901-INITIALIZATION.conf" Source="release\owasp_crs\rules\REQUEST-901-INITIALIZATION.conf" />
|
||||
<File Id="REQUEST_903.9001_DRUPAL_EXCLUSION_RULES.conf" Name="REQUEST-903.9001-DRUPAL-EXCLUSION-RULES.conf" Source="release\owasp_crs\rules\REQUEST-903.9001-DRUPAL-EXCLUSION-RULES.conf" />
|
||||
<File Id="REQUEST_903.9002_WORDPRESS_EXCLUSION_RULES.conf" Name="REQUEST-903.9002-WORDPRESS-EXCLUSION-RULES.conf" Source="release\owasp_crs\rules\REQUEST-903.9002-WORDPRESS-EXCLUSION-RULES.conf" />
|
||||
<File Id="REQUEST_905_COMMON_EXCEPTIONS.conf" Name="REQUEST-905-COMMON-EXCEPTIONS.conf" Source="release\owasp_crs\rules\REQUEST-905-COMMON-EXCEPTIONS.conf" />
|
||||
<File Id="REQUEST_910_IP_REPUTATION.conf" Name="REQUEST-910-IP-REPUTATION.conf" Source="release\owasp_crs\rules\REQUEST-910-IP-REPUTATION.conf" />
|
||||
<File Id="REQUEST_911_METHOD_ENFORCEMENT.conf" Name="REQUEST-911-METHOD-ENFORCEMENT.conf" Source="release\owasp_crs\rules\REQUEST-911-METHOD-ENFORCEMENT.conf" />
|
||||
<File Id="REQUEST_912_DOS_PROTECTION.conf" Name="REQUEST-912-DOS-PROTECTION.conf" Source="release\owasp_crs\rules\REQUEST-912-DOS-PROTECTION.conf" />
|
||||
<File Id="REQUEST_913_SCANNER_DETECTION.conf" Name="REQUEST-913-SCANNER-DETECTION.conf" Source="release\owasp_crs\rules\REQUEST-913-SCANNER-DETECTION.conf" />
|
||||
<File Id="REQUEST_920_PROTOCOL_ENFORCEMENT.conf" Name="REQUEST-920-PROTOCOL-ENFORCEMENT.conf" Source="release\owasp_crs\rules\REQUEST-920-PROTOCOL-ENFORCEMENT.conf" />
|
||||
<File Id="REQUEST_921_PROTOCOL_ATTACK.conf" Name="REQUEST-921-PROTOCOL-ATTACK.conf" Source="release\owasp_crs\rules\REQUEST-921-PROTOCOL-ATTACK.conf" />
|
||||
<File Id="REQUEST_930_APPLICATION_ATTACK_LFI.conf" Name="REQUEST-930-APPLICATION-ATTACK-LFI.conf" Source="release\owasp_crs\rules\REQUEST-930-APPLICATION-ATTACK-LFI.conf" />
|
||||
<File Id="REQUEST_931_APPLICATION_ATTACK_RFI.conf" Name="REQUEST-931-APPLICATION-ATTACK-RFI.conf" Source="release\owasp_crs\rules\REQUEST-931-APPLICATION-ATTACK-RFI.conf" />
|
||||
<File Id="REQUEST_932_APPLICATION_ATTACK_RCE.conf" Name="REQUEST-932-APPLICATION-ATTACK-RCE.conf" Source="release\owasp_crs\rules\REQUEST-932-APPLICATION-ATTACK-RCE.conf" />
|
||||
<File Id="REQUEST_933_APPLICATION_ATTACK_PHP.conf" Name="REQUEST-933-APPLICATION-ATTACK-PHP.conf" Source="release\owasp_crs\rules\REQUEST-933-APPLICATION-ATTACK-PHP.conf" />
|
||||
<File Id="REQUEST_941_APPLICATION_ATTACK_XSS.conf" Name="REQUEST-941-APPLICATION-ATTACK-XSS.conf" Source="release\owasp_crs\rules\REQUEST-941-APPLICATION-ATTACK-XSS.conf" />
|
||||
<File Id="REQUEST_942_APPLICATION_ATTACK_SQLI.conf" Name="REQUEST-942-APPLICATION-ATTACK-SQLI.conf" Source="release\owasp_crs\rules\REQUEST-942-APPLICATION-ATTACK-SQLI.conf" />
|
||||
<File Id="REQUEST_943_APPLICATION_ATTACK_SESSION_FIXATION.conf" Name="REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf" Source="release\owasp_crs\rules\REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf" />
|
||||
<File Id="REQUEST_949_BLOCKING_EVALUATION.conf" Name="REQUEST-949-BLOCKING-EVALUATION.conf" Source="release\owasp_crs\rules\REQUEST-949-BLOCKING-EVALUATION.conf" />
|
||||
<File Id="RESPONSE_950_DATA_LEAKAGES.conf" Name="RESPONSE-950-DATA-LEAKAGES.conf" Source="release\owasp_crs\rules\RESPONSE-950-DATA-LEAKAGES.conf" />
|
||||
<File Id="RESPONSE_951_DATA_LEAKAGES_SQL.conf" Name="RESPONSE-951-DATA-LEAKAGES-SQL.conf" Source="release\owasp_crs\rules\RESPONSE-951-DATA-LEAKAGES-SQL.conf" />
|
||||
<File Id="RESPONSE_952_DATA_LEAKAGES_JAVA.conf" Name="RESPONSE-952-DATA-LEAKAGES-JAVA.conf" Source="release\owasp_crs\rules\RESPONSE-952-DATA-LEAKAGES-JAVA.conf" />
|
||||
<File Id="RESPONSE_953_DATA_LEAKAGES_PHP.conf" Name="RESPONSE-953-DATA-LEAKAGES-PHP.conf" Source="release\owasp_crs\rules\RESPONSE-953-DATA-LEAKAGES-PHP.conf" />
|
||||
<File Id="RESPONSE_954_DATA_LEAKAGES_IIS.conf" Name="RESPONSE-954-DATA-LEAKAGES-IIS.conf" Source="release\owasp_crs\rules\RESPONSE-954-DATA-LEAKAGES-IIS.conf" />
|
||||
<File Id="RESPONSE_959_BLOCKING_EVALUATION.conf" Name="RESPONSE-959-BLOCKING-EVALUATION.conf" Source="release\owasp_crs\rules\RESPONSE-959-BLOCKING-EVALUATION.conf" />
|
||||
<File Id="RESPONSE_980_CORRELATION.conf" Name="RESPONSE-980-CORRELATION.conf" Source="release\owasp_crs\rules\RESPONSE-980-CORRELATION.conf" />
|
||||
<File Id="RESPONSE_999_EXCLUSION_RULES_AFTER_CRS.conf" Name="RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf" Source="release\owasp_crs\rules\RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf" />
|
||||
<File Id="RESTRICTED_FILES.DATA" Name="restricted-files.data" Source="release\owasp_crs\rules\restricted-files.data" />
|
||||
<File Id="SCANNERS_HEADERS.DATA" Name="scanners-headers.data" Source="release\owasp_crs\rules\scanners-headers.data" />
|
||||
<File Id="SCANNERS_URLS.DATA" Name="scanners-urls.data" Source="release\owasp_crs\rules\scanners-urls.data" />
|
||||
<File Id="SCANNERS_USER_AGENTS.DATA" Name="scanners-user-agents.data" Source="release\owasp_crs\rules\scanners-user-agents.data" />
|
||||
<File Id="SCRIPTING_USER_AGENTS.DATA" Name="scripting-user-agents.data" Source="release\owasp_crs\rules\scripting-user-agents.data" />
|
||||
<File Id="SQL_ERRORS.DATA" Name="sql-errors.data" Source="release\owasp_crs\rules\sql-errors.data" />
|
||||
<File Id="SQL_FUNCTION_NAMES.DATA" Name="sql-function-names.data" Source="release\owasp_crs\rules\sql-function-names.data" />
|
||||
<File Id="UNIX_SHELL.DATA" Name="unix-shell.data" Source="release\owasp_crs\rules\unix-shell.data" />
|
||||
<File Id="WINDOWS_POWERSHELL_COMMANDS.DATA" Name="windows-powershell-commands.data" Source="release\owasp_crs\rules\windows-powershell-commands.data" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="UTIL" Name="util">
|
||||
<Component Id="UTIL" DiskId="1" Guid="A95D50D7-4E87-4A87-BAD1-12370B8F5B9B">
|
||||
<File Id="ID_RANGE" Name="id-range" Source="release\owasp_crs\util\id-range" />
|
||||
<File Id="README_1" Name="README" Source="release\owasp_crs\util\README" />
|
||||
<File Id="UPGRADE.PY" Name="upgrade.py" Source="release\owasp_crs\util\upgrade.py" />
|
||||
<File Id="VERIFY.RB" Name="verify.rb" Source="release\owasp_crs\util\verify.rb" />
|
||||
</Component>
|
||||
<Directory Id="AV_SCANNING" Name="av-scanning">
|
||||
<Component Id="RUNAV" DiskId="1" Guid="398B0257-F78A-4F8C-B313-90D0F61581A9">
|
||||
<File Id="RUNAV.PL" Name="runav.pl" Source="release\owasp_crs\util\av-scanning\runav.pl" />
|
||||
</Component>
|
||||
<Directory Id="RUNAV" Name="runAV">
|
||||
<Component Id="RUNAV_RUNAV" DiskId="1" Guid="3EA0484E-5E42-43C3-B89B-71BCC89DBB4F">
|
||||
<File Id="COMMON.C" Name="common.c" Source="release\owasp_crs\util\av-scanning\runAV\common.c" />
|
||||
<File Id="COMMON.H" Name="common.h" Source="release\owasp_crs\util\av-scanning\runAV\common.h" />
|
||||
<File Id="COMP" Name="comp" Source="release\owasp_crs\util\av-scanning\runAV\comp" />
|
||||
<File Id="RUNAV_CLAMD.C" Name="runAV-clamd.c" Source="release\owasp_crs\util\av-scanning\runAV\runAV-clamd.c" />
|
||||
<File Id="RUNAV.C" Name="runAV.c" Source="release\owasp_crs\util\av-scanning\runAV\runAV.c" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="BROWSER_TOOLS" Name="browser-tools">
|
||||
<Component Id="BROWSER_TOOLS" DiskId="1" Guid="A81D4319-9C26-4E29-A0BD-FC2DED0045A7">
|
||||
<File Id="JS_OVERRIDES.JS" Name="js-overrides.js" Source="release\owasp_crs\util\browser-tools\js-overrides.js" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="DEBUG" Name="debug">
|
||||
<Component Id="DEBUG" DiskId="1" Guid="A81D4319-9C26-4E29-A0BD-FC2DED0045A8">
|
||||
<File Id="RESPONSE_981_DEBUG.CONF" Name="RESPONSE-981-DEBUG.conf" Source="release\owasp_crs\util\debug\RESPONSE-981-DEBUG.conf" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="GEO_LOCATION" Name="geo-location">
|
||||
<Component Id="GEO_LOCATION" DiskId="1" Guid="A81D4319-9C26-4E29-A0BD-FC2DED0045A9">
|
||||
<File Id="README_2" Name="README" Source="release\owasp_crs\util\geo-location\README" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="INTEGRATION" Name="integration">
|
||||
<Component Id="INTEGRATION" DiskId="1" Guid="A81D4319-9C26-4E29-A0BD-FC2DED0045B0">
|
||||
<File Id="FORMAT_TESTS.PY" Name="format_tests.py" Source="release\owasp_crs\util\integration\format_tests.py" />
|
||||
<File Id="REQUIREMENTS.TXT" Name="requirements.txt" Source="release\owasp_crs\util\integration\requirements.txt" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="JOIN_MULTILINE_RULES" Name="join-multiline-rules">
|
||||
<Component Id="JOIN_MULTILINE_RULES" DiskId="1" Guid="A81D4319-9C26-4E29-A0BD-FC2DED0045B1">
|
||||
<File Id="JOIN.PY" Name="join.py" Source="release\owasp_crs\util\join-multiline-rules\join.py" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="REGEXP_ASSEMBLE" Name="regexp-assemble">
|
||||
<Component Id="REGEXP_ASSEMBLE" DiskId="1" Guid="A81D4319-9C26-4E29-A0BD-FC2DED0045B2">
|
||||
<File Id="REGEXP_932130.DATA" Name="regexp-932130.data" Source="release\owasp_crs\util\regexp-assemble\regexp-932130.data" />
|
||||
<File Id="REGEXP_932140.DATA" Name="regexp-932140.data" Source="release\owasp_crs\util\regexp-assemble\regexp-932140.data" />
|
||||
<File Id="REGEXP_933131.DATA" Name="regexp-933131.data" Source="release\owasp_crs\util\regexp-assemble\regexp-933131.data" />
|
||||
<File Id="REGEXP_933160.DATA" Name="regexp-933160.data" Source="release\owasp_crs\util\regexp-assemble\regexp-933160.data" />
|
||||
<File Id="REGEXP_933161.DATA" Name="regexp-933161.data" Source="release\owasp_crs\util\regexp-assemble\regexp-933161.data" />
|
||||
<File Id="REGEXP_ASSEMBLE.PL" Name="regexp-assemble.pl" Source="release\owasp_crs\util\regexp-assemble\regexp-assemble.pl" />
|
||||
<File Id="REGEXP_932100.TXT" Name="regexp-932100.txt" Source="release\owasp_crs\util\regexp-assemble\regexp-932100.txt" />
|
||||
<File Id="REGEXP_932105.TXT" Name="regexp-932105.txt" Source="release\owasp_crs\util\regexp-assemble\regexp-932105.txt" />
|
||||
<File Id="REGEXP_932110.TXT" Name="regexp-932110.txt" Source="release\owasp_crs\util\regexp-assemble\regexp-932110.txt" />
|
||||
<File Id="REGEXP_932115.TXT" Name="regexp-932115.txt" Source="release\owasp_crs\util\regexp-assemble\regexp-932115.txt" />
|
||||
<File Id="REGEXP_932150.TXT" Name="regexp-932150.txt" Source="release\owasp_crs\util\regexp-assemble\regexp-932150.txt" />
|
||||
<File Id="REGEXP_CMDLINE.PY" Name="regexp-cmdline.py" Source="release\owasp_crs\util\regexp-assemble\regexp-cmdline.py" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="HONEYPOT_SENSOR" Name="honeypot-sensor">
|
||||
<Component Id="HONEYPOT_SENSOR" DiskId="1" Guid="3D3DD51F-70FF-41CE-A756-2C2935A71BA8">
|
||||
<File Id="MLOGC_HONEYPOT_SENSOR.CONF" Name="mlogc-honeypot-sensor.conf" Source="release\owasp_crs\util\honeypot-sensor\mlogc-honeypot-sensor.conf" />
|
||||
<File Id="MODSECURITY_CRS_10_HONEYPOT.CONF" Name="modsecurity_crs_10_honeypot.conf" Source="release\owasp_crs\util\honeypot-sensor\modsecurity_crs_10_honeypot.conf" />
|
||||
<File Id="README.MD_1" Name="README.md" Source="release\owasp_crs\util\honeypot-sensor\README.md" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="REGRESSION_TESTS" Name="regression-tests">
|
||||
<Component Id="REGRESSION_TESTS" DiskId="1" Guid="02AF3C5A-DCF9-4DB6-A1C8-B1EF140C8EBC">
|
||||
<File Id="README_3" Name="README" Source="release\owasp_crs\util\regression-tests\README" />
|
||||
</Component>
|
||||
<Directory Id="OWASP_CRS_REGRESSIONS" Name="OWASP-CRS-regressions">
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="VIRTUAL_PATCHING" Name="virtual-patching">
|
||||
<Component Id="VIRTUAL_PATCHING" DiskId="1" Guid="DDDD3A2B-CEC1-42B3-9984-2987CA5BA311">
|
||||
<File Id="ARACHNI2MODSEC.PL" Name="arachni2modsec.pl" Source="release\owasp_crs\util\virtual-patching\arachni2modsec.pl" />
|
||||
<File Id="ZAP2MODSEC.PL" Name="zap2modsec.pl" Source="release\owasp_crs\util\virtual-patching\zap2modsec.pl" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
-->
|
||||
</Directory>
|
||||
<Directory Id="INSTALLFOLDER" Name="ModSecurity IIS"></Directory>
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ProgramMenuDir" Name="ModSecurity IIS">
|
||||
<Component Id="StartMenuShortcuts" Guid="43C26B13-C4D8-42F8-8715-3AF78E66C902">
|
||||
<util:InternetShortcut Id="WebsiteShortcut" Name="ModSecurity" Target="http://www.modsecurity.org/" />
|
||||
<!--<util:InternetShortcut Id="CSR" Name="OWASP ModSecurity Core Rule Set" Target="http://spIderlabs.github.io/owasp-modsecurity-crs/" />-->
|
||||
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
|
||||
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" />
|
||||
<Shortcut Id="UninstallProduct" Name="Uninstall" Description="Uninstalls the ModSecurity IIS" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />
|
||||
<Shortcut Id="EULA" Name="EULA" Description="EULA" Target="[INSTALLFOLDER]EULA.rtf" WorkingDirectory="INSTALLFOLDER" />
|
||||
<Shortcut Id="Readme" Name="EULA" Description="EULA" Target="[INSTALLFOLDER]README.TXT" WorkingDirectory="INSTALLFOLDER" />
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<Shortcut Id="List_Dependencies" Name="List Dependencies (Debug)" Description="Check for missing dependencies" Target="[INSTALLFOLDER]list_dependencies.bat" Arguments=""[inetsrv64]libapr-1.dll" "[inetsrv64]libapriconv-1.dll" "[inetsrv64]libaprutil-1.dll" "[inetsrv64]libcurl.dll" "[inetsrv64]libxml2.dll" "[inetsrv64]lua5.1.dll" "[inetsrv64]mlogc.exe" "[inetsrv64]ModSecurityIIS.dll" "[inetsrv64]pcre.dll" "[inetsrv64]zlib1.dll" "[inetsrv64]fuzzy.dll" "[inetsrv32]libapr-1.dll" "[inetsrv32]libapriconv-1.dll" "[inetsrv32]libaprutil-1.dll" "[inetsrv32]libcurl.dll" "[inetsrv32]libxml2.dll" "[inetsrv32]lua5.1.dll" "[inetsrv32]mlogc.exe" "[inetsrv32]ModSecurityIIS.dll" "[inetsrv32]pcre.dll" "[inetsrv32]zlib1.dll" "[inetsrv32]fuzzy.dll"" WorkingDirectory="INSTALLFOLDER" />
|
||||
<?else ?>
|
||||
<Shortcut Id="List_Dependencies" Name="List Dependencies (Debug)" Description="Check for missing dependencies" Target="[INSTALLFOLDER]list_dependencies.bat" Arguments=""[inetsrv32]libapr-1.dll" "[inetsrv32]libapriconv-1.dll" "[inetsrv32]libaprutil-1.dll" "[inetsrv32]libcurl.dll" "[inetsrv32]libxml2.dll" "[inetsrv32]lua5.1.dll" "[inetsrv32]mlogc.exe" "[inetsrv32]ModSecurityIIS.dll" "[inetsrv32]pcre.dll" "[inetsrv32]zlib1.dll" "[inetsrv32]fuzzy.dll"" WorkingDirectory="INSTALLFOLDER" />
|
||||
<?endif ?>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<DirectoryRef Id="INSTALLFOLDER"> <Component Id="ModSecCommon"
|
||||
DiskId="1" Guid="980270DF-81AB-469B-AB0E-64FA3BA160B6"
|
||||
Location="local"> <File Id="README.TXT"
|
||||
Name="README.TXT" Source="wix\README.TXT" />
|
||||
<File Id="EULA.RTF" Name="EULA.rtf"
|
||||
Source="wix\EULA.rtf" /> <File
|
||||
Id="modsecurity.conf" Name="modsecurity.conf"
|
||||
Source="wix\modsecurity.conf" />
|
||||
<File Id="modsecurity_iis.conf" Name="modsecurity_iis.conf"
|
||||
Source="wix\modsecurity_iis.conf" /> <File
|
||||
Id="unicode.mapping" Name="unicode.mapping"
|
||||
Source="wix\unicode.mapping" />
|
||||
<!-- <File Id="modsecurity_crs_10_setup.conf"
|
||||
Name="modsecurity_crs_10_setup.conf"
|
||||
Source="wix\modsecurity_crs_10_setup.conf" /> --> <File
|
||||
Id="LIST_DEPENDENCIES.BAT" Name="list_dependencies.bat"
|
||||
Source="wix\list_dependencies.bat" /> <File
|
||||
Id="ModSecurity.xml" Name="ModSecurity.xml"
|
||||
Source="ModSecurity.xml" />
|
||||
<!-- Modify ApplicationHost.config --> <util:XmlConfig
|
||||
Id="appHostEntry" File="$(var.ConfigFile)"
|
||||
Action="create"
|
||||
ElementPath="//configuration/configSections/sectionGroup[\[]@name='system.webServer'[\]]"
|
||||
VerifyPath="section[\[]@name='ModSecurity'[\]]"
|
||||
Name="section" Node="element" Sequence="1" On="install"
|
||||
/> <util:XmlConfig Id="appHostEntryName"
|
||||
File="$(var.ConfigFile)" ElementPath="appHostEntry"
|
||||
Name="name" Value="ModSecurity" Sequence="2" />
|
||||
<util:XmlConfig Id="appHostEntryOverrideMode"
|
||||
File="$(var.ConfigFile)" ElementPath="appHostEntry"
|
||||
Name="overrideModeDefault" Value="Allow" Sequence="3"
|
||||
/> <util:XmlConfig Id="appHostEntryAllowDefinition"
|
||||
File="$(var.ConfigFile)" ElementPath="appHostEntry"
|
||||
Name="allowDefinition" Value="Everywhere" Sequence="4"
|
||||
/> <util:XmlConfig Id="removeAppHostEntry"
|
||||
File="$(var.ConfigFile)" Action="delete"
|
||||
ElementPath="/configuration/configSections/sectionGroup[\[]@name='system.webServer'[\]]"
|
||||
Node="element"
|
||||
VerifyPath="section[\[]@name='ModSecurity'[\]]"
|
||||
On="uninstall" Sequence="1" /> <util:XmlConfig
|
||||
Id="removeAppHostEntry2" File="$(var.ConfigFile)"
|
||||
Action="delete"
|
||||
ElementPath="/configuration/system.webServer"
|
||||
Node="element"
|
||||
VerifyPath="/configuration/system.webServer/ModSecurity"
|
||||
Name="section" On="uninstall" Sequence="2" />
|
||||
<RegistryKey Root="HKLM" Key="SOFTWARE\ModSecurity\ModSecurity"
|
||||
Action="createAndRemoveOnUninstall"> <RegistryValue
|
||||
Type="string" Name="ModSecurityConfigureIIS"
|
||||
Value="[IIS_SETUP]" KeyPath="yes" />
|
||||
</RegistryKey> </Component> </DirectoryRef> <?if $(var.Win64) =
|
||||
"yes" ?> <DirectoryRef Id="inetsrv64"> <Component Id="ModSec64"
|
||||
DiskId="1"
|
||||
Guid="514A81F0-2413-42EF-B19F-E2613125ECE0"
|
||||
Win64="yes" Location="local"> <File
|
||||
Id="_64_LIBAPR_1" Name="libapr-1.dll"
|
||||
Source="Release\amd64\libapr-1.dll" />
|
||||
<File Id="_64_LIBAPRICONV_1"
|
||||
Name="libapriconv-1.dll"
|
||||
Source="Release\amd64\libapriconv-1.dll"
|
||||
/> <File Id="_64_LIBAPRUTIL_1"
|
||||
Name="libaprutil-1.dll"
|
||||
Source="Release\amd64\libaprutil-1.dll"
|
||||
/> <File Id="_64_LIBCURL"
|
||||
Name="libcurl.dll"
|
||||
Source="Release\amd64\libcurl.dll" />
|
||||
<File Id="_64_LIBXML2" Name="libxml2.dll"
|
||||
Source="Release\amd64\libxml2.dll" />
|
||||
<File Id="_64_LUA5.1" Name="lua5.1.dll"
|
||||
Source="Release\amd64\lua5.1.dll" />
|
||||
<File Id="_64_YAJL" Name="yajl.dll"
|
||||
Source="Release\amd64\yajl.dll" />
|
||||
<File Id="_64_MLOGC" Name="mlogc.exe"
|
||||
Source="Release\amd64\mlogc.exe" />
|
||||
<File Id="_64_MODSECURITYIIS"
|
||||
Name="ModSecurityIIS.dll"
|
||||
Source="Release\amd64\ModSecurityIIS.dll"
|
||||
/> <File Id="_64_PCRE" Name="pcre.dll"
|
||||
Source="Release\amd64\pcre.dll" />
|
||||
<File Id="_64_ZLIB1" Name="zlib1.dll"
|
||||
Source="Release\amd64\zlib1.dll" />
|
||||
<File Id="_64_FUZZY" Name="fuzzy.dll"
|
||||
Source="Release\amd64\fuzzy.dll" />
|
||||
<util:EventSource Name="ModSecurity" Log="Application"
|
||||
EventMessageFile="[inetsrv64]ModSecurityIIS.dll"
|
||||
KeyPath="yes" />
|
||||
</Component> </DirectoryRef> <DirectoryRef
|
||||
Id="inetsrv32"> <Component Id="ModSec32" DiskId="1"
|
||||
Guid="514A81F0-2413-42EF-B19F-E2613125ECE7"
|
||||
Win64="no" Location="local"> <File
|
||||
Id="_32_LIBAPR_1" Name="libapr-1.dll"
|
||||
Source="Release\x86\libapr-1.dll" />
|
||||
<File Id="_32_LIBAPRICONV_1"
|
||||
Name="libapriconv-1.dll"
|
||||
Source="Release\x86\libapriconv-1.dll"
|
||||
/> <File Id="_32_LIBAPRUTIL_1"
|
||||
Name="libaprutil-1.dll"
|
||||
Source="Release\x86\libaprutil-1.dll"
|
||||
/> <File Id="_32_LIBCURL"
|
||||
Name="libcurl.dll"
|
||||
Source="Release\x86\libcurl.dll" />
|
||||
<File Id="_32_LIBXML2" Name="libxml2.dll"
|
||||
Source="Release\x86\libxml2.dll" />
|
||||
<File Id="_32_LUA5.1" Name="lua5.1.dll"
|
||||
Source="Release\x86\lua5.1.dll" />
|
||||
<File Id="_32_YAJL" Name="yajl.dll"
|
||||
Source="Release\x86\yajl.dll" /> <File
|
||||
Id="_32_MLOGC" Name="mlogc.exe"
|
||||
Source="Release\x86\mlogc.exe" /> <File
|
||||
Id="_32_MODSECURITYIIS"
|
||||
Name="ModSecurityIIS.dll"
|
||||
Source="Release\x86\ModSecurityIIS.dll"
|
||||
/> <File Id="_32_PCRE" Name="pcre.dll"
|
||||
Source="Release\x86\pcre.dll" /> <File
|
||||
Id="_32_ZLIB1" Name="zlib1.dll"
|
||||
Source="Release\x86\zlib1.dll" /> <File
|
||||
Id="_32_FUZZY" Name="fuzzy.dll"
|
||||
Source="Release\x86\fuzzy.dll" />
|
||||
</Component> </DirectoryRef> <DirectoryRef
|
||||
Id="SystemFolderConfigSchema32"> <Component
|
||||
Id="ConfigSchema32"
|
||||
Guid="514A81F0-2413-42EF-B19F-E2613125EC11"
|
||||
Location="local" Win64="no"> <File
|
||||
Id="_32_ConfigSchema"
|
||||
Name="ModSecurity.xml"
|
||||
Source="ModSecurity.xml" />
|
||||
</Component> </DirectoryRef> <DirectoryRef
|
||||
Id="SystemFolderConfigSchema64"> <Component Id="ConfigSchema64"
|
||||
Guid="514A81F0-2413-42EF-B19F-E2613125EC22"
|
||||
Location="local" Win64="yes"> <File
|
||||
Id="_64_ConfigSchema" Name="ModSecurity.xml"
|
||||
Source="ModSecurity.xml" /> </Component>
|
||||
</DirectoryRef> <?else ?> <DirectoryRef Id="inetsrv32">
|
||||
<Component Id="ModSec32" DiskId="1"
|
||||
Guid="514A81F0-2413-42EF-B19F-E2613125ECE1"
|
||||
Win64="no" Location="local"> <File
|
||||
Id="_32_LIBAPR_1" Name="libapr-1.dll"
|
||||
Source="Release\x86\libapr-1.dll" />
|
||||
<File Id="_32_LIBAPRICONV_1"
|
||||
Name="libapriconv-1.dll"
|
||||
Source="Release\x86\libapriconv-1.dll"
|
||||
/> <File Id="_32_LIBAPRUTIL_1"
|
||||
Name="libaprutil-1.dll"
|
||||
Source="Release\x86\libaprutil-1.dll"
|
||||
/> <File Id="_32_LIBCURL"
|
||||
Name="libcurl.dll"
|
||||
Source="Release\x86\libcurl.dll" />
|
||||
<File Id="_32_LIBXML2" Name="libxml2.dll"
|
||||
Source="Release\x86\libxml2.dll" />
|
||||
<File Id="_32_LUA5.1" Name="lua5.1.dll"
|
||||
Source="Release\x86\lua5.1.dll" />
|
||||
<File Id="_32_YAJL" Name="yajl.dll"
|
||||
Source="Release\x86\yajl.dll" /> <File
|
||||
Id="_32_MLOGC" Name="mlogc.exe"
|
||||
Source="Release\x86\mlogc.exe" /> <File
|
||||
Id="_32_MODSECURITYIIS"
|
||||
Name="ModSecurityIIS.dll"
|
||||
Source="Release\x86\ModSecurityIIS.dll"
|
||||
/> <File Id="_32_PCRE" Name="pcre.dll"
|
||||
Source="Release\x86\pcre.dll" /> <File
|
||||
Id="_32_ZLIB1" Name="zlib1.dll"
|
||||
Source="Release\x86\zlib1.dll" /> <File
|
||||
Id="_32_FUZZY" Name="fuzzy.dll"
|
||||
Source="Release\x86\fuzzy.dll" />
|
||||
<util:EventSource Name="ModSecurity" Log="Application"
|
||||
EventMessageFile="[inetsrv32]ModSecurityIIS.dll"
|
||||
KeyPath="yes" />
|
||||
</Component> </DirectoryRef> <DirectoryRef
|
||||
Id="SystemFolderConfigSchema32"> <Component
|
||||
Id="ConfigSchema32"
|
||||
Guid="514A81F0-2413-42EF-B19F-E2613125EC11"
|
||||
Location="local" Win64="no"> <File
|
||||
Id="_32_ConfigSchema"
|
||||
Name="ModSecurity.xml"
|
||||
Source="ModSecurity.xml" />
|
||||
</Component> </DirectoryRef> <?endif ?> <Feature
|
||||
Id="DefaultFeature" Title="ModSecurity IIS Common files"
|
||||
Level="1" InstallDefault="local" Absent="disallow"
|
||||
Display="expand" AllowAdvertise="no" Description="Configuration
|
||||
and common files"> <ComponentRef Id="ModSecCommon" />
|
||||
<ComponentRef Id="ConfigSchema32" /> <?if $(var.Win64) = "yes"
|
||||
?> <ComponentRef Id="ConfigSchema64" /> <?endif ?>
|
||||
<!-- 12. Installation files and IIS configuration -->
|
||||
<DirectoryRef Id="INSTALLFOLDER">
|
||||
<Component Id="ModSecCommon" DiskId="1" Guid="980270DF-81AB-469B-AB0E-64FA3BA160B6" Location="local">
|
||||
<File Id="README.TXT" Name="README.TXT" Source="wix\README.TXT" />
|
||||
<File Id="EULA.RTF" Name="EULA.rtf" Source="wix\EULA.rtf" />
|
||||
<File Id="modsecurity.conf" Name="modsecurity.conf" Source="wix\modsecurity.conf" />
|
||||
<File Id="modsecurity_iis.conf" Name="modsecurity_iis.conf" Source="wix\modsecurity_iis.conf" />
|
||||
<File Id="unicode.mapping" Name="unicode.mapping" Source="wix\unicode.mapping" />
|
||||
<File Id="LIST_DEPENDENCIES.BAT" Name="list_dependencies.bat" Source="wix\list_dependencies.bat" />
|
||||
<File Id="ModSecurity.xml" Name="ModSecurity.xml" Source="ModSecurity.xml" />
|
||||
<!-- Modify ApplicationHost.config -->
|
||||
<util:XmlConfig Id="appHostEntry" File="$(var.ConfigFile)" Action="create" ElementPath="//configuration/configSections/sectionGroup[\[]@name='system.webServer'[\]]" VerifyPath="section[\[]@name='ModSecurity'[\]]" Name="section" Node="element" Sequence="1" On="install" />
|
||||
<util:XmlConfig Id="appHostEntryName" File="$(var.ConfigFile)" ElementPath="appHostEntry" Name="name" Value="ModSecurity" Sequence="2" />
|
||||
<util:XmlConfig Id="appHostEntryOverrideMode" File="$(var.ConfigFile)" ElementPath="appHostEntry" Name="overrideModeDefault" Value="Allow" Sequence="3" />
|
||||
<util:XmlConfig Id="appHostEntryAllowDefinition" File="$(var.ConfigFile)" ElementPath="appHostEntry" Name="allowDefinition" Value="Everywhere" Sequence="4" />
|
||||
<util:XmlConfig Id="removeAppHostEntry" File="$(var.ConfigFile)" Action="delete" ElementPath="/configuration/configSections/sectionGroup[\[]@name='system.webServer'[\]]" Node="element" VerifyPath="section[\[]@name='ModSecurity'[\]]" On="uninstall" Sequence="1" />
|
||||
<util:XmlConfig Id="removeAppHostEntry2" File="$(var.ConfigFile)" Action="delete" ElementPath="/configuration/system.webServer" Node="element" VerifyPath="/configuration/system.webServer/ModSecurity" Name="section" On="uninstall" Sequence="2" />
|
||||
<RegistryKey Root="HKLM" Key="SOFTWARE\ModSecurity\ModSecurity" Action="createAndRemoveOnUninstall">
|
||||
<RegistryValue Type="string" Name="ModSecurityConfigureIIS" Value="[IIS_SETUP]" KeyPath="yes" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="inetsrv64">
|
||||
<Component Id="ModSec64" DiskId="1" Guid="514A81F0-2413-42EF-B19F-E2613125ECE0" Win64="yes" Location="local">
|
||||
<util:EventSource Name="ModSecurity" Log="Application" EventMessageFile="[inetsrv64]ModSecurityIIS.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="inetsrv32">
|
||||
<Component Id="ModSec32" DiskId="1" Guid="514A81F0-2413-42EF-B19F-E2613125ECE1" Win64="no" Location="local">
|
||||
<util:EventSource Name="ModSecurity" Log="Application" EventMessageFile="[inetsrv32]ModSecurityIIS.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="SystemFolderConfigSchema32">
|
||||
<Component Id="ConfigSchema32" Guid="514A81F0-2413-42EF-B19F-E2613125EC11" Location="local" Win64="no">
|
||||
<File Id="_32_ConfigSchema" Name="ModSecurity.xml" Source="ModSecurity.xml" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="SystemFolderConfigSchema64">
|
||||
<Component Id="ConfigSchema64" Guid="514A81F0-2413-42EF-B19F-E2613125EC22" Location="local" Win64="yes">
|
||||
<File Id="_64_ConfigSchema" Name="ModSecurity.xml" Source="ModSecurity.xml" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
<!-- 14. Features define default installation features, including common ModSecurity files and configuration Schema. -->
|
||||
<Feature Id="DefaultFeature" Title="ModSecurity IIS Common files" Level="1" InstallDefault="local" Absent="disallow" Display="expand" AllowAdvertise="no" Description="Configuration
|
||||
and common files">
|
||||
<ComponentRef Id="ModSecCommon" />
|
||||
<ComponentRef Id="ConfigSchema32" />
|
||||
<?if $(var.Win64) = "yes"
|
||||
?>
|
||||
<ComponentRef Id="ConfigSchema64" />
|
||||
<?endif?>
|
||||
<ComponentRef Id="StartMenuShortcuts" />
|
||||
<!--
|
||||
<Feature Id="OWASP_ModSecurity_CRS_v3.0.2" Level="1" Title="OWASP
|
||||
ModSecurity CRS v3.0.2" InstallDefault="local" Display="expand"
|
||||
AllowAdvertise="no" Description="Install OWASP CRS v3.0.2">
|
||||
<ComponentRef Id="OWASP_CRS_V_3_0_2" /> <ComponentRef
|
||||
Id="OWASP_CRS_V_3_0_2_SETUP" />
|
||||
|
||||
<ComponentRef Id="ID_NUMBERING" />
|
||||
<ComponentRef Id="README" />
|
||||
<ComponentRef Id="RULES" />
|
||||
<ComponentRef Id="UTIL" />
|
||||
<ComponentRef Id="RUNAV" />
|
||||
<ComponentRef Id="RUNAV_RUNAV" />
|
||||
<ComponentRef Id="BROWSER_TOOLS" />
|
||||
<ComponentRef Id="DEBUG" />
|
||||
<ComponentRef Id="GEO_LOCATION" />
|
||||
<ComponentRef Id="INTEGRATION" />
|
||||
<ComponentRef Id="JOIN_MULTILINE_RULES" />
|
||||
<ComponentRef Id="REGEXP_ASSEMBLE" />
|
||||
<ComponentRef Id="HONEYPOT_SENSOR" />
|
||||
<ComponentRef Id="REGRESSION_TESTS" />
|
||||
<ComponentRef Id="VIRTUAL_PATCHING" />
|
||||
</Feature>
|
||||
-->
|
||||
</Feature>
|
||||
<Feature Id="VCRedist" Title="Visual C++ 12.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
@@ -541,13 +219,16 @@
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
<Feature Id="ModSec64" Title="ModSecurity IIS (64 bits)" Level="1" InstallDefault="local" Display="expand" AllowAdvertise="no" Description="This option will install ModSecurityIIS 64bits with all the necessary dependencies.">
|
||||
<ComponentRef Id="ModSec64" />
|
||||
<ComponentGroupRef Id="ModSec64Components" />
|
||||
</Feature>
|
||||
<Feature Id="ModSec32" Title="ModSecurity IIS (32 bits)" Level="1" InstallDefault="local" Display="expand" AllowAdvertise="no" Description="ModSecurityIIS 32bits with all the necessary dependencies. Application pools can be configured to run into 32bits mode even in a 64bits Windows. It is safe to keep both versions of ModSecurity (32 and 64bits) installed.">
|
||||
<ComponentRef Id="ModSec32" />
|
||||
<ComponentGroupRef Id="ModSec32Components" />
|
||||
</Feature>
|
||||
<?else?>
|
||||
<Feature Id="ModSec32" Title="ModSecurity IIS (32 bits)" Level="1" InstallDefault="local" Display="expand" AllowAdvertise="no" Description="This option will install ModSecurityIIS 32bits with all the necessary dependencies.">
|
||||
<ComponentRef Id="ModSec32" />
|
||||
<ComponentGroupRef Id="ModSec32Components" />
|
||||
</Feature>
|
||||
<?endif?>
|
||||
<UI Id="WixUI_FeatureTreeCustom">
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#undef inline
|
||||
#define inline inline
|
||||
|
||||
#include "winsock2.h"
|
||||
|
||||
// IIS7 Server API header file
|
||||
#include <Windows.h>
|
||||
#include <sal.h>
|
||||
@@ -30,8 +32,6 @@
|
||||
#include "api.h"
|
||||
#include "moduleconfig.h"
|
||||
|
||||
#include "winsock2.h"
|
||||
|
||||
|
||||
class REQUEST_STORED_CONTEXT : public IHttpStoredContext
|
||||
{
|
||||
|
||||
10
iis/vcpkg.json
Normal file
10
iis/vcpkg.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"curl",
|
||||
"libxml2",
|
||||
"lua",
|
||||
"pcre2",
|
||||
"yajl",
|
||||
"apr"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user