Skip to content

Conversation

@PrajeetGuha
Copy link
Collaborator

@PrajeetGuha PrajeetGuha commented Apr 23, 2025

Closes: #1314

Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PrajeetGuha as we need this change for Suricata, I think we should add the package in the same PR (if you wish in a different commit) so that we can test them together.

You need to rebase to solve the conflict with the package version.

@PrajeetGuha PrajeetGuha deleted the update-common branch April 24, 2025 18:12
@PrajeetGuha PrajeetGuha restored the update-common branch April 24, 2025 18:13
@PrajeetGuha PrajeetGuha reopened this Apr 24, 2025
@PrajeetGuha PrajeetGuha marked this pull request as draft April 24, 2025 18:23
@PrajeetGuha PrajeetGuha self-assigned this Apr 24, 2025
@PrajeetGuha PrajeetGuha added the 🆕 package New package request/idea/PR label Apr 24, 2025
@PrajeetGuha PrajeetGuha changed the title relax application installation check Suricate Package Addition Apr 24, 2025
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PrajeetGuha I see some activity in the PR, but I do not see the new package. @PrajeetGuha have you maybe forgotten to push the changes? 🤔 Let me know if you need help with anything.

@PrajeetGuha
Copy link
Collaborator Author

PrajeetGuha commented May 1, 2025

For the package to work, I had to install powershell-yaml module from Powershell Gallery for reading and editing the suricata.yaml of the tool. Can you provide me with details regarding where to put such installation code in the project?

Install-Module -Name powershell-yaml

The github action workflow will fail due to absence of the powershell module.

@PrajeetGuha
Copy link
Collaborator Author

image
Just a heads up! While reading the documentation, I came across this part where category selection is mentioned with a variable which we used to use previously. Might need changes to it. 🫡

@PrajeetGuha
Copy link
Collaborator Author

PrajeetGuha commented May 3, 2025

image
with the common.psm change, suricata as an app is identified but due to absence of installer cache folder, icon is not found.
I tested bindiff after common.psm changes and it looks like it is working without any issues.

@PrajeetGuha PrajeetGuha marked this pull request as ready for review May 3, 2025 15:54
@PrajeetGuha PrajeetGuha requested a review from Ana06 May 3, 2025 15:54
@Ana06
Copy link
Member

Ana06 commented May 5, 2025

@PrajeetGuha

Just a heads up! While reading the documentation, I came across this part where category selection is mentioned with a variable which we used to use previously. Might need changes to it. 🫡

I have just updated the wiki, thanks for bringing it up!

Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the work @PrajeetGuha! 💐

All code that could fail needs to be inside a try-catch with a VM-Write-Log-Exception $_ to better handle exceptions. It is always good to have new people contributing to the project, as we notice where we are lucking documentation. I have just documented the try-catch in https://github.com/mandiant/VM-Packages/wiki/Coding-Conventions. 😉

@PrajeetGuha
Copy link
Collaborator Author

PrajeetGuha commented May 7, 2025

Thanks for all the work @PrajeetGuha! 💐

All code that could fail needs to be inside a try-catch with a VM-Write-Log-Exception $_ to better handle exceptions. It is always good to have new people contributing to the project, as we notice where we are lucking documentation. I have just documented the try-catch in https://github.com/mandiant/VM-Packages/wiki/Coding-Conventions. 😉

Thanks!! Will check and add exceptions wherever necessary after the code is working as expected and is approved. 🫡

@PrajeetGuha PrajeetGuha requested a review from Ana06 May 7, 2025 16:39
@Ana06
Copy link
Member

Ana06 commented May 8, 2025

@PrajeetGuha

Will check and add exceptions wherever necessary after the code is working as expected and is approved.

This should be easy to address. Normally all packages have just a single try-catch with most of the code inside 😉 Let me know if what I mean is not clear.

@PrajeetGuha PrajeetGuha force-pushed the update-common branch 3 times, most recently from 900bbe9 to 13f9f60 Compare May 12, 2025 05:27
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code, but I haven't been able to test the changes locally, as it seems there are issues with the feed (hopefully they resolve on their own soon as I think FLARE-VM/Commando VM are also broken because of this):
image

Param(
[Parameter(Mandatory=$true, Position=0)]
[ValidateSet("INFO","WARN","ERROR")]
[ValidateSet("INFO","WARN","ERROR","FATAL")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this change. 😕 Can you please explain me why this is needed @PrajeetGuha?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (($level -eq "ERROR") -Or ($level -eq "FATAL")) {

has $level=FATAL but the ValidateSet does not have it. This change is not related to this package implementation though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] It is a good practice to not commit unrelated changes in the same commit. But I see why this is an enhancement now. 😉

@PrajeetGuha PrajeetGuha requested a review from Ana06 May 14, 2025 04:28
@Ana06
Copy link
Member

Ana06 commented May 15, 2025

Google CLA test doesn't like my personal email as co-author. I think using [email protected] should be ok. I am also fine removing the co-author.

@PrajeetGuha did you add this manually or was it the GH interface? I would like to try to configure the email if it was the GH interface.

@PrajeetGuha
Copy link
Collaborator Author

Google CLA test doesn't like my personal email as co-author. I think using [email protected] should be ok. I am also fine removing the co-author.

@PrajeetGuha did you add this manually or was it the GH interface? I would like to try to configure the email if it was the GH interface.

It is the GH interface. I think it will not be problem when I squash and rebase the code after final review. Let me know if any changes are required.

Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PrajeetGuha so sorry for the late response, I had completely missed that you had made the changes 🙈

I have just tested locally and the suricata icon seems to be broken:
image

Param(
[Parameter(Mandatory=$true, Position=0)]
[ValidateSet("INFO","WARN","ERROR")]
[ValidateSet("INFO","WARN","ERROR","FATAL")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] It is a good practice to not commit unrelated changes in the same commit. But I see why this is an enhancement now. 😉

@Ana06 Ana06 added this to the FLARE-VM 2025 Q4-P1 milestone Jul 31, 2025
@PrajeetGuha
Copy link
Collaborator Author

PrajeetGuha commented Aug 20, 2025

@PrajeetGuha so sorry for the late response, I had completely missed that you had made the changes 🙈

It's fine 🫡

I have just tested locally and the suricata icon seems to be broken

Unfortunately with the present implementation, the installer cache was not found so no icon is attached to it. 😢 I have no alternative in mind to make it work.
#1375 (comment)

@Ana06
Copy link
Member

Ana06 commented Aug 20, 2025

@PrajeetGuha thanks for the answer, I had misunderstood that previous commit. @emtuls any ideas to find the icon? or should we merge it as it is (it needs a rebase)?

@Ana06 Ana06 requested a review from emtuls August 20, 2025 08:12
@emtuls
Copy link
Member

emtuls commented Aug 20, 2025

We can grab the icon programmatically through a few ways, but the one I found to be easiest for me is to grab it from after it installs in this directory: %appData%\Microsoft\Installer\{GUID}

There you will find suricata.ico

We can obtain the GUID prior to installation with a small piece of code. For example (if we want to make this into a function):

function Get-MsiProductCode {
    param (
        [string]$msiFile
    )
    $installer = New-Object -ComObject WindowsInstaller.Installer
    $database = $installer.OpenDatabase($msiFile, 0)
    $view = $database.OpenView("SELECT `Value` FROM `Property` WHERE `Property`='ProductCode'")
    $view.Execute()
    return $view.Fetch().StringData(1)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 package New package request/idea/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Suricata package for installation into the FLARE-VM

4 participants