Skip to content

Commit

Permalink
Hardened Runtime Library Entitlement
Browse files Browse the repository at this point in the history
Add an entitlement that allows using libraries signed by anyone other than
myself or apple, such as the ZFS Libraries. Change some other Code Signing
settings, and the security defaults.
  • Loading branch information
cbreak-black committed May 18, 2019
1 parent ab8f9ed commit 342c9db
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CommonAuthorization/CommonAuthorization.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ + (NSDictionary *)commandInfo
NSDictionary * dictExport =
@{
kKeyAuthRightName: @"net.the-color-black.ZetaWatch.export",
kKeyAuthRightDefault: @kAuthorizationRuleAuthenticateAsAdmin,
kKeyAuthRightDefault: @kAuthorizationRuleClassAllow,
kKeyAuthRightDesc: NSLocalizedString(
@"ZetaWatch is trying to export a pool.",
@"prompt shown when user is required to authorize a zpool export"
Expand Down Expand Up @@ -89,7 +89,7 @@ + (NSDictionary *)commandInfo
NSDictionary * dictScrub =
@{
kKeyAuthRightName: @"net.the-color-black.ZetaWatch.scrub",
kKeyAuthRightDefault: @kAuthorizationRuleAuthenticateAsAdmin,
kKeyAuthRightDefault: @kAuthorizationRuleClassAllow,
kKeyAuthRightDesc: NSLocalizedString(
@"ZetaWatch is trying to scrub a pool.",
@"prompt shown when user is required to authorize a zpool scrub"
Expand Down
2 changes: 1 addition & 1 deletion ZetaAuthorizationHelper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleName</key>
<string>ZetaAuthorizationHelper</string>
<key>CFBundleVersion</key>
<string>12</string>
<string>13</string>
<key>SMAuthorizedClients</key>
<array>
<string>anchor apple generic and identifier &quot;net.the-color-black.ZetaWatch&quot; and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = &quot;8THUW5GT6P&quot;)</string>
Expand Down
10 changes: 9 additions & 1 deletion ZetaWatch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
70EABDD31FF9B21C00BA39B8 /* ZetaAuthorizationHelper.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ZetaAuthorizationHelper.mm; sourceTree = "<group>"; };
70EABDD51FF9B40F00BA39B8 /* Launchd.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Launchd.plist; sourceTree = "<group>"; };
70EABDDB1FF9C11E00BA39B8 /* CommonAuthorization.strings */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; path = CommonAuthorization.strings; sourceTree = "<group>"; };
70F386AA22906D36002C760A /* ZetaWatch.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ZetaWatch.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -231,6 +232,7 @@
70C930D622122CBD00BA39B8 /* Localizable.strings */,
7006C4861C26CA1500929DAE /* MainMenu.xib */,
7006C4891C26CA1500929DAE /* Info.plist */,
70F386AA22906D36002C760A /* ZetaWatch.entitlements */,
7006C4811C26CA1500929DAE /* Supporting Files */,
);
path = ZetaWatch;
Expand Down Expand Up @@ -409,7 +411,7 @@
7006C4731C26CA1400929DAE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0920;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "the-color-black.net";
TargetAttributes = {
7006C47A1C26CA1400929DAE = {
Expand Down Expand Up @@ -572,19 +574,22 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = ZetaWatch/ZetaWatch.entitlements;
CODE_SIGN_IDENTITY = "Developer ID Application";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
Expand Down Expand Up @@ -632,19 +637,22 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = ZetaWatch/ZetaWatch.entitlements;
CODE_SIGN_IDENTITY = "Developer ID Application";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
Expand Down
2 changes: 1 addition & 1 deletion ZetaWatch/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>12</string>
<string>13</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSBackgroundOnly</key>
Expand Down
8 changes: 8 additions & 0 deletions ZetaWatch/ZetaWatch.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>

0 comments on commit 342c9db

Please sign in to comment.