Skip to content

Commit

Permalink
change bundle id to com.northpolesec.*
Browse files Browse the repository at this point in the history
  • Loading branch information
tburgin committed Oct 2, 2024
1 parent 8b47373 commit 2d946b4
Show file tree
Hide file tree
Showing 87 changed files with 246 additions and 246 deletions.
36 changes: 18 additions & 18 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ package_group(
run_command(
name = "unload",
cmd = """
sudo launchctl unload /Library/LaunchDaemons/com.google.santad.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.google.santa.bundleservice.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.google.santa.metricservice.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.google.santa.syncservice.plist 2>/dev/null
launchctl unload /Library/LaunchAgents/com.google.santa.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.northpolesec.santad.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.northpolesec.santa.bundleservice.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.northpolesec.santa.metricservice.plist 2>/dev/null
sudo launchctl unload /Library/LaunchDaemons/com.northpolesec.santa.syncservice.plist 2>/dev/null
launchctl unload /Library/LaunchAgents/com.northpolesec.santa.plist 2>/dev/null
""",
)

run_command(
name = "load",
cmd = """
sudo launchctl load /Library/LaunchDaemons/com.google.santad.plist
sudo launchctl load /Library/LaunchDaemons/com.google.santa.bundleservice.plist
sudo launchctl load /Library/LaunchDaemons/com.google.santa.metricservice.plist
sudo launchctl load /Library/LaunchDaemons/com.google.santa.syncservice.plist
launchctl load /Library/LaunchAgents/com.google.santa.plist
sudo launchctl load /Library/LaunchDaemons/com.northpolesec.santad.plist
sudo launchctl load /Library/LaunchDaemons/com.northpolesec.santa.bundleservice.plist
sudo launchctl load /Library/LaunchDaemons/com.northpolesec.santa.metricservice.plist
sudo launchctl load /Library/LaunchDaemons/com.northpolesec.santa.syncservice.plist
launchctl load /Library/LaunchAgents/com.northpolesec.santa.plist
""",
)

Expand Down Expand Up @@ -101,12 +101,12 @@ genrule(
"//Source/gui:Santa",
"Conf/install.sh",
"Conf/uninstall.sh",
"Conf/com.google.santa.bundleservice.plist",
"Conf/com.google.santa.metricservice.plist",
"Conf/com.google.santa.syncservice.plist",
"Conf/com.google.santad.plist",
"Conf/com.google.santa.plist",
"Conf/com.google.santa.newsyslog.conf",
"Conf/com.northpolesec.santa.bundleservice.plist",
"Conf/com.northpolesec.santa.metricservice.plist",
"Conf/com.northpolesec.santa.syncservice.plist",
"Conf/com.northpolesec.santad.plist",
"Conf/com.northpolesec.santa.plist",
"Conf/com.northpolesec.santa.newsyslog.conf",
"Conf/Package/Distribution.xml",
"Conf/Package/notarization_tool.sh",
"Conf/Package/package_and_sign.sh",
Expand Down Expand Up @@ -163,9 +163,9 @@ genrule(
mkdir -p $(@D)/dsym
cp -LR $$(dirname $$(dirname $${SRC})) $(@D)/dsym/Santa.app.dSYM
;;
*com.google.santa.daemon.systemextension.dSYM*Info.plist)
*com.northpolesec.santa.daemon.systemextension.dSYM*Info.plist)
mkdir -p $(@D)/dsym
cp -LR $$(dirname $$(dirname $${SRC})) $(@D)/dsym/com.google.santa.daemon.systemextension.dSYM
cp -LR $$(dirname $$(dirname $${SRC})) $(@D)/dsym/com.northpolesec.santa.daemon.systemextension.dSYM
;;
esac
done
Expand Down
4 changes: 2 additions & 2 deletions Conf/Package/Distribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</choices-outline>

<choice id="default">
<pkg-ref id="com.google.santa"/>
<pkg-ref id="com.northpolesec.santa"/>
</choice>

<pkg-ref id="com.google.santa">app.pkg</pkg-ref>
<pkg-ref id="com.northpolesec.santa">app.pkg</pkg-ref>

</installer-gui-script>
20 changes: 10 additions & 10 deletions Conf/Package/package_and_sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function die {
}

readonly INPUT_APP="${RELEASE_ROOT}/binaries/Santa.app"
readonly INPUT_SYSX="${INPUT_APP}/Contents/Library/SystemExtensions/com.google.santa.daemon.systemextension"
readonly INPUT_SYSX="${INPUT_APP}/Contents/Library/SystemExtensions/com.northpolesec.santa.daemon.systemextension"
readonly INPUT_SANTACTL="${INPUT_APP}/Contents/MacOS/santactl"
readonly INPUT_SANTABS="${INPUT_APP}/Contents/MacOS/santabundleservice"
readonly INPUT_SANTAMS="${INPUT_APP}/Contents/MacOS/santametricservice"
Expand Down Expand Up @@ -94,7 +94,7 @@ done
# be verified without using sudo.
/usr/bin/find "${RELEASE_ROOT}/binaries" -type f -name CodeResources -exec chmod 0644 {} \;
/usr/bin/find "${RELEASE_ROOT}/binaries" -type d -exec chmod 0755 {} \;
/usr/bin/find "${RELEASE_ROOT}/conf" -type f -name "com.google.santa*" -exec chmod 0644 {} \;
/usr/bin/find "${RELEASE_ROOT}/conf" -type f -name "com.northpolesec.santa*" -exec chmod 0644 {} \;

echo "verifying signatures"
/usr/bin/codesign -vv -R="certificate leaf[subject.OU] = ${SIGNING_TEAMID}" \
Expand All @@ -114,13 +114,13 @@ echo "creating app pkg"
"${APP_PKG_ROOT}/private/etc/asl" \
"${APP_PKG_ROOT}/private/etc/newsyslog.d"
/bin/cp -vXR "${RELEASE_ROOT}/binaries/Santa.app" "${APP_PKG_ROOT}/Applications/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santad.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santa.plist" "${APP_PKG_ROOT}/Library/LaunchAgents/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santa.bundleservice.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santa.metricservice.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santa.syncservice.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santa.asl.conf" "${APP_PKG_ROOT}/private/etc/asl/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.google.santa.newsyslog.conf" "${APP_PKG_ROOT}/private/etc/newsyslog.d/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santad.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santa.plist" "${APP_PKG_ROOT}/Library/LaunchAgents/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santa.bundleservice.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santa.metricservice.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santa.syncservice.plist" "${APP_PKG_ROOT}/Library/LaunchDaemons/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santa.asl.conf" "${APP_PKG_ROOT}/private/etc/asl/"
/bin/cp -vX "${RELEASE_ROOT}/conf/com.northpolesec.santa.newsyslog.conf" "${APP_PKG_ROOT}/private/etc/newsyslog.d/"
/bin/cp -vXL "${SCRIPT_PATH}/preinstall" "${APP_PKG_SCRIPTS}/"
/bin/cp -vXL "${SCRIPT_PATH}/postinstall" "${APP_PKG_SCRIPTS}/"
/bin/chmod +x "${APP_PKG_SCRIPTS}/"*
Expand All @@ -133,7 +133,7 @@ echo "creating app pkg"
/usr/bin/plutil -replace ChildBundles -json "[]" "${SCRATCH}/component.plist"

# Build app package
/usr/bin/pkgbuild --identifier "com.google.santa" \
/usr/bin/pkgbuild --identifier "com.northpolesec.santa" \
--version "$(echo "${RELEASE_NAME}" | cut -d - -f2)" \
--root "${APP_PKG_ROOT}" \
--component-plist "${SCRATCH}/component.plist" \
Expand Down
24 changes: 12 additions & 12 deletions Conf/Package/postinstall
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Load com.google.santa.daemon and com.google.santa.bundleservice
# Load com.northpolesec.santa.daemon and com.northpolesec.santa.bundleservice
# If a user is logged in, also load the GUI agent.
# If the target volume is not /, do nothing

Expand All @@ -13,24 +13,24 @@
mkdir -p /usr/local/bin
/bin/ln -sf /Applications/Santa.app/Contents/MacOS/santactl /usr/local/bin/santactl

# Remove the kext before com.google.santa.daemon loads if the SystemExtension is already present.
/bin/launchctl list EQHXZ8M8AV.com.google.santa.daemon > /dev/null 2>&1 && rm -rf /Library/Extensions/santa-driver.kext
# Remove the kext before com.northpolesec.santa.daemon loads if the SystemExtension is already present.
/bin/launchctl list EQHXZ8M8AV.com.northpolesec.santa.daemon > /dev/null 2>&1 && rm -rf /Library/Extensions/santa-driver.kext

# Load com.google.santa.daemon, its main has logic to handle loading the kext
# Load com.northpolesec.santa.daemon, its main has logic to handle loading the kext
# or relaunching itself as a SystemExtension.
/bin/launchctl load -w /Library/LaunchDaemons/com.google.santad.plist
/bin/launchctl load -w /Library/LaunchDaemons/com.northpolesec.santad.plist

# Load com.google.santa.bundleservice
/bin/launchctl load -w /Library/LaunchDaemons/com.google.santa.bundleservice.plist
# Load com.northpolesec.santa.bundleservice
/bin/launchctl load -w /Library/LaunchDaemons/com.northpolesec.santa.bundleservice.plist

# Load com.google.santa.metricservice
/bin/launchctl load -w /Library/LaunchDaemons/com.google.santa.metricservice.plist
# Load com.northpolesec.santa.metricservice
/bin/launchctl load -w /Library/LaunchDaemons/com.northpolesec.santa.metricservice.plist

# Load com.google.santa.syncservice
/bin/launchctl load -w /Library/LaunchDaemons/com.google.santa.syncservice.plist
# Load com.northpolesec.santa.syncservice
/bin/launchctl load -w /Library/LaunchDaemons/com.northpolesec.santa.syncservice.plist

GUI_USER=$(/usr/bin/stat -f '%u' /dev/console)
[[ -z "${GUI_USER}" ]] && exit 0

/bin/launchctl asuser "${GUI_USER}" /bin/launchctl load /Library/LaunchAgents/com.google.santa.plist
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl load /Library/LaunchAgents/com.northpolesec.santa.plist
exit 0
18 changes: 9 additions & 9 deletions Conf/Package/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

[[ $3 != "/" ]] && exit 0

/bin/launchctl remove com.google.santad || true
/bin/launchctl remove com.google.santa.bundleservice || true
/bin/launchctl remove com.google.santa.metricservice || true
/bin/launchctl remove com.google.santa.syncservice || true
/bin/launchctl remove com.northpolesec.santad || true
/bin/launchctl remove com.northpolesec.santa.bundleservice || true
/bin/launchctl remove com.northpolesec.santa.metricservice || true
/bin/launchctl remove com.northpolesec.santa.syncservice || true

/bin/sleep 1

/sbin/kextunload -b com.google.santa-driver >/dev/null 2>&1 || true
/sbin/kextunload -b com.northpolesec.santa-driver >/dev/null 2>&1 || true

# Remove cruft from old Santa versions
/bin/rm -f /usr/libexec/santad
/bin/rm -f /usr/sbin/santactl
/bin/launchctl remove com.google.santasync
/bin/rm -f /Library/LaunchDaemons/com.google.santasync.plist
/bin/launchctl remove com.northpolesec.santasync
/bin/rm -f /Library/LaunchDaemons/com.northpolesec.santasync.plist
/bin/rm -rf /Applications/Santa.app
/bin/rm -rf /Library/Extensions/santa-driver.kext

Expand All @@ -28,6 +28,6 @@
GUI_USER=$(/usr/bin/stat -f '%u' /dev/console)
[[ -z "${GUI_USER}" ]] && exit 0

/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.google.santagui
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.google.santa
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.northpolesec.santagui
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.northpolesec.santa
exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.google.santa.bundleservice</string>
<string>com.northpolesec.santa.bundleservice</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Santa.app/Contents/MacOS/santabundleservice</string>
<string>--syslog</string>
</array>
<key>MachServices</key>
<dict>
<key>com.google.santa.bundleservice</key>
<key>com.northpolesec.santa.bundleservice</key>
<true/>
</dict>
<key>RunAtLoad</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.google.santa.metricservice</string>
<string>com.northpolesec.santa.metricservice</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Santa.app/Contents/MacOS/santametricservice</string>
<string>--syslog</string>
</array>
<key>MachServices</key>
<dict>
<key>com.google.santa.metricservice</key>
<key>com.northpolesec.santa.metricservice</key>
<true/>
</dict>
<key>RunAtLoad</key>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.google.santa</string>
<string>com.northpolesec.santa</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Santa.app/Contents/MacOS/Santa</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.google.santa.syncservice</string>
<string>com.northpolesec.santa.syncservice</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Santa.app/Contents/MacOS/santasyncservice</string>
<string>--syslog</string>
</array>
<key>MachServices</key>
<dict>
<key>com.google.santa.syncservice</key>
<key>com.northpolesec.santa.syncservice</key>
<true/>
</dict>
<key>RunAtLoad</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.google.santad</string>
<string>com.northpolesec.santad</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Santa.app/Contents/Library/SystemExtensions/com.google.santa.daemon.systemextension/Contents/MacOS/com.google.santa.daemon</string>
<string>/Applications/Santa.app/Contents/Library/SystemExtensions/com.northpolesec.santa.daemon.systemextension/Contents/MacOS/com.northpolesec.santa.daemon</string>
<string>--syslog</string>
</array>
<key>MachServices</key>
<dict>
<key>com.google.santa.daemon</key>
<key>com.northpolesec.santa.daemon</key>
<true/>
</dict>
<key>RunAtLoad</key>
Expand Down
50 changes: 25 additions & 25 deletions Conf/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ if [[ -z "${BINARIES}" || -z "${CONF}" ]]; then
fi

# Unload santad and scheduled sync job.
/bin/launchctl remove com.google.santad >/dev/null 2>&1
/bin/launchctl remove com.northpolesec.santad >/dev/null 2>&1

# Unload bundle service
/bin/launchctl remove com.google.santa.bundleservice >/dev/null 2>&1
/bin/launchctl remove com.northpolesec.santa.bundleservice >/dev/null 2>&1

# Unload metric service
/bin/launchctl remove com.google.santa.metricservice >/dev/null 2>&1
/bin/launchctl remove com.northpolesec.santa.metricservice >/dev/null 2>&1

# Unload sync service
/bin/launchctl remove com.google.santa.syncservice >/dev/null 2>&1
/bin/launchctl remove com.northpolesec.santa.syncservice >/dev/null 2>&1

# Unload kext.
/sbin/kextunload -b com.google.santa-driver >/dev/null 2>&1
/sbin/kextunload -b com.northpolesec.santa-driver >/dev/null 2>&1

# Determine if anyone is logged into the GUI
GUI_USER=$(/usr/bin/stat -f '%u' /dev/console)

# Unload GUI agent if someone is logged in.
[[ -n "${GUI_USER}" ]] && \
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.google.santagui
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.northpolesec.santagui
[[ -n "$GUI_USER" ]] && \
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.google.santa
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl remove com.northpolesec.santa

# Cleanup cruft from old versions
/bin/launchctl remove com.google.santasync >/dev/null 2>&1
/bin/rm /Library/LaunchDaemons/com.google.santasync.plist >/dev/null 2>&1
/bin/launchctl remove com.northpolesec.santasync >/dev/null 2>&1
/bin/rm /Library/LaunchDaemons/com.northpolesec.santasync.plist >/dev/null 2>&1
/bin/rm /usr/libexec/santad >/dev/null 2>&1
/bin/rm /usr/sbin/santactl >/dev/null 2>&1
/bin/rm -rf /Applications/Santa.app 2>&1
/bin/rm -rf /Library/Extensions/santa-driver.kext 2>&1
/bin/rm /etc/asl/com.google.santa.asl.conf
/bin/rm /etc/asl/com.northpolesec.santa.asl.conf

# Copy new files.
/bin/mkdir -p /var/db/santa
Expand All @@ -59,30 +59,30 @@ GUI_USER=$(/usr/bin/stat -f '%u' /dev/console)
/bin/mkdir -p /usr/local/bin
/bin/ln -s /Applications/Santa.app/Contents/MacOS/santactl /usr/local/bin 2>/dev/null

/bin/cp ${CONF}/com.google.santa.plist /Library/LaunchAgents
/bin/cp ${CONF}/com.google.santa.bundleservice.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.google.santa.metricservice.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.google.santa.syncservice.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.google.santad.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.google.santa.newsyslog.conf /etc/newsyslog.d/
/bin/cp ${CONF}/com.northpolesec.santa.plist /Library/LaunchAgents
/bin/cp ${CONF}/com.northpolesec.santa.bundleservice.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.northpolesec.santa.metricservice.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.northpolesec.santa.syncservice.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.northpolesec.santad.plist /Library/LaunchDaemons
/bin/cp ${CONF}/com.northpolesec.santa.newsyslog.conf /etc/newsyslog.d/

# Reload syslogd to pick up ASL configuration change.
/usr/bin/killall -HUP syslogd

# Load com.google.santa.daemon
/bin/launchctl load /Library/LaunchDaemons/com.google.santad.plist
# Load com.northpolesec.santa.daemon
/bin/launchctl load /Library/LaunchDaemons/com.northpolesec.santad.plist

# Load com.google.santa.bundleservice
/bin/launchctl load /Library/LaunchDaemons/com.google.santa.bundleservice.plist
# Load com.northpolesec.santa.bundleservice
/bin/launchctl load /Library/LaunchDaemons/com.northpolesec.santa.bundleservice.plist

# Load com.google.santa.metricservice
/bin/launchctl load /Library/LaunchDaemons/com.google.santa.metricservice.plist
# Load com.northpolesec.santa.metricservice
/bin/launchctl load /Library/LaunchDaemons/com.northpolesec.santa.metricservice.plist

# Load com.google.santa.syncservice
/bin/launchctl load /Library/LaunchDaemons/com.google.santa.syncservice.plist
# Load com.northpolesec.santa.syncservice
/bin/launchctl load /Library/LaunchDaemons/com.northpolesec.santa.syncservice.plist

# Load GUI agent if someone is logged in.
[[ -z "${GUI_USER}" ]] && exit 0

/bin/launchctl asuser "${GUI_USER}" /bin/launchctl load -w /Library/LaunchAgents/com.google.santa.plist
/bin/launchctl asuser "${GUI_USER}" /bin/launchctl load -w /Library/LaunchAgents/com.northpolesec.santa.plist
exit 0
Loading

0 comments on commit 2d946b4

Please sign in to comment.