@@ -81,26 +81,16 @@ func withServiceOptions(username string, groupName string) ([]serviceOpt, error)
81
81
//
82
82
// gives user the ability to control the service, needed when installed with --unprivileged or
83
83
// ReExec is not possible on Windows.
84
- << << << < HEAD
85
84
func servicePostInstall (ownership utils.FileOwner ) error {
86
- if ownership .UID == "" {
87
- // no user, running with LOCAL SYSTEM (do nothing)
88
- return nil
89
- == == == =
90
- func serviceConfigure (ownership utils .FileOwner ) error {
91
85
// Modify registry to allow logging to eventlog as "Elastic Agent".
92
86
err := eventlog .InstallAsEventCreate (paths .ServiceName , eventlog .Info | eventlog .Warning | eventlog .Error )
93
87
if err != nil && ! strings .Contains (err .Error (), "registry key already exists" ) {
94
88
return fmt .Errorf ("unable to create registry key for logging: %w" , err )
95
89
}
96
- // https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/sddl-for-device-objects
97
- sddl := "D:(A;;GA;;;SY)" + // SDDL_LOCAL_SYSTEM -> SDDL_GENERIC_ALL
98
- "(A;;GA;;;BA)" + // SDDL_BUILTIN_ADMINISTRATORS -> SDDL_GENERIC_ALL
99
- "(A;;GR;;;WD)" + // SDDL_EVERYONE -> SDDL_GENERIC_READ
100
- "(A;;GRGX;;;NS)" // SDDL_NETWORK_SERVICE -> SDDL_GENERIC_READ|SDDL_GENERIC_EXECUTE
101
- if ownership .UID != "" {
102
- sddl += fmt .Sprintf ("(A;;GA;;;%s)" , ownership .UID ) // Ownership UID -> SDDL_GENERIC_ALL
103
- >> >> >> > 6 c20730d5c ([windows ] if `elastic-agent run` fails , log error to Application EventLog (#4846 ))
90
+
91
+ if ownership .UID == "" {
92
+ // no user, running with LOCAL SYSTEM (do nothing)
93
+ return nil
104
94
}
105
95
106
96
// https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/sddl-for-device-objects
0 commit comments