Skip to content

Commit

Permalink
Merge pull request #798 from devagupt/3.0
Browse files Browse the repository at this point in the history
Reverting changes in hubble windows config permissions.
  • Loading branch information
MoodyMudit committed Feb 10, 2020
2 parents c80dcba + 5b97d8e commit fcd9b71
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 54 deletions.
1 change: 0 additions & 1 deletion pkg/windows/dockerfile
Expand Up @@ -87,7 +87,6 @@ CMD powershell.exe -Command Push-Location C:/temp/hubble; \
If (Test-Path C:/data/hubble.conf) {Copy-Item C:/data/hubble.conf -Destination ./hubble/dist/hubble/etc/hubble/ -Force}; \
If (Test-Path C:/data/opt) {Copy-Item C:/data/opt -Destination './hubble/dist/hubble/' -Recurse -Force}; \
Move-Item 'C:/temp/hubble/pkg/windows/osqueryd_safe_permissions.ps1' -Destination './hubble/dist/hubble/' -Force; \
Move-Item 'C:/temp/hubble/pkg/windows/hubble_config_permissions.ps1' -Destination './hubble/dist/hubble/' -Force; \
Move-Item 'C:/temp/hubble/pkg/windows/prerequisites.ps1' -Destination './hubble/dist/hubble/' -Force; \
#Build the installer
Push-Location 'C:/Program Files (x86)/NSIS'; \
Expand Down
35 changes: 17 additions & 18 deletions pkg/windows/hubble-Setup.nsi
Expand Up @@ -46,15 +46,15 @@
;Name and File
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Hubble-${PRODUCT_VERSION}-Setup.exe"

;Default Installation folder
InstallDir "C:\${PFILES}\Hubble"

;Get installation folder from registry if available
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

;Request application privileges for Windows Vista
RequestExecutionLevel highest

Expand Down Expand Up @@ -136,7 +136,7 @@

${NSD_CreateText} 0 43u 100% 12u $IndexName_State
Pop $IndexName

${NSD_CreateLabel} 0 60u 100% 12u "Indexer:"
Pop $Label

Expand All @@ -146,7 +146,7 @@
nsDialogs::Show

FunctionEnd

Function pageHubbleConfig_Leave

${NSD_GetText} $HECToken $HECToken_State
Expand All @@ -172,7 +172,7 @@
SetCtlColors $CheckBox_Hubble_Start "" "ffffff"
# This command required to bring the checkbox to the front
System::Call "User32::SetWindowPos(i, i, i, i, i, i, i) b ($CheckBox_Hubble_Start, ${HWND_TOP}, 0, 0, 0, 0, ${SWP_NOSIZE}|${SWP_NOMOVE})"

# Create Start Hubble Delayed Checkbox
${NSD_CreateCheckbox} 130u 102u 100% 12u "&Delayed Start"
Pop $CheckBox_Hubble_Start_Delayed
Expand Down Expand Up @@ -241,13 +241,13 @@
Section "MainSection" SEC01

SetOutPath "$INSTDIR\"
SetOverwrite ifdiff
SetOverwrite ifdiff
CreateDirectory $INSTDIR\var
CreateDirectory $INSTDIR\etc\hubble\hubble.d
File /r "..\..\dist\hubble\"

SectionEnd

Section -Post

WriteUninstaller "$INSTDIR\uninst.exe"
Expand Down Expand Up @@ -287,21 +287,20 @@

ExecWait 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File .\prerequisites.ps1 "$INSTDIR" -FFFeatureOff'
ExecWait 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File .\osqueryd_safe_permissions.ps1 "$INSTDIR" -FFFeatureOff'
ExecWait 'powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File .\hubble_config_permissions.ps1 "$INSTDIR" -FFFeatureOff'
RMDir /R "$INSTDIR\var\cache" ; removing cache from old version

${if} $HECToken_State != "xxxxx-xxx-xxx-xxx-xxxxxx"
${AndIf} $HECToken_State != ""
Call makeUserConfig
${endif}

Push "C:\${PFILES}\Hubble"
Call AddToPath

Delete "$INSTDIR\vcredist.exe"

SectionEnd

Section Uninstall

Call un.uninstallHubble
Expand Down Expand Up @@ -388,7 +387,7 @@
"$(^Name) was successfully removed from your computer." \
/SD IDOK
FunctionEnd


;--------------------------------
;functions
Expand Down Expand Up @@ -447,7 +446,7 @@
skipUninstall:

FunctionEnd

Function .onInstSuccess

; If StartHubbleDelayed is 1, then set the service to start delayed
Expand All @@ -461,7 +460,7 @@
${EndIf}

FunctionEnd

;--------------------------------
;Helper Functions Section

Expand Down Expand Up @@ -707,11 +706,11 @@
!macroend
!insertmacro RemoveFromPath ""
!insertmacro RemoveFromPath "un."

;--------------------------------
;Specialty Fuctions
Function makeUserConfig

confFind:
IfFileExists "$INSTDIR\etc\hubble\hubble.d\user.conf" confFound confNotFound

Expand All @@ -726,7 +725,7 @@
goto confFind

confLoop:

FileWrite $9 "hubblestack:$\r$\n"
FileWrite $9 " returner:$\r$\n"
FileWrite $9 " splunk:$\r$\n"
Expand Down Expand Up @@ -790,7 +789,7 @@ Function parseCommandLineSwitches
${ElseIf} $IndexName_State == ""
StrCpy $IndexName_State "index"
${EndIf}

# Hubble Config: Indexer
${GetOptions} $R0 "/indexer=" $R1
${IfNot} $R1 == ""
Expand Down
35 changes: 0 additions & 35 deletions pkg/windows/hubble_config_permissions.ps1

This file was deleted.

0 comments on commit fcd9b71

Please sign in to comment.