@j-schreiber/sf-cli-security-audit 0.2.0
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 +104 -0
- package/bin/dev.js +8 -0
- package/messages/org.audit.init.md +29 -0
- package/messages/org.audit.run.md +41 -0
- package/messages/policies.general.md +7 -0
- package/messages/policyclassifications.md +35 -0
- package/messages/rules.enforceClassificationPresets.md +19 -0
- package/oclif.lock +9898 -0
- package/oclif.manifest.json +4 -0
- package/package.json +234 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# @j-schreiber/sf-cli-security-audit
|
|
2
|
+
|
|
3
|
+
> This plugin is still in beta and under active development. Command signatures may be subject to change.
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
This plugin is not yet published on NPM. You must check out the repo and link it locally.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://...
|
|
11
|
+
mkdir sf-cli-security-audit
|
|
12
|
+
yarn && yarn build
|
|
13
|
+
sf plugins link .
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
# Contribute
|
|
17
|
+
|
|
18
|
+
Contributers are welcome! Please reach out on [Linkedin](https://www.linkedin.com/in/jannis-schreiber/) or via [Email](mailto:info@lietzau-consulting.de).
|
|
19
|
+
|
|
20
|
+
# Documentation
|
|
21
|
+
|
|
22
|
+
<!-- commands -->
|
|
23
|
+
|
|
24
|
+
- [`sf org audit init`](#sf-org-audit-init)
|
|
25
|
+
- [`sf org audit run`](#sf-org-audit-run)
|
|
26
|
+
|
|
27
|
+
## `sf org audit init`
|
|
28
|
+
|
|
29
|
+
Initialises classifications and policies for a security audit.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
USAGE
|
|
33
|
+
$ sf org audit init -o <value> [--json] [--flags-dir <value>] [-d <value>] [--api-version <value>]
|
|
34
|
+
|
|
35
|
+
FLAGS
|
|
36
|
+
-d, --output-dir=<value> Directory where the audit config is initialised. If not set, the root directory will be
|
|
37
|
+
used.
|
|
38
|
+
-o, --target-org=<value> (required) Target org to export permissions, profiles, users, etc.
|
|
39
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
40
|
+
|
|
41
|
+
GLOBAL FLAGS
|
|
42
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
43
|
+
--json Format output as json.
|
|
44
|
+
|
|
45
|
+
DESCRIPTION
|
|
46
|
+
Initialises classifications and policies for a security audit.
|
|
47
|
+
|
|
48
|
+
Exports permissions (standard and custom), permission sets, profiles, users, etc from the target org. All
|
|
49
|
+
classifications are initialised with sane defaults that you can customize later.
|
|
50
|
+
|
|
51
|
+
EXAMPLES
|
|
52
|
+
Initialise audit policies at the root directory
|
|
53
|
+
|
|
54
|
+
$ sf org audit init -o MyTargetOrg
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
_See code: [src/commands/org/audit/init.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.1.0/src/commands/org/audit/init.ts)_
|
|
58
|
+
|
|
59
|
+
## `sf org audit run`
|
|
60
|
+
|
|
61
|
+
Audit your org.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
USAGE
|
|
65
|
+
$ sf org audit run -o <value> -d <value> [--json] [--flags-dir <value>] [--api-version <value>]
|
|
66
|
+
|
|
67
|
+
FLAGS
|
|
68
|
+
-d, --source-dir=<value> (required) Location of the audit config.
|
|
69
|
+
-o, --target-org=<value> (required) The org that is audited.
|
|
70
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
71
|
+
|
|
72
|
+
GLOBAL FLAGS
|
|
73
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
74
|
+
--json Format output as json.
|
|
75
|
+
|
|
76
|
+
DESCRIPTION
|
|
77
|
+
Audit your org.
|
|
78
|
+
|
|
79
|
+
Loads a given audit config (a set of classifications and policies) and runs the policies against the target org. The
|
|
80
|
+
audit run creates a comprehensive report that lists all executed policies and all resolved entities that were audited.
|
|
81
|
+
|
|
82
|
+
EXAMPLES
|
|
83
|
+
Audit the org MyTargetOrg with the config in configs/prod
|
|
84
|
+
|
|
85
|
+
$ sf org audit run -o MyTargetOrg -d configs/prod
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
_See code: [src/commands/org/audit/run.ts](https://github.com/j-schreiber/js-sf-cli-security-audit/blob/v0.1.0/src/commands/org/audit/run.ts)_
|
|
89
|
+
|
|
90
|
+
<!-- commandsstop -->
|
|
91
|
+
|
|
92
|
+
# Development
|
|
93
|
+
|
|
94
|
+
Make sure the dev plugin is installed
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
sf plugins install @salesforce/plugin-dev
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Generate a new command (initialises messages, tests, etc)
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
sf dev generate command -n my:command:name
|
|
104
|
+
```
|
package/bin/dev.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
|
|
2
|
+
// eslint-disable-next-line node/shebang
|
|
3
|
+
async function main() {
|
|
4
|
+
const { execute } = await import('@oclif/core');
|
|
5
|
+
await execute({ development: true, dir: import.meta.url });
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
await main();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Initialises classifications and policies for a security audit.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Exports permissions (standard and custom), permission sets, profiles, users, etc from the target org. All classifications are initialised with sane defaults that you can customize later.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
Target org to export permissions, profiles, users, etc.
|
|
12
|
+
|
|
13
|
+
# flags.output-dir.summary
|
|
14
|
+
|
|
15
|
+
Directory where the audit config is initialised. If not set, the root directory will be used.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- Initialise audit policies at the root directory
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %> -o MyTargetOrg
|
|
22
|
+
|
|
23
|
+
# success.perm-classification-summary
|
|
24
|
+
|
|
25
|
+
Initialised %s permissions at %s.
|
|
26
|
+
|
|
27
|
+
# success.policy-summary
|
|
28
|
+
|
|
29
|
+
Initialised policy "%s" with %s items at %s.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Audit your org.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Loads a given audit config (a set of classifications and policies) and runs the policies against the target org. The audit run creates a comprehensive report that lists all executed policies and all resolved entities that were audited.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
The org that is audited.
|
|
12
|
+
|
|
13
|
+
# flags.source-dir.summary
|
|
14
|
+
|
|
15
|
+
Location of the audit config.
|
|
16
|
+
|
|
17
|
+
# flags.source-dir.description
|
|
18
|
+
|
|
19
|
+
Loads all classifications and policies from the directory and uses them to audit the org. Only policies that are enabled and that exist in the directory are executed.
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Audit the org MyTargetOrg with the config in configs/prod
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> -o MyTargetOrg -d configs/prod
|
|
26
|
+
|
|
27
|
+
# success.summary
|
|
28
|
+
|
|
29
|
+
Successfully executed %s policies.
|
|
30
|
+
|
|
31
|
+
# success.all-policies-compliant
|
|
32
|
+
|
|
33
|
+
All policies are compliant.
|
|
34
|
+
|
|
35
|
+
# summary-non-compliant
|
|
36
|
+
|
|
37
|
+
At least one policy is not compliant. Review details below.
|
|
38
|
+
|
|
39
|
+
# info.report-file-location
|
|
40
|
+
|
|
41
|
+
Full report was written to: %s.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# CustomizeApplication
|
|
2
|
+
|
|
3
|
+
Allows to modify all parts of the app, including security settings.
|
|
4
|
+
|
|
5
|
+
# Packaging
|
|
6
|
+
|
|
7
|
+
Allows to create, manage and install packages.
|
|
8
|
+
|
|
9
|
+
# ViewSetup
|
|
10
|
+
|
|
11
|
+
Allows to browse setup and view sensitive configurations.
|
|
12
|
+
|
|
13
|
+
# ViewAllData
|
|
14
|
+
|
|
15
|
+
Bypass all sharing, making all sharing architecture obsolete.
|
|
16
|
+
|
|
17
|
+
# AuthorApex
|
|
18
|
+
|
|
19
|
+
Apex can perform harmful actions, and deployed Apex runs in system mode.
|
|
20
|
+
|
|
21
|
+
# ApiEnabled
|
|
22
|
+
|
|
23
|
+
Api access allows to perform a vast amount of actions and should be restricted to integrations, admins, and developers.
|
|
24
|
+
|
|
25
|
+
# ManageAuthProviders
|
|
26
|
+
|
|
27
|
+
Enables the user to set up external identity provider for SSO.
|
|
28
|
+
|
|
29
|
+
# ManageTwoFactor
|
|
30
|
+
|
|
31
|
+
Set up and reset the connected MFA for a user.
|
|
32
|
+
|
|
33
|
+
# CanApproveUninstalledApps
|
|
34
|
+
|
|
35
|
+
Allows to authorize new connected apps and therefore new integrations.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# violations.classification-preset-mismatch
|
|
2
|
+
|
|
3
|
+
Permission is classified as "%s" and not allowed in preset "%s".
|
|
4
|
+
|
|
5
|
+
# violations.permission-is-blocked
|
|
6
|
+
|
|
7
|
+
Permission is BLOCKED and not allowed in any preset.
|
|
8
|
+
|
|
9
|
+
# warnings.permission-unknown
|
|
10
|
+
|
|
11
|
+
Permission classified as UNKNOWN. Update classification to LOW or higher to resolve.
|
|
12
|
+
|
|
13
|
+
# warnings.permission-not-classified-in-profile
|
|
14
|
+
|
|
15
|
+
Profile assigns the permission, but it was not found in classification. Refresh or add manually.
|
|
16
|
+
|
|
17
|
+
# warnings.permission-not-classified-in-permission-set
|
|
18
|
+
|
|
19
|
+
PermissionSet assigns the permission, but it was not found in classification. Refresh or add manually.
|