mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
3ac8494d23
git-subtree-dir: orbit git-subtree-mainline:d5974aad97
git-subtree-split:ab3047bb39
35 lines
988 B
Go
35 lines
988 B
Go
//+build windows
|
|
|
|
package constant
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
const (
|
|
PlatformName = "windows"
|
|
// DefaultExecutableMode is the default file mode to apply to created
|
|
// executable files. For Windows this doesn't do anything besides setting
|
|
// read-only. See https://golang.org/pkg/os/#Chmod.
|
|
DefaultExecutableMode = 0o700
|
|
)
|
|
|
|
var (
|
|
// These identifiers can be found in
|
|
// https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/security-identifiers-in-windows
|
|
// and are used in the same fashion as in osquery. See
|
|
// https://github.com/osquery/osquery/blob/d2be385d71f401c85872f00d479df8f499164c5a/tools/deployment/chocolatey/tools/osquery_utils.ps1.
|
|
SystemSID = mustSID("S-1-5-18")
|
|
AdminSID = mustSID("S-1-5-32-544")
|
|
UserSID = mustSID("S-1-5-32-545")
|
|
)
|
|
|
|
func mustSID(identifier string) *windows.SID {
|
|
sid, err := windows.StringToSid(identifier)
|
|
if err != nil {
|
|
panic(errors.Wrap(err, "create sid"))
|
|
}
|
|
return sid
|
|
}
|