fleet/tools/app-sso-platform/main.go
Lucas Manuel Rodriguez 39dc7a3772
Add app_sso_platform table to orbit and use table in Entra ID query ingestion (#30140)
#28621

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [X] Added/updated automated tests
- [X] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [X] Make sure fleetd is compatible with the latest released version of
Fleet (see [Must
rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md)).
- [X] Orbit runs on macOS, Linux and Windows. Check if the orbit
feature/bugfix should only apply to one platform (`runtime.GOOS`).
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [X] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
2025-06-20 17:01:38 -03:00

52 lines
1.2 KiB
Go

//go:build darwin
// +build darwin
//go:debug x509negativeserial=1
// Package main is a macOS application to test the app_sso_platform table in the command line.
// Usage for SSO Platform extension for Microsoft Company Portal:
// "go run ./tools/app-sso-platform com.microsoft.CompanyPortalMac.ssoextension KERBEROS.MICROSOFTONLINE.COM"
package main
import (
"context"
"fmt"
"os"
"github.com/fleetdm/fleet/v4/orbit/pkg/table/app_sso_platform"
"github.com/osquery/osquery-go/plugin/table"
)
func main() {
if len(os.Args) < 3 {
fmt.Printf("usage: %s <extensionIdentifier> <realm>\n", os.Args[0])
os.Exit(1)
}
extensionIdentifier := os.Args[1]
realm := os.Args[2]
rows, err := app_sso_platform.Generate(context.Background(), table.QueryContext{
Constraints: map[string]table.ConstraintList{
"extension_identifier": {
Constraints: []table.Constraint{
{
Operator: table.OperatorEquals,
Expression: extensionIdentifier,
},
},
},
"realm": {
Constraints: []table.Constraint{
{
Operator: table.OperatorEquals,
Expression: realm,
},
},
},
},
})
if err != nil {
panic(err)
}
fmt.Printf("%+v\n", rows)
}