Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add query to collect the Windows Exchange Server version #147

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/mondoo-windows-inventory.mql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,9 @@ packs:
title: Logged-in users
mql: |
parse.json(content: powershell("Get-Process -IncludeUserName explorer | Select-Object Username | ConvertTo-Json").stdout).params
- uid: mondoo-windows-exchange-server-version
title: Exchange Server Version
filters: |
package('Microsoft Exchange Server').installed
mql: |
powershell('(Get-Command ExSetup.exe | ForEach-Object { $_.FileVersionInfo } | Select-Object -First 1).FileVersion').stdout
Copy link
Member

Choose a reason for hiding this comment

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

Is this not something we can get from the package data?

Copy link
Member Author

@atomic111 atomic111 Apr 22, 2024

Choose a reason for hiding this comment

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

@tas50 yes but then we have to provide the customer a list of packages.

this case is easy

packages.where(name == /Exchange Server.*Cumulative Update.*/ || name == 'Microsoft Exchange Server') { name version }
packages.where.list: [
  0: {
    version: "15.1.2507.6"
    name: "Microsoft Exchange Server 2016 Cumulative Update 23"
  }
  1: {
    version: "15.1.2507.6"
    name: "Microsoft Exchange Server"
  }
]

the version of the exchange version is 15.1.2507.6

but there exists cases where the version of the Exchange server differs from the Version of the Cumulative Update, like this case:

packages.where(name == /Exchange Server.*Cumulative Update.*/ || name == 'Microsoft Exchange Server') { name version }
packages.where.list: [
  0: {
    version: "15.2.1544.9",
    name: "Microsoft Exchange Server 2019 Cumulative Update 14",
  }
  1: {
    version: "15.2.1544.4"
    name: "Microsoft Exchange Server"
  }
]

the version of the exchange version is 15.2.1544.9.

but then there are installation which no Cumulative Update is installed

@tas50 do you prefer this query: packages.where(name == /Exchange Server.*Cumulative Update.*/ || name == 'Microsoft Exchange Server') { name version }

Copy link
Member

Choose a reason for hiding this comment

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

If we can't get the data correctly with package then this makes sense. Just double checking

Loading