@j-schreiber/sf-cli-security-audit 0.16.0 → 0.16.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
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
<a href="https://github.com/j-schreiber/js-sf-cli-security-audit/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-blue" alt="License"></a>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
+
A plugin for the sf CLI to perform automated security audits.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
8
12
|
> [!IMPORTANT]\
|
|
9
13
|
> The SAE is still in beta and under active development. Command signatures, results report format, and directory structures can change.
|
|
10
14
|
|
|
@@ -85,7 +89,7 @@ FLAG DESCRIPTIONS
|
|
|
85
89
|
essentially control, if a permission is allowed in a certain profile / permission set.
|
|
86
90
|
```
|
|
87
91
|
|
|
88
|
-
_See code: [src/commands/org/audit/init.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.16.
|
|
92
|
+
_See code: [src/commands/org/audit/init.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.16.1/src/commands/org/audit/init.ts)_
|
|
89
93
|
|
|
90
94
|
## `sf org audit run`
|
|
91
95
|
|
|
@@ -130,7 +134,7 @@ FLAG DESCRIPTIONS
|
|
|
130
134
|
never truncated.
|
|
131
135
|
```
|
|
132
136
|
|
|
133
|
-
_See code: [src/commands/org/audit/run.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.16.
|
|
137
|
+
_See code: [src/commands/org/audit/run.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.16.1/src/commands/org/audit/run.ts)_
|
|
134
138
|
|
|
135
139
|
## `sf org scan user-perms`
|
|
136
140
|
|
|
@@ -138,13 +142,13 @@ Performs a quick scan for specific user permissions.
|
|
|
138
142
|
|
|
139
143
|
```
|
|
140
144
|
USAGE
|
|
141
|
-
$ sf org scan user-perms -n <value>... -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [
|
|
145
|
+
$ sf org scan user-perms -n <value>... -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d]
|
|
142
146
|
|
|
143
147
|
FLAGS
|
|
148
|
+
-d, --deep-scan Include all user permission assignments.
|
|
144
149
|
-n, --name=<value>... (required) One or more permissions to be searched for.
|
|
145
150
|
-o, --target-org=<value> (required) The target org to scan.
|
|
146
151
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
147
|
-
--deep-scan Include all user permission assignments.
|
|
148
152
|
|
|
149
153
|
GLOBAL FLAGS
|
|
150
154
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -162,19 +166,19 @@ EXAMPLES
|
|
|
162
166
|
$ sf org scan user-perms -o MyTargetOrg -n AuthorApex -n ModifyMetadata
|
|
163
167
|
|
|
164
168
|
FLAG DESCRIPTIONS
|
|
165
|
-
-
|
|
169
|
+
-d, --deep-scan Include all user permission assignments.
|
|
166
170
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
userPermissions.yml. Currently, the names are not validated: If you have a typo (such as "AutorApex", the scan will
|
|
170
|
-
retun 0 results).
|
|
171
|
+
Searches the profile and all assigned permission sets for active users on the target org. A user can be listed
|
|
172
|
+
multiple times if they receive a permission from different sources (e.g. a profile and a permission set).
|
|
171
173
|
|
|
172
|
-
--
|
|
174
|
+
-n, --name=<value>... One or more permissions to be searched for.
|
|
173
175
|
|
|
174
|
-
|
|
176
|
+
You can specify any valid user permission on your org, such as "AuthorApex", "CustomizeApplication", or "ViewSetup".
|
|
177
|
+
If you are unsure what permissions are available on your org, initialise a new audit config and check the created
|
|
178
|
+
userPermissions.yml.
|
|
175
179
|
```
|
|
176
180
|
|
|
177
|
-
_See code: [src/commands/org/scan/user-perms.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.16.
|
|
181
|
+
_See code: [src/commands/org/scan/user-perms.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.16.1/src/commands/org/scan/user-perms.ts)_
|
|
178
182
|
|
|
179
183
|
<!-- commandsstop -->
|
|
180
184
|
|
|
@@ -25,6 +25,7 @@ export default class OrgUserPermScan extends SfCommand {
|
|
|
25
25
|
'deep-scan': Flags.boolean({
|
|
26
26
|
summary: messages.getMessage('flags.deep-scan.summary'),
|
|
27
27
|
description: messages.getMessage('flags.deep-scan.description'),
|
|
28
|
+
char: 'd',
|
|
28
29
|
}),
|
|
29
30
|
};
|
|
30
31
|
async run() {
|
|
@@ -58,7 +59,7 @@ export default class OrgUserPermScan extends SfCommand {
|
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
reportWarning = (event) => {
|
|
61
|
-
this.warn(messages.createWarning('
|
|
62
|
+
this.warn(messages.createWarning('PermissionNotFound', [event.permissionName]));
|
|
62
63
|
};
|
|
63
64
|
print(result) {
|
|
64
65
|
this.printSummary(result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-perms.js","sourceRoot":"","sources":["../../../../src/commands/org/scan/user-perms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,qBAIN,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,qBAAqB,CAAC,CAAC;AAIpG,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAgC;IACpE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,C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CAAC;YACD,OAAO,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,QAAQ,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;;AAGH,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,OAAQ,GAAwB,CAAC,KAAK,KAAK,SAAS,IAAK,GAAwB,CAAC,QAAQ,KAAK,SAAS,CAAC;AAC3G,CAAC"}
|
|
@@ -12,7 +12,7 @@ One or more permissions to be searched for.
|
|
|
12
12
|
|
|
13
13
|
# flags.name.description
|
|
14
14
|
|
|
15
|
-
You can specify any valid user permission on your org, such as "AuthorApex", "CustomizeApplication" or "ViewSetup". If you are unsure what permissions are available on your org, initialise a new audit config and check the created userPermissions.yml.
|
|
15
|
+
You can specify any valid user permission on your org, such as "AuthorApex", "CustomizeApplication", or "ViewSetup". If you are unsure what permissions are available on your org, initialise a new audit config and check the created userPermissions.yml.
|
|
16
16
|
|
|
17
17
|
# flags.target-org.summary
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ Include all user permission assignments.
|
|
|
24
24
|
|
|
25
25
|
# flags.deep-scan.description
|
|
26
26
|
|
|
27
|
-
Searches the profile and all assigned permission sets for
|
|
27
|
+
Searches the profile and all assigned permission sets for active users on the target org. A user can be listed multiple times if they receive a permission from different sources (e.g. a profile and a permission set).
|
|
28
28
|
|
|
29
29
|
# examples
|
|
30
30
|
|
|
@@ -36,6 +36,6 @@ Searches the profile and all assigned permission sets for every active user on t
|
|
|
36
36
|
|
|
37
37
|
Scanned %s profiles and %s permission sets.
|
|
38
38
|
|
|
39
|
-
#
|
|
39
|
+
# PermissionNotFound
|
|
40
40
|
|
|
41
41
|
Permission "%s" does not exist on the target org. Maybe you mistyped it?
|
package/oclif.manifest.json
CHANGED
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
},
|
|
206
206
|
"name": {
|
|
207
207
|
"char": "n",
|
|
208
|
-
"description": "You can specify any valid user permission on your org, such as \"AuthorApex\", \"CustomizeApplication\" or \"ViewSetup\". If you are unsure what permissions are available on your org, initialise a new audit config and check the created userPermissions.yml.
|
|
208
|
+
"description": "You can specify any valid user permission on your org, such as \"AuthorApex\", \"CustomizeApplication\", or \"ViewSetup\". If you are unsure what permissions are available on your org, initialise a new audit config and check the created userPermissions.yml.",
|
|
209
209
|
"name": "name",
|
|
210
210
|
"required": true,
|
|
211
211
|
"summary": "One or more permissions to be searched for.",
|
|
@@ -231,7 +231,8 @@
|
|
|
231
231
|
"type": "option"
|
|
232
232
|
},
|
|
233
233
|
"deep-scan": {
|
|
234
|
-
"
|
|
234
|
+
"char": "d",
|
|
235
|
+
"description": "Searches the profile and all assigned permission sets for active users on the target org. A user can be listed multiple times if they receive a permission from different sources (e.g. a profile and a permission set).",
|
|
235
236
|
"name": "deep-scan",
|
|
236
237
|
"summary": "Include all user permission assignments.",
|
|
237
238
|
"allowNo": false,
|
|
@@ -266,5 +267,5 @@
|
|
|
266
267
|
]
|
|
267
268
|
}
|
|
268
269
|
},
|
|
269
|
-
"version": "0.16.
|
|
270
|
+
"version": "0.16.1"
|
|
270
271
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@j-schreiber/sf-cli-security-audit",
|
|
3
3
|
"description": "Salesforce CLI plugin to automate highly configurable security audits",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/j-schreiber/js-sf-cli-security-audit"
|