@j-schreiber/sf-cli-security-audit 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -22
- package/messages/rules.enforceClassificationPresets.md +4 -0
- package/messages/rules.users.md +12 -0
- package/oclif.lock +1285 -1006
- package/oclif.manifest.json +2 -253
- package/package.json +1 -1
- package/lib/commands/org/audit/init.d.ts +0 -19
- package/lib/commands/org/audit/init.js +0 -72
- package/lib/commands/org/audit/init.js.map +0 -1
- package/lib/commands/org/audit/run.d.ts +0 -22
- package/lib/commands/org/audit/run.js +0 -119
- package/lib/commands/org/audit/run.js.map +0 -1
- package/lib/commands/org/scan/user-perms.d.ts +0 -20
- package/lib/commands/org/scan/user-perms.js +0 -87
- package/lib/commands/org/scan/user-perms.js.map +0 -1
- package/lib/libs/conf-init/auditConfig.d.ts +0 -35
- package/lib/libs/conf-init/auditConfig.js +0 -41
- package/lib/libs/conf-init/auditConfig.js.map +0 -1
- package/lib/libs/conf-init/permissionsClassification.d.ts +0 -17
- package/lib/libs/conf-init/permissionsClassification.js +0 -80
- package/lib/libs/conf-init/permissionsClassification.js.map +0 -1
- package/lib/libs/conf-init/policyConfigs.d.ts +0 -31
- package/lib/libs/conf-init/policyConfigs.js +0 -91
- package/lib/libs/conf-init/policyConfigs.js.map +0 -1
- package/lib/libs/conf-init/presets/loose.d.ts +0 -6
- package/lib/libs/conf-init/presets/loose.js +0 -51
- package/lib/libs/conf-init/presets/loose.js.map +0 -1
- package/lib/libs/conf-init/presets/none.d.ts +0 -30
- package/lib/libs/conf-init/presets/none.js +0 -54
- package/lib/libs/conf-init/presets/none.js.map +0 -1
- package/lib/libs/conf-init/presets/strict.d.ts +0 -4
- package/lib/libs/conf-init/presets/strict.js +0 -45
- package/lib/libs/conf-init/presets/strict.js.map +0 -1
- package/lib/libs/conf-init/presets.d.ts +0 -7
- package/lib/libs/conf-init/presets.js +0 -20
- package/lib/libs/conf-init/presets.js.map +0 -1
- package/lib/libs/core/auditRun.d.ts +0 -36
- package/lib/libs/core/auditRun.js +0 -86
- package/lib/libs/core/auditRun.js.map +0 -1
- package/lib/libs/core/classification-types.d.ts +0 -20
- package/lib/libs/core/classification-types.js +0 -23
- package/lib/libs/core/classification-types.js.map +0 -1
- package/lib/libs/core/constants.d.ts +0 -11
- package/lib/libs/core/constants.js +0 -20
- package/lib/libs/core/constants.js.map +0 -1
- package/lib/libs/core/file-mgmt/auditConfigFileManager.d.ts +0 -48
- package/lib/libs/core/file-mgmt/auditConfigFileManager.js +0 -145
- package/lib/libs/core/file-mgmt/auditConfigFileManager.js.map +0 -1
- package/lib/libs/core/file-mgmt/schema.d.ts +0 -123
- package/lib/libs/core/file-mgmt/schema.js +0 -69
- package/lib/libs/core/file-mgmt/schema.js.map +0 -1
- package/lib/libs/core/mdapi/mdapiRetriever.d.ts +0 -54
- package/lib/libs/core/mdapi/mdapiRetriever.js +0 -123
- package/lib/libs/core/mdapi/mdapiRetriever.js.map +0 -1
- package/lib/libs/core/mdapi/metadataRegistryEntry.d.ts +0 -40
- package/lib/libs/core/mdapi/metadataRegistryEntry.js +0 -46
- package/lib/libs/core/mdapi/metadataRegistryEntry.js.map +0 -1
- package/lib/libs/core/mdapi/namedMetadataToolingQueryable.d.ts +0 -33
- package/lib/libs/core/mdapi/namedMetadataToolingQueryable.js +0 -41
- package/lib/libs/core/mdapi/namedMetadataToolingQueryable.js.map +0 -1
- package/lib/libs/core/mdapi/namedMetadataType.d.ts +0 -20
- package/lib/libs/core/mdapi/namedMetadataType.js +0 -41
- package/lib/libs/core/mdapi/namedMetadataType.js.map +0 -1
- package/lib/libs/core/mdapi/singletonMetadataType.d.ts +0 -21
- package/lib/libs/core/mdapi/singletonMetadataType.js +0 -37
- package/lib/libs/core/mdapi/singletonMetadataType.js.map +0 -1
- package/lib/libs/core/policies/connectedAppPolicy.d.ts +0 -10
- package/lib/libs/core/policies/connectedAppPolicy.js +0 -78
- package/lib/libs/core/policies/connectedAppPolicy.js.map +0 -1
- package/lib/libs/core/policies/permissionSetPolicy.d.ts +0 -11
- package/lib/libs/core/policies/permissionSetPolicy.js +0 -62
- package/lib/libs/core/policies/permissionSetPolicy.js.map +0 -1
- package/lib/libs/core/policies/policy.d.ts +0 -31
- package/lib/libs/core/policies/policy.js +0 -100
- package/lib/libs/core/policies/policy.js.map +0 -1
- package/lib/libs/core/policies/profilePolicy.d.ts +0 -11
- package/lib/libs/core/policies/profilePolicy.js +0 -64
- package/lib/libs/core/policies/profilePolicy.js.map +0 -1
- package/lib/libs/core/policies/salesforceStandardTypes.d.ts +0 -53
- package/lib/libs/core/policies/salesforceStandardTypes.js +0 -2
- package/lib/libs/core/policies/salesforceStandardTypes.js.map +0 -1
- package/lib/libs/core/policies/userPolicy.d.ts +0 -11
- package/lib/libs/core/policies/userPolicy.js +0 -104
- package/lib/libs/core/policies/userPolicy.js.map +0 -1
- package/lib/libs/core/policy-types.d.ts +0 -18
- package/lib/libs/core/policy-types.js +0 -28
- package/lib/libs/core/policy-types.js.map +0 -1
- package/lib/libs/core/policyRegistry.d.ts +0 -23
- package/lib/libs/core/policyRegistry.js +0 -38
- package/lib/libs/core/policyRegistry.js.map +0 -1
- package/lib/libs/core/registries/connectedApps.d.ts +0 -13
- package/lib/libs/core/registries/connectedApps.js +0 -13
- package/lib/libs/core/registries/connectedApps.js.map +0 -1
- package/lib/libs/core/registries/permissionSets.d.ts +0 -11
- package/lib/libs/core/registries/permissionSets.js +0 -11
- package/lib/libs/core/registries/permissionSets.js.map +0 -1
- package/lib/libs/core/registries/profiles.d.ts +0 -11
- package/lib/libs/core/registries/profiles.js +0 -13
- package/lib/libs/core/registries/profiles.js.map +0 -1
- package/lib/libs/core/registries/ruleRegistry.d.ts +0 -37
- package/lib/libs/core/registries/ruleRegistry.js +0 -48
- package/lib/libs/core/registries/ruleRegistry.js.map +0 -1
- package/lib/libs/core/registries/rules/allUsedAppsUnderManagement.d.ts +0 -7
- package/lib/libs/core/registries/rules/allUsedAppsUnderManagement.js +0 -23
- package/lib/libs/core/registries/rules/allUsedAppsUnderManagement.js.map +0 -1
- package/lib/libs/core/registries/rules/enforceCustomPermsClassificationOnProfiles.d.ts +0 -7
- package/lib/libs/core/registries/rules/enforceCustomPermsClassificationOnProfiles.js +0 -52
- package/lib/libs/core/registries/rules/enforceCustomPermsClassificationOnProfiles.js.map +0 -1
- package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnPermSets.d.ts +0 -7
- package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnPermSets.js +0 -52
- package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnPermSets.js.map +0 -1
- package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnProfiles.d.ts +0 -7
- package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnProfiles.js +0 -54
- package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnProfiles.js.map +0 -1
- package/lib/libs/core/registries/rules/noInactiveUsers.d.ts +0 -9
- package/lib/libs/core/registries/rules/noInactiveUsers.js +0 -44
- package/lib/libs/core/registries/rules/noInactiveUsers.js.map +0 -1
- package/lib/libs/core/registries/rules/noOtherApexApiLogins.d.ts +0 -7
- package/lib/libs/core/registries/rules/noOtherApexApiLogins.js +0 -24
- package/lib/libs/core/registries/rules/noOtherApexApiLogins.js.map +0 -1
- package/lib/libs/core/registries/rules/noUserCanSelfAuthorize.d.ts +0 -7
- package/lib/libs/core/registries/rules/noUserCanSelfAuthorize.js +0 -31
- package/lib/libs/core/registries/rules/noUserCanSelfAuthorize.js.map +0 -1
- package/lib/libs/core/registries/rules/policyRule.d.ts +0 -21
- package/lib/libs/core/registries/rules/policyRule.js +0 -41
- package/lib/libs/core/registries/rules/policyRule.js.map +0 -1
- package/lib/libs/core/registries/types.d.ts +0 -37
- package/lib/libs/core/registries/types.js +0 -11
- package/lib/libs/core/registries/types.js.map +0 -1
- package/lib/libs/core/registries/users.d.ts +0 -26
- package/lib/libs/core/registries/users.js +0 -10
- package/lib/libs/core/registries/users.js.map +0 -1
- package/lib/libs/core/result-types.d.ts +0 -172
- package/lib/libs/core/result-types.js +0 -2
- package/lib/libs/core/result-types.js.map +0 -1
- package/lib/libs/core/utils.d.ts +0 -12
- package/lib/libs/core/utils.js +0 -31
- package/lib/libs/core/utils.js.map +0 -1
- package/lib/libs/quick-scan/types.d.ts +0 -17
- package/lib/libs/quick-scan/types.js +0 -2
- package/lib/libs/quick-scan/types.js.map +0 -1
- package/lib/libs/quick-scan/userPermissionScanner.d.ts +0 -22
- package/lib/libs/quick-scan/userPermissionScanner.js +0 -75
- package/lib/libs/quick-scan/userPermissionScanner.js.map +0 -1
- package/lib/ux/auditRunMultiStage.d.ts +0 -65
- package/lib/ux/auditRunMultiStage.js +0 -120
- package/lib/ux/auditRunMultiStage.js.map +0 -1
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Contributers are welcome! Please reach out on [Linkedin](https://www.linkedin.co
|
|
|
35
35
|
|
|
36
36
|
## `sf org audit init`
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Initialise a new audit config.
|
|
39
39
|
|
|
40
40
|
```
|
|
41
41
|
USAGE
|
|
@@ -46,7 +46,7 @@ FLAGS
|
|
|
46
46
|
-d, --output-dir=<value> Directory where the audit config is initialised. If not set, the root directory will be
|
|
47
47
|
used.
|
|
48
48
|
-o, --target-org=<value> (required) Target org to export permissions, profiles, users, etc.
|
|
49
|
-
-p, --preset=<option> [default: strict]
|
|
49
|
+
-p, --preset=<option> [default: strict] Preset to initialise defaults for permission risk levels.
|
|
50
50
|
<options: strict|loose|none>
|
|
51
51
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
52
52
|
|
|
@@ -55,10 +55,11 @@ GLOBAL FLAGS
|
|
|
55
55
|
--json Format output as json.
|
|
56
56
|
|
|
57
57
|
DESCRIPTION
|
|
58
|
-
|
|
58
|
+
Initialise a new audit config.
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
Uses your org's configuration to set up a new audit config at the target destination. This creates the basic
|
|
61
|
+
classification and policy files that make up an audit config. You can select from presets to initialise risk levels
|
|
62
|
+
with default values. After initialisation, you can customize the files to suit your needs.
|
|
62
63
|
|
|
63
64
|
EXAMPLES
|
|
64
65
|
Initialise audit policies at the root directory
|
|
@@ -70,7 +71,7 @@ EXAMPLES
|
|
|
70
71
|
$ sf org audit init -o MyTargetOrg -d my_dir -p loose
|
|
71
72
|
|
|
72
73
|
FLAG DESCRIPTIONS
|
|
73
|
-
-p, --preset=strict|loose|none
|
|
74
|
+
-p, --preset=strict|loose|none Preset to initialise defaults for permission risk levels.
|
|
74
75
|
|
|
75
76
|
The selected preset is applied before any other default mechanisms (such as template configs). This means, values
|
|
76
77
|
from a selected template override the preset. Consult the documentation to learn more about the rationale behind the
|
|
@@ -78,18 +79,18 @@ FLAG DESCRIPTIONS
|
|
|
78
79
|
essentially control, if a permission is allowed in a certain profile / permission set.
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
_See code: [src/commands/org/audit/init.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.
|
|
82
|
+
_See code: [src/commands/org/audit/init.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.7.1/src/commands/org/audit/init.ts)_
|
|
82
83
|
|
|
83
84
|
## `sf org audit run`
|
|
84
85
|
|
|
85
|
-
Audit your org.
|
|
86
|
+
Audit your org with an existing config.
|
|
86
87
|
|
|
87
88
|
```
|
|
88
89
|
USAGE
|
|
89
90
|
$ sf org audit run -o <value> [--json] [--flags-dir <value>] [-d <value>] [--api-version <value>]
|
|
90
91
|
|
|
91
92
|
FLAGS
|
|
92
|
-
-d, --source-dir=<value>
|
|
93
|
+
-d, --source-dir=<value> Source directory of the audit config to run.
|
|
93
94
|
-o, --target-org=<value> (required) The org that is audited.
|
|
94
95
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
95
96
|
|
|
@@ -98,10 +99,10 @@ GLOBAL FLAGS
|
|
|
98
99
|
--json Format output as json.
|
|
99
100
|
|
|
100
101
|
DESCRIPTION
|
|
101
|
-
Audit your org.
|
|
102
|
+
Audit your org with an existing config.
|
|
102
103
|
|
|
103
|
-
Loads
|
|
104
|
-
|
|
104
|
+
Loads an existing audit config from the source directory and audits the target org. The audit run always creates a
|
|
105
|
+
comprehensive report in JSON format.
|
|
105
106
|
|
|
106
107
|
EXAMPLES
|
|
107
108
|
Audit the org MyTargetOrg with the config in configs/prod
|
|
@@ -109,18 +110,18 @@ EXAMPLES
|
|
|
109
110
|
$ sf org audit run -o MyTargetOrg -d configs/prod
|
|
110
111
|
```
|
|
111
112
|
|
|
112
|
-
_See code: [src/commands/org/audit/run.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.
|
|
113
|
+
_See code: [src/commands/org/audit/run.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.7.1/src/commands/org/audit/run.ts)_
|
|
113
114
|
|
|
114
115
|
## `sf org scan user-perms`
|
|
115
116
|
|
|
116
|
-
Performs a quick scan
|
|
117
|
+
Performs a quick scan for specific user permissions.
|
|
117
118
|
|
|
118
119
|
```
|
|
119
120
|
USAGE
|
|
120
121
|
$ sf org scan user-perms -n <value>... -o <value> [--json] [--flags-dir <value>] [--api-version <value>]
|
|
121
122
|
|
|
122
123
|
FLAGS
|
|
123
|
-
-n, --name=<value>... (required) One or more permissions to be
|
|
124
|
+
-n, --name=<value>... (required) One or more permissions to be searched for.
|
|
124
125
|
-o, --target-org=<value> (required) The target org to scan.
|
|
125
126
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
126
127
|
|
|
@@ -129,23 +130,26 @@ GLOBAL FLAGS
|
|
|
129
130
|
--json Format output as json.
|
|
130
131
|
|
|
131
132
|
DESCRIPTION
|
|
132
|
-
Performs a quick scan
|
|
133
|
+
Performs a quick scan for specific user permissions.
|
|
133
134
|
|
|
134
|
-
The
|
|
135
|
-
|
|
135
|
+
The target org is scanned "in memory" and searches Profiles and Permission Sets for the named user permissions. This
|
|
136
|
+
command does not need an audit config and does not create a report file.
|
|
136
137
|
|
|
137
138
|
EXAMPLES
|
|
138
|
-
|
|
139
|
+
Search for multiple permissions on MyTargetOrg
|
|
140
|
+
|
|
141
|
+
$ sf org scan user-perms -o MyTargetOrg -n AuthorApex -n ModifyMetadata
|
|
139
142
|
|
|
140
143
|
FLAG DESCRIPTIONS
|
|
141
|
-
-n, --name=<value>... One or more permissions to be
|
|
144
|
+
-n, --name=<value>... One or more permissions to be searched for.
|
|
142
145
|
|
|
143
146
|
You can specify any valid user permission on your org, such as "AuthorApex", "CustomizeApplication" or "ViewSetup".
|
|
144
147
|
If you are unsure what permissions are available on your org, initialise a new audit config and check the created
|
|
145
|
-
userPermissions.yml.
|
|
148
|
+
userPermissions.yml. Currently, the names are not validated: If you have a typo (such as "AutorApex", the scan will
|
|
149
|
+
retun 0 results).
|
|
146
150
|
```
|
|
147
151
|
|
|
148
|
-
_See code: [src/commands/org/scan/user-perms.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.
|
|
152
|
+
_See code: [src/commands/org/scan/user-perms.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.7.1/src/commands/org/scan/user-perms.ts)_
|
|
149
153
|
|
|
150
154
|
<!-- commandsstop -->
|
|
151
155
|
|
|
@@ -10,6 +10,10 @@ Permission is BLOCKED and not allowed in any preset.
|
|
|
10
10
|
|
|
11
11
|
Permission classified as UNKNOWN. Update classification to LOW or higher to resolve.
|
|
12
12
|
|
|
13
|
+
# warnings.permission-not-classified
|
|
14
|
+
|
|
15
|
+
Permission is assigned, but was not found in classification. Refresh or add manually.
|
|
16
|
+
|
|
13
17
|
# warnings.permission-not-classified-in-profile
|
|
14
18
|
|
|
15
19
|
Profile assigns the permission, but it was not found in classification. Refresh or add manually.
|
package/messages/rules.users.md
CHANGED
|
@@ -9,3 +9,15 @@ User is inactive for %s days (last login was %s).
|
|
|
9
9
|
# violations.has-never-logged-in
|
|
10
10
|
|
|
11
11
|
User was created %s (%s days ago), but never logged in.
|
|
12
|
+
|
|
13
|
+
# violations.entity-unknown-but-used
|
|
14
|
+
|
|
15
|
+
%s is used, but classified as UNKNOWN. Cannot audit user role.
|
|
16
|
+
|
|
17
|
+
# violations.entity-not-classified-but-used
|
|
18
|
+
|
|
19
|
+
%s is used, but not classified in %ss policy.
|
|
20
|
+
|
|
21
|
+
# violations.entity-not-allowed-for-user-role
|
|
22
|
+
|
|
23
|
+
User has the role "%s", but %s is classified as "%s". This is not allowed.
|