diff --git a/.github/workflows/publish-docker-container-ghp.yml b/.github/workflows/publish-docker-container-ghp.yml index 7c224ba..127f51f 100644 --- a/.github/workflows/publish-docker-container-ghp.yml +++ b/.github/workflows/publish-docker-container-ghp.yml @@ -92,7 +92,7 @@ jobs: org.opencontainers.image.title=Scan Virus (GitHub Action) Image (YARA) org.opencontainers.image.description=A Docker image for Scan Virus (GitHub Action) to scan Virus. - name: "Build & Push Docker Image - All" - uses: "docker/build-push-action@v5.1.0" + uses: "docker/build-push-action@v5.0.0" with: context: "./" file: "all.Dockerfile" @@ -103,7 +103,7 @@ jobs: push: "true" tags: "${{steps.docker-meta-all.outputs.tags}}" - name: "Build & Push Docker Image - ClamAV" - uses: "docker/build-push-action@v5.1.0" + uses: "docker/build-push-action@v5.0.0" with: context: "./" file: "clamav.Dockerfile" @@ -114,7 +114,7 @@ jobs: push: "true" tags: "${{steps.docker-meta-clamav.outputs.tags}}" - name: "Build & Push Docker Image - YARA" - uses: "docker/build-push-action@v5.1.0" + uses: "docker/build-push-action@v5.0.0" with: context: "./" file: "yara.Dockerfile" diff --git a/SECURITY.md b/SECURITY.md index 7011a73..b31d113 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,7 +20,6 @@ > **ℹ️ Notice:** > > - The date format is according to ISO 8601 standard. -> - Values in italic format are subject to change. > - Versions which not in the list are also end of life. ## Report Vulnerability diff --git a/all.Dockerfile b/all.Dockerfile index 27648f5..d1939dc 100644 --- a/all.Dockerfile +++ b/all.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update RUN apt-get --assume-yes install powershell RUN apt-get --assume-yes dist-upgrade RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] # Initialize ClamAV. COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/ diff --git a/all.alpine.Dockerfile b/all.alpine.Dockerfile index c514ff4..3ececf6 100644 --- a/all.alpine.Dockerfile +++ b/all.alpine.Dockerfile @@ -44,7 +44,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/ RUN chmod +x $PS_INSTALL_FOLDER/pwsh RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] # Initialize ClamAV. COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/ diff --git a/all.debian.Dockerfile b/all.debian.Dockerfile index 27648f5..d1939dc 100644 --- a/all.debian.Dockerfile +++ b/all.debian.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update RUN apt-get --assume-yes install powershell RUN apt-get --assume-yes dist-upgrade RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] # Initialize ClamAV. COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/ diff --git a/clamav.Dockerfile b/clamav.Dockerfile index 2b44a76..fe35593 100644 --- a/clamav.Dockerfile +++ b/clamav.Dockerfile @@ -42,7 +42,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/ RUN chmod +x $PS_INSTALL_FOLDER/pwsh RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] # Initialize ClamAV. COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/ diff --git a/clamav.alpine.Dockerfile b/clamav.alpine.Dockerfile index 45a5a84..43bd4d5 100644 --- a/clamav.alpine.Dockerfile +++ b/clamav.alpine.Dockerfile @@ -44,7 +44,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/ RUN chmod +x $PS_INSTALL_FOLDER/pwsh RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] # Initialize ClamAV. COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/ diff --git a/clamav.debian.Dockerfile b/clamav.debian.Dockerfile index 48ba9ea..fe96388 100644 --- a/clamav.debian.Dockerfile +++ b/clamav.debian.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update RUN apt-get --assume-yes install powershell RUN apt-get --assume-yes dist-upgrade RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] # Initialize ClamAV. COPY config/clamd.conf config/freshclam.conf ${SCANVIRUS_GHACTION_CLAMAV_CONFIG}/ diff --git a/lib/checkout.ps1 b/lib/checkout.ps1 index c23b8b3..f560d17 100644 --- a/lib/checkout.ps1 +++ b/lib/checkout.ps1 @@ -1,7 +1,10 @@ #Requires -PSEdition Core -Version 7.2 $Script:ErrorActionPreference = 'Stop' -Import-Module -Name @( - (Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1') +Import-Module -Name ( + @( + 'control' + ) | + ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" } ) -Scope 'Local' $SoftwaresVersionTable = [Ordered]@{ 'PowerShell' = $PSVersionTable.PSVersion.ToString() diff --git a/lib/clamav.psm1 b/lib/clamav.psm1 index edcebe6..583a219 100644 --- a/lib/clamav.psm1 +++ b/lib/clamav.psm1 @@ -1,7 +1,10 @@ #Requires -PSEdition Core -Version 7.2 Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local' -Import-Module -Name @( - (Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1') +Import-Module -Name ( + @( + 'control' + ) | + ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" } ) -Scope 'Local' [String[]]$AllowExtensions = @( '*.cat', diff --git a/lib/git.psm1 b/lib/git.psm1 index 2661e9a..59cc53e 100644 --- a/lib/git.psm1 +++ b/lib/git.psm1 @@ -1,7 +1,10 @@ #Requires -PSEdition Core -Version 7.2 Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local' -Import-Module -Name @( - (Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1') +Import-Module -Name ( + @( + 'control' + ) | + ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" } ) -Scope 'Local' [Hashtable[]]$GitCommitsProperties = @( @{ Name = 'AuthorDate'; Placeholder = '%aI'; Transform = { diff --git a/lib/main.ps1 b/lib/main.ps1 index 3a4507f..e67648e 100644 --- a/lib/main.ps1 +++ b/lib/main.ps1 @@ -42,9 +42,12 @@ If ($Null -ine $InputDebugScript) { } Write-Host -Object 'Initialize.' Set-GitHubActionsOutput -Name 'finish' -Value $False.ToString().ToLower() -Import-Module -Name @( - (Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1'), - (Join-Path -Path $PSScriptRoot -ChildPath 'summary.psm1') +Import-Module -Name ( + @( + 'control', + 'summary' + ) | + ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" } ) -Scope 'Local' [ScanVirusStatistics]$StatisticsTotal = [ScanVirusStatistics]::New() [Boolean]$InputClamAVEnable = ($ToolHasClamAV -and !$ToolForceClamAV) ? ([Boolean]::Parse((Get-GitHubActionsInput -Name 'clamav_enable' -Mandatory -EmptyStringAsNull))) : $ToolForceClamAV diff --git a/lib/statistics.psm1 b/lib/statistics.psm1 index ead1b09..8bfceab 100644 --- a/lib/statistics.psm1 +++ b/lib/statistics.psm1 @@ -1,8 +1,11 @@ #Requires -PSEdition Core -Version 7.2 Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local' -Import-Module -Name @( - (Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1'), - (Join-Path -Path $PSScriptRoot -ChildPath 'summary.psm1') +Import-Module -Name ( + @( + 'control', + 'summary' + ) | + ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" } ) -Scope 'Local' Class ScanVirusStatistics { [String[]]$Issues = @() @@ -88,10 +91,19 @@ Class ScanVirusStatistics { Return $This.GetStatisticsTableString(80) } [Void]StatisticsDisplay() { + $DisplayList = [Ordered]@{ + Statistics = $This.GetStatisticsTableString() + } + If ($This.Issues.Count -gt 0) { + $DisplayList.("Issues [$($This.Issues.Count)]") = $This.Issues | + Join-String -Separator "`n" -FormatString '- {0}' + } + If ($This.SessionsFound.Count -gt 0) { + $DisplayList.("SessionsFound [$($This.SessionsFound.Count)]") = $This.SessionsFound | + Join-String -Separator ', ' + } Write-GitHubActionsNotice -Message ( - [PSCustomObject]@{ - Statistics = $This.GetStatisticsTableString() - } | + [PSCustomObject]$DisplayList | Format-List -Property '*' | Out-String -Width 120 ) diff --git a/lib/yara.psm1 b/lib/yara.psm1 index b517b6a..5676c2e 100644 --- a/lib/yara.psm1 +++ b/lib/yara.psm1 @@ -1,7 +1,10 @@ #Requires -PSEdition Core -Version 7.2 Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local' -Import-Module -Name @( - (Join-Path -Path $PSScriptRoot -ChildPath 'control.psm1') +Import-Module -Name ( + @( + 'control' + ) | + ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" } ) -Scope 'Local' [String[]]$AllowExtensions = @( '*.yar', diff --git a/yara.Dockerfile b/yara.Dockerfile index 755ebe8..5939400 100644 --- a/yara.Dockerfile +++ b/yara.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update RUN apt-get --assume-yes install powershell RUN apt-get --assume-yes dist-upgrade RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] COPY lib/ ${SCANVIRUS_GHACTION_LIB_ROOT}/ RUN ["pwsh", "-NonInteractive", "/opt/hugoalh/scan-virus-ghaction/lib/checkout.ps1"] diff --git a/yara.alpine.Dockerfile b/yara.alpine.Dockerfile index 47ef3a5..f5c4be6 100644 --- a/yara.alpine.Dockerfile +++ b/yara.alpine.Dockerfile @@ -44,7 +44,7 @@ COPY --from=stage-extract-powershell ${PS_INSTALL_FOLDER}/ ${PS_INSTALL_FOLDER}/ RUN chmod +x $PS_INSTALL_FOLDER/pwsh RUN ln -s $PS_INSTALL_FOLDER/pwsh /usr/bin/pwsh RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] COPY lib/ ${SCANVIRUS_GHACTION_LIB_ROOT}/ RUN ["pwsh", "-NonInteractive", "/opt/hugoalh/scan-virus-ghaction/lib/checkout.ps1"] diff --git a/yara.debian.Dockerfile b/yara.debian.Dockerfile index 755ebe8..5939400 100644 --- a/yara.debian.Dockerfile +++ b/yara.debian.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get --assume-yes update RUN apt-get --assume-yes install powershell RUN apt-get --assume-yes dist-upgrade RUN ["pwsh", "-NonInteractive", "-Command", "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose"] -RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '2.0.0-beta4' -Scope 'AllUsers' -AllowPrerelease -AcceptLicense -Verbose"] +RUN ["pwsh", "-NonInteractive", "-Command", "Install-Module -Name 'hugoalh.GitHubActionsToolkit' -RequiredVersion '1.7.2' -Scope 'AllUsers' -AcceptLicense -Verbose"] COPY lib/ ${SCANVIRUS_GHACTION_LIB_ROOT}/ RUN ["pwsh", "-NonInteractive", "/opt/hugoalh/scan-virus-ghaction/lib/checkout.ps1"]