@j-schreiber/sf-cli-security-audit 0.4.0 → 0.4.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.
Files changed (121) hide show
  1. package/lib/commands/org/audit/init.d.ts +1 -1
  2. package/lib/commands/org/audit/init.js +2 -2
  3. package/lib/commands/org/audit/init.js.map +1 -1
  4. package/lib/commands/org/audit/run.d.ts +1 -1
  5. package/lib/libs/{policies/initialisation → conf-init}/auditConfig.d.ts +1 -1
  6. package/lib/libs/{policies/initialisation → conf-init}/auditConfig.js +3 -5
  7. package/lib/libs/conf-init/auditConfig.js.map +1 -0
  8. package/lib/libs/{config → conf-init}/defaultPolicyClassification.d.ts +1 -1
  9. package/lib/libs/{config → conf-init}/defaultPolicyClassification.js +15 -15
  10. package/lib/libs/conf-init/defaultPolicyClassification.js.map +1 -0
  11. package/lib/libs/{policies/initialisation → conf-init}/permissionsClassification.d.ts +1 -2
  12. package/lib/libs/{policies/initialisation → conf-init}/permissionsClassification.js +5 -6
  13. package/lib/libs/conf-init/permissionsClassification.js.map +1 -0
  14. package/lib/libs/{policies/initialisation → conf-init}/policyConfigs.d.ts +1 -1
  15. package/lib/libs/{policies/initialisation → conf-init}/policyConfigs.js +8 -10
  16. package/lib/libs/conf-init/policyConfigs.js.map +1 -0
  17. package/lib/libs/core/classification-types.d.ts +20 -0
  18. package/lib/libs/core/classification-types.js +23 -0
  19. package/lib/libs/core/classification-types.js.map +1 -0
  20. package/lib/libs/{config/queries.js → core/constants.js} +1 -1
  21. package/lib/libs/core/constants.js.map +1 -0
  22. package/lib/libs/{config/audit-run → core/file-mgmt}/auditConfigFileManager.d.ts +19 -0
  23. package/lib/libs/{config/audit-run → core/file-mgmt}/auditConfigFileManager.js +22 -7
  24. package/lib/libs/core/file-mgmt/auditConfigFileManager.js.map +1 -0
  25. package/lib/libs/{config/audit-run → core/file-mgmt}/schema.d.ts +10 -9
  26. package/lib/libs/{config/audit-run → core/file-mgmt}/schema.js +4 -3
  27. package/lib/libs/core/file-mgmt/schema.js.map +1 -0
  28. package/lib/libs/core/mdapi/mdapiRetriever.d.ts +110 -0
  29. package/lib/libs/core/mdapi/mdapiRetriever.js +193 -0
  30. package/lib/libs/core/mdapi/mdapiRetriever.js.map +1 -0
  31. package/lib/libs/core/policy-types.d.ts +18 -0
  32. package/lib/libs/core/policy-types.js +28 -0
  33. package/lib/libs/core/policy-types.js.map +1 -0
  34. package/lib/libs/core/registries/connectedApps.d.ts +13 -0
  35. package/lib/libs/{config → core}/registries/connectedApps.js +2 -2
  36. package/lib/libs/core/registries/connectedApps.js.map +1 -0
  37. package/lib/libs/{config → core}/registries/permissionSets.d.ts +6 -0
  38. package/lib/libs/{config → core}/registries/permissionSets.js +1 -1
  39. package/lib/libs/core/registries/permissionSets.js.map +1 -0
  40. package/lib/libs/{config → core}/registries/profiles.d.ts +6 -0
  41. package/lib/libs/{config → core}/registries/profiles.js +2 -2
  42. package/lib/libs/core/registries/profiles.js.map +1 -0
  43. package/lib/libs/{config → core}/registries/ruleRegistry.d.ts +13 -3
  44. package/lib/libs/core/registries/ruleRegistry.js.map +1 -0
  45. package/lib/libs/{policies → core/registries}/rules/allUsedAppsUnderManagement.d.ts +2 -2
  46. package/lib/libs/core/registries/rules/allUsedAppsUnderManagement.js.map +1 -0
  47. package/lib/libs/{policies → core/registries}/rules/enforceCustomPermsClassificationOnProfiles.d.ts +2 -2
  48. package/lib/libs/{policies → core/registries}/rules/enforceCustomPermsClassificationOnProfiles.js +4 -3
  49. package/lib/libs/core/registries/rules/enforceCustomPermsClassificationOnProfiles.js.map +1 -0
  50. package/lib/libs/{policies → core/registries}/rules/enforceUserPermsClassificationOnPermSets.d.ts +2 -2
  51. package/lib/libs/{policies → core/registries}/rules/enforceUserPermsClassificationOnPermSets.js +4 -3
  52. package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnPermSets.js.map +1 -0
  53. package/lib/libs/{policies → core/registries}/rules/enforceUserPermsClassificationOnProfiles.d.ts +2 -2
  54. package/lib/libs/{policies → core/registries}/rules/enforceUserPermsClassificationOnProfiles.js +4 -3
  55. package/lib/libs/core/registries/rules/enforceUserPermsClassificationOnProfiles.js.map +1 -0
  56. package/lib/libs/{policies → core/registries}/rules/noUserCanSelfAuthorize.d.ts +2 -2
  57. package/lib/libs/core/registries/rules/noUserCanSelfAuthorize.js.map +1 -0
  58. package/lib/libs/{policies → core/registries}/rules/policyRule.d.ts +2 -2
  59. package/lib/libs/core/registries/rules/policyRule.js.map +1 -0
  60. package/lib/libs/{policies/interfaces/policyRuleInterfaces.d.ts → core/registries/types.d.ts} +7 -2
  61. package/lib/libs/core/registries/types.js +9 -0
  62. package/lib/libs/core/registries/types.js.map +1 -0
  63. package/lib/libs/{audit/types.d.ts → core/result-types.d.ts} +17 -0
  64. package/lib/libs/core/result-types.js +2 -0
  65. package/lib/libs/core/result-types.js.map +1 -0
  66. package/lib/libs/core/utils.js.map +1 -0
  67. package/lib/libs/policies/auditRun.d.ts +2 -2
  68. package/lib/libs/policies/auditRun.js +2 -2
  69. package/lib/libs/policies/auditRun.js.map +1 -1
  70. package/lib/libs/policies/connectedAppPolicy.d.ts +3 -12
  71. package/lib/libs/policies/connectedAppPolicy.js +6 -6
  72. package/lib/libs/policies/connectedAppPolicy.js.map +1 -1
  73. package/lib/libs/policies/permissionSetPolicy.d.ts +3 -10
  74. package/lib/libs/policies/permissionSetPolicy.js +17 -16
  75. package/lib/libs/policies/permissionSetPolicy.js.map +1 -1
  76. package/lib/libs/policies/policy.d.ts +4 -5
  77. package/lib/libs/policies/policy.js.map +1 -1
  78. package/lib/libs/policies/profilePolicy.d.ts +3 -10
  79. package/lib/libs/policies/profilePolicy.js +5 -5
  80. package/lib/libs/policies/profilePolicy.js.map +1 -1
  81. package/oclif.manifest.json +1 -1
  82. package/package.json +1 -1
  83. package/lib/libs/audit/types.js +0 -2
  84. package/lib/libs/audit/types.js.map +0 -1
  85. package/lib/libs/config/audit-run/auditConfigFileManager.js.map +0 -1
  86. package/lib/libs/config/audit-run/schema.js.map +0 -1
  87. package/lib/libs/config/defaultPolicyClassification.js.map +0 -1
  88. package/lib/libs/config/queries.js.map +0 -1
  89. package/lib/libs/config/registries/connectedApps.d.ts +0 -5
  90. package/lib/libs/config/registries/connectedApps.js.map +0 -1
  91. package/lib/libs/config/registries/permissionSets.js.map +0 -1
  92. package/lib/libs/config/registries/profiles.js.map +0 -1
  93. package/lib/libs/config/registries/ruleRegistry.js.map +0 -1
  94. package/lib/libs/config/registries/types.d.ts +0 -7
  95. package/lib/libs/config/registries/types.js +0 -2
  96. package/lib/libs/config/registries/types.js.map +0 -1
  97. package/lib/libs/mdapiRetriever.d.ts +0 -18
  98. package/lib/libs/mdapiRetriever.js +0 -60
  99. package/lib/libs/mdapiRetriever.js.map +0 -1
  100. package/lib/libs/policies/initialisation/auditConfig.js.map +0 -1
  101. package/lib/libs/policies/initialisation/permissionsClassification.js.map +0 -1
  102. package/lib/libs/policies/initialisation/policyConfigs.js.map +0 -1
  103. package/lib/libs/policies/interfaces/policyRuleInterfaces.js +0 -2
  104. package/lib/libs/policies/interfaces/policyRuleInterfaces.js.map +0 -1
  105. package/lib/libs/policies/rules/allUsedAppsUnderManagement.js.map +0 -1
  106. package/lib/libs/policies/rules/enforceCustomPermsClassificationOnProfiles.js.map +0 -1
  107. package/lib/libs/policies/rules/enforceUserPermsClassificationOnPermSets.js.map +0 -1
  108. package/lib/libs/policies/rules/enforceUserPermsClassificationOnProfiles.js.map +0 -1
  109. package/lib/libs/policies/rules/noUserCanSelfAuthorize.js.map +0 -1
  110. package/lib/libs/policies/rules/policyRule.js.map +0 -1
  111. package/lib/libs/policies/types.d.ts +0 -36
  112. package/lib/libs/policies/types.js +0 -45
  113. package/lib/libs/policies/types.js.map +0 -1
  114. package/lib/libs/utils.js.map +0 -1
  115. /package/lib/libs/{config/queries.d.ts → core/constants.d.ts} +0 -0
  116. /package/lib/libs/{config → core}/registries/ruleRegistry.js +0 -0
  117. /package/lib/libs/{policies → core/registries}/rules/allUsedAppsUnderManagement.js +0 -0
  118. /package/lib/libs/{policies → core/registries}/rules/noUserCanSelfAuthorize.js +0 -0
  119. /package/lib/libs/{policies → core/registries}/rules/policyRule.js +0 -0
  120. /package/lib/libs/{utils.d.ts → core/utils.d.ts} +0 -0
  121. /package/lib/libs/{utils.js → core/utils.js} +0 -0
@@ -0,0 +1,110 @@
1
+ import { PathLike } from 'node:fs';
2
+ import { Connection } from '@salesforce/core';
3
+ import { XMLParser } from 'fast-xml-parser';
4
+ import { ConnectedAppSettings, PermissionSet } from '@jsforce/jsforce-node/lib/api/metadata.js';
5
+ export default class MDAPI {
6
+ private connection;
7
+ private cache;
8
+ constructor(connection: Connection);
9
+ /**
10
+ * Resolves one of the pre-configured metadata types and returns
11
+ * a map of resolved names and entire XML content of source file body.
12
+ *
13
+ * @param typeName
14
+ * @param componentNames
15
+ * @returns
16
+ */
17
+ resolve<K extends keyof typeof NamedTypesRegistry>(typeName: keyof typeof NamedTypesRegistry, componentNames: string[]): Promise<NamedReturnTypes[K]>;
18
+ /**
19
+ * Resolves one of the pre-configured metadata types and returns
20
+ * the entire XML content of source file body.
21
+ *
22
+ * @param typeName
23
+ * @returns
24
+ */
25
+ resolveSingleton<K extends keyof typeof SingletonRegistry>(typeName: keyof typeof SingletonRegistry): Promise<SingletonReturnTypes[K]>;
26
+ private cacheResults;
27
+ private fetchCached;
28
+ }
29
+ type MetadataRegistryEntryOpts<Type, Key extends keyof Type> = {
30
+ /**
31
+ * Metadata API name of the type.
32
+ */
33
+ retrieveType: string;
34
+ /**
35
+ * Metadata API name entity.
36
+ */
37
+ retrieveName?: string;
38
+ /**
39
+ * Optional XML parser instance. Typically used to fix errors for
40
+ * properties that must be parsed as list.
41
+ */
42
+ parser?: XMLParser;
43
+ /**
44
+ * Name of the root node in XML file content
45
+ */
46
+ rootNodeName: Key;
47
+ /**
48
+ * Post processor function that sanitises the XML parse result
49
+ */
50
+ parsePostProcessor?: (parseResult: Type[Key]) => Type[Key];
51
+ };
52
+ declare abstract class MetadataRegistryEntry<Type, Key extends keyof Type> {
53
+ private opts;
54
+ parser: XMLParser;
55
+ retrieveType: string;
56
+ rootNodeName: Key;
57
+ constructor(opts: MetadataRegistryEntryOpts<Type, Key>);
58
+ parse(fullFilePath: PathLike): Type[Key];
59
+ }
60
+ /**
61
+ * The entry is a type that only has one single instance on the org, such as
62
+ * a Setting. The component is retrieved by its root node name
63
+ * (e.g. ConnectedAppSettings, AccountSettings, etc).
64
+ */
65
+ declare class SingletonMetadata<Type, Key extends keyof Type> extends MetadataRegistryEntry<Type, Key> {
66
+ retrieveName: string;
67
+ constructor(opts: MetadataRegistryEntryOpts<Type, Key>);
68
+ /**
69
+ * Resolves component names, retrieves the metadata and returns
70
+ * as a strongly typed result.
71
+ *
72
+ * @param con
73
+ * @param componentNames
74
+ * @returns
75
+ */
76
+ resolve(con: Connection): Promise<Type[Key]>;
77
+ private parseSourceFile;
78
+ }
79
+ declare class NamedMetadata<Type, Key extends keyof Type> extends MetadataRegistryEntry<Type, Key> {
80
+ constructor(opts: MetadataRegistryEntryOpts<Type, Key>);
81
+ /**
82
+ * Resolves component names, retrieves the metadata and returns
83
+ * as a strongly typed result.
84
+ *
85
+ * @param con
86
+ * @param componentNames
87
+ * @returns
88
+ */
89
+ resolve(con: Connection, componentNames: string[]): Promise<Record<string, Type[Key]>>;
90
+ private parseSourceFiles;
91
+ }
92
+ export declare const NamedTypesRegistry: {
93
+ PermissionSet: NamedMetadata<PermissionSetXml, "PermissionSet">;
94
+ };
95
+ export declare const SingletonRegistry: {
96
+ ConnectedAppSettings: SingletonMetadata<ConnectedAppSettingsXml, "ConnectedAppSettings">;
97
+ };
98
+ type NamedReturnTypes = {
99
+ [K in keyof typeof NamedTypesRegistry]: Awaited<ReturnType<(typeof NamedTypesRegistry)[K]['resolve']>>;
100
+ };
101
+ type SingletonReturnTypes = {
102
+ [K in keyof typeof SingletonRegistry]: Awaited<ReturnType<(typeof SingletonRegistry)[K]['resolve']>>;
103
+ };
104
+ type PermissionSetXml = {
105
+ PermissionSet: PermissionSet;
106
+ };
107
+ type ConnectedAppSettingsXml = {
108
+ ConnectedAppSettings: ConnectedAppSettings;
109
+ };
110
+ export {};
@@ -0,0 +1,193 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { ComponentSet } from '@salesforce/source-deploy-retrieve';
3
+ import { XMLParser } from 'fast-xml-parser';
4
+ export default class MDAPI {
5
+ connection;
6
+ cache;
7
+ constructor(connection) {
8
+ this.connection = connection;
9
+ this.cache = new MetadataCache();
10
+ }
11
+ /**
12
+ * Resolves one of the pre-configured metadata types and returns
13
+ * a map of resolved names and entire XML content of source file body.
14
+ *
15
+ * @param typeName
16
+ * @param componentNames
17
+ * @returns
18
+ */
19
+ async resolve(typeName, componentNames) {
20
+ const retriever = NamedTypesRegistry[typeName];
21
+ const { toRetrieve, cached } = this.fetchCached(componentNames);
22
+ if (toRetrieve.length > 0) {
23
+ const retrieveResults = await retriever.resolve(this.connection, toRetrieve);
24
+ this.cacheResults(retrieveResults);
25
+ return {
26
+ ...cached,
27
+ ...retrieveResults,
28
+ };
29
+ }
30
+ return cached;
31
+ }
32
+ /**
33
+ * Resolves one of the pre-configured metadata types and returns
34
+ * the entire XML content of source file body.
35
+ *
36
+ * @param typeName
37
+ * @returns
38
+ */
39
+ async resolveSingleton(typeName) {
40
+ const retriever = SingletonRegistry[typeName];
41
+ const { toRetrieve, cached } = this.fetchCached([typeName]);
42
+ if (toRetrieve.length > 0) {
43
+ const retrieveResults = await retriever.resolve(this.connection);
44
+ this.cache.set(typeName, retrieveResults);
45
+ return retrieveResults;
46
+ }
47
+ return cached[typeName];
48
+ }
49
+ cacheResults(results) {
50
+ Object.entries(results).forEach(([cname, mdata]) => {
51
+ this.cache.set(cname, mdata);
52
+ });
53
+ }
54
+ fetchCached(componentNames) {
55
+ const toRetrieve = [];
56
+ const cached = {};
57
+ for (const cname of componentNames) {
58
+ if (this.cache.isCached(cname)) {
59
+ cached[cname] = this.cache.fetch(cname);
60
+ }
61
+ else {
62
+ toRetrieve.push(cname);
63
+ }
64
+ }
65
+ return { toRetrieve, cached };
66
+ }
67
+ }
68
+ class MetadataCache {
69
+ components = {};
70
+ isCached(cmpName) {
71
+ return this.components[cmpName] !== undefined && this.components[cmpName] !== null;
72
+ }
73
+ fetch(cmpName) {
74
+ if (!this.isCached(cmpName)) {
75
+ throw new Error('Component not cached. Check first before fetching: ' + cmpName);
76
+ }
77
+ return this.components[cmpName];
78
+ }
79
+ set(cmpName, content) {
80
+ this.components[cmpName] = content;
81
+ }
82
+ }
83
+ class MetadataRegistryEntry {
84
+ opts;
85
+ parser;
86
+ retrieveType;
87
+ rootNodeName;
88
+ constructor(opts) {
89
+ this.opts = opts;
90
+ this.retrieveType = this.opts.retrieveType;
91
+ this.parser = this.opts.parser ?? new XMLParser();
92
+ this.rootNodeName = this.opts.rootNodeName;
93
+ }
94
+ parse(fullFilePath) {
95
+ const fileContent = readFileSync(fullFilePath, 'utf-8');
96
+ const parsedContent = this.parser.parse(fileContent);
97
+ if (this.opts.parsePostProcessor) {
98
+ return this.opts.parsePostProcessor(parsedContent[this.rootNodeName]);
99
+ }
100
+ return parsedContent[this.rootNodeName];
101
+ }
102
+ }
103
+ /**
104
+ * The entry is a type that only has one single instance on the org, such as
105
+ * a Setting. The component is retrieved by its root node name
106
+ * (e.g. ConnectedAppSettings, AccountSettings, etc).
107
+ */
108
+ class SingletonMetadata extends MetadataRegistryEntry {
109
+ retrieveName;
110
+ constructor(opts) {
111
+ super(opts);
112
+ this.retrieveName = opts.retrieveName ?? String(this.rootNodeName);
113
+ }
114
+ /**
115
+ * Resolves component names, retrieves the metadata and returns
116
+ * as a strongly typed result.
117
+ *
118
+ * @param con
119
+ * @param componentNames
120
+ * @returns
121
+ */
122
+ async resolve(con) {
123
+ const cmpSet = new ComponentSet([{ type: this.retrieveType, fullName: this.retrieveName }]);
124
+ const retrieveResult = await retrieve(cmpSet, con);
125
+ return this.parseSourceFile(retrieveResult.components);
126
+ }
127
+ parseSourceFile(componentSet) {
128
+ const cmps = componentSet.getSourceComponents({ type: this.retrieveType, fullName: this.retrieveName }).toArray();
129
+ if (cmps.length > 0 && cmps[0].xml) {
130
+ return this.parse(cmps[0].xml);
131
+ }
132
+ throw new Error('Failed to resolve settings for: ' + this.retrieveName);
133
+ }
134
+ }
135
+ class NamedMetadata extends MetadataRegistryEntry {
136
+ constructor(opts) {
137
+ super(opts);
138
+ }
139
+ /**
140
+ * Resolves component names, retrieves the metadata and returns
141
+ * as a strongly typed result.
142
+ *
143
+ * @param con
144
+ * @param componentNames
145
+ * @returns
146
+ */
147
+ async resolve(con, componentNames) {
148
+ const cmpSet = new ComponentSet(componentNames.map((cname) => ({ type: this.retrieveType, fullName: cname })));
149
+ const retrieveResult = await retrieve(cmpSet, con);
150
+ return this.parseSourceFiles(retrieveResult.components, componentNames);
151
+ }
152
+ parseSourceFiles(componentSet, retrievedNames) {
153
+ const cmps = componentSet.getSourceComponents().toArray();
154
+ const result = {};
155
+ cmps.forEach((sourceComponent) => {
156
+ if (sourceComponent.xml && retrievedNames.includes(sourceComponent.name)) {
157
+ result[sourceComponent.name] = this.parse(sourceComponent.xml);
158
+ }
159
+ });
160
+ return result;
161
+ }
162
+ }
163
+ async function retrieve(compSet, con) {
164
+ const retrieveRequest = await compSet.retrieve({
165
+ usernameOrConnection: con,
166
+ output: '.jsc/retrieves',
167
+ });
168
+ const retrieveResult = await retrieveRequest.pollStatus();
169
+ return retrieveResult;
170
+ }
171
+ export const NamedTypesRegistry = {
172
+ PermissionSet: new NamedMetadata({
173
+ retrieveType: 'PermissionSet',
174
+ rootNodeName: 'PermissionSet',
175
+ parser: new XMLParser({
176
+ isArray: (jpath) => ['userPermissions', 'fieldPermissions', 'customPermissions', 'classAccesses'].includes(jpath),
177
+ }),
178
+ parsePostProcessor: (parseResult) => ({
179
+ ...parseResult,
180
+ userPermissions: parseResult.userPermissions ?? [],
181
+ customPermissions: parseResult.customPermissions ?? [],
182
+ classAccesses: parseResult.classAccesses ?? [],
183
+ }),
184
+ }),
185
+ };
186
+ export const SingletonRegistry = {
187
+ ConnectedAppSettings: new SingletonMetadata({
188
+ rootNodeName: 'ConnectedAppSettings',
189
+ retrieveName: 'ConnectedApp',
190
+ retrieveType: 'Settings',
191
+ }),
192
+ };
193
+ //# sourceMappingURL=mdapiRetriever.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdapiRetriever.js","sourceRoot":"","sources":["../../../../src/libs/core/mdapi/mdapiRetriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAkB,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,KAAK;IAGG;IAFnB,KAAK,CAAgB;IAE7B,YAA2B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,EAAE,CAAC;IACnC,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,OAAO,CAClB,QAAyC,EACzC,cAAwB;QAExB,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAChE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAC7E,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YACnC,OAAO;gBACL,GAAG,MAAM;gBACT,GAAG,eAAe;aACI,CAAC;QAC3B,CAAC;QACD,OAAO,MAA6B,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;I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AAC,MAAM,kBAAkB,GAAG;IAChC,aAAa,EAAE,IAAI,aAAa,CAAoC;QAClE,YAAY,EAAE,eAAe;QAC7B,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,IAAI,SAAS,CAAC;YACpB,OAAO,EAAE,CAAC,KAAK,EAAW,EAAE,CAC1B,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;SAChG,CAAC;QACF,kBAAkB,EAAE,CAAC,WAAW,EAAiB,EAAE,CAAC,CAAC;YACnD,GAAG,WAAW;YACd,eAAe,EAAE,WAAW,CAAC,eAAe,IAAI,EAAE;YAClD,iBAAiB,EAAE,WAAW,CAAC,iBAAiB,IAAI,EAAE;YACtD,aAAa,EAAE,WAAW,CAAC,aAAa,IAAI,EAAE;SAC/C,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,oBAAoB,EAAE,IAAI,iBAAiB,CAAkD;QAC3F,YAAY,EAAE,sBAAsB;QACpC,YAAY,EAAE,cAAc;QAC5B,YAAY,EAAE,UAAU;KACzB,CAAC;CACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Presets can be assigned to profiles and permission sets.
3
+ * A preset allows permissions up to a fixed risk level.
4
+ */
5
+ export declare enum ProfilesRiskPreset {
6
+ /** Allows up to "Critical" permissions */
7
+ DEVELOPER = "Developer",
8
+ /** Allows up to "High" permissions */
9
+ ADMIN = "Admin",
10
+ /** Allows up to "Medium" permissions */
11
+ POWER_USER = "Power User",
12
+ /** Allows only "Low" permissions */
13
+ STANDARD_USER = "Standard User",
14
+ /** Disables the profile for audit */
15
+ UNKNOWN = "Unknown"
16
+ }
17
+ export declare function resolvePresetOrdinalValue(value: string): number;
18
+ export declare function permissionAllowedInPreset(permClassification: string, preset: string): boolean;
@@ -0,0 +1,28 @@
1
+ import { PermissionRiskLevel, resolveRiskLevelOrdinalValue } from './classification-types.js';
2
+ /**
3
+ * Presets can be assigned to profiles and permission sets.
4
+ * A preset allows permissions up to a fixed risk level.
5
+ */
6
+ export var ProfilesRiskPreset;
7
+ (function (ProfilesRiskPreset) {
8
+ /** Allows up to "Critical" permissions */
9
+ ProfilesRiskPreset["DEVELOPER"] = "Developer";
10
+ /** Allows up to "High" permissions */
11
+ ProfilesRiskPreset["ADMIN"] = "Admin";
12
+ /** Allows up to "Medium" permissions */
13
+ ProfilesRiskPreset["POWER_USER"] = "Power User";
14
+ /** Allows only "Low" permissions */
15
+ ProfilesRiskPreset["STANDARD_USER"] = "Standard User";
16
+ /** Disables the profile for audit */
17
+ ProfilesRiskPreset["UNKNOWN"] = "Unknown";
18
+ })(ProfilesRiskPreset || (ProfilesRiskPreset = {}));
19
+ export function resolvePresetOrdinalValue(value) {
20
+ return Object.keys(ProfilesRiskPreset).indexOf(value.toUpperCase().replace(' ', '_'));
21
+ }
22
+ export function permissionAllowedInPreset(permClassification, preset) {
23
+ // this works, as long as we are mindful when adding new risk levels and presets
24
+ const invertedPermValue = Object.keys(PermissionRiskLevel).length - resolveRiskLevelOrdinalValue(permClassification);
25
+ const invertedPresetValue = Object.keys(ProfilesRiskPreset).length - resolvePresetOrdinalValue(preset);
26
+ return invertedPresetValue >= invertedPermValue;
27
+ }
28
+ //# sourceMappingURL=policy-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy-types.js","sourceRoot":"","sources":["../../../src/libs/core/policy-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,0CAA0C;IAC1C,6CAAuB,CAAA;IACvB,sCAAsC;IACtC,qCAAe,CAAA;IACf,wCAAwC;IACxC,+CAAyB,CAAA;IACzB,oCAAoC;IACpC,qDAA+B,CAAA;IAC/B,qCAAqC;IACrC,yCAAmB,CAAA;AACrB,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAa;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,kBAA0B,EAAE,MAAc;IAClF,gFAAgF;IAChF,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,GAAG,4BAA4B,CAAC,kBAAkB,CAAC,CAAC;IACrH,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACvG,OAAO,mBAAmB,IAAI,iBAAiB,CAAC;AAClD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import RuleRegistry from './ruleRegistry.js';
2
+ export type ResolvedConnectedApp = {
3
+ name: string;
4
+ origin: 'Installed' | 'OauthToken' | 'Owned';
5
+ onlyAdminApprovedUsersAllowed: boolean;
6
+ overrideByApiSecurityAccess: boolean;
7
+ useCount: number;
8
+ users: string[];
9
+ };
10
+ export default class ConnectedAppsRuleRegistry extends RuleRegistry {
11
+ constructor();
12
+ }
13
+ export declare const ConnectedAppsRegistry: ConnectedAppsRuleRegistry;
@@ -1,5 +1,5 @@
1
- import AllUsedAppsUnderManagement from '../../policies/rules/allUsedAppsUnderManagement.js';
2
- import NoUserCanSelfAuthorize from '../../policies/rules/noUserCanSelfAuthorize.js';
1
+ import AllUsedAppsUnderManagement from './rules/allUsedAppsUnderManagement.js';
2
+ import NoUserCanSelfAuthorize from './rules/noUserCanSelfAuthorize.js';
3
3
  import RuleRegistry from './ruleRegistry.js';
4
4
  export default class ConnectedAppsRuleRegistry extends RuleRegistry {
5
5
  constructor() {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectedApps.js","sourceRoot":"","sources":["../../../../src/libs/core/registries/connectedApps.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,MAAM,uCAAuC,CAAC;AAC/E,OAAO,sBAAsB,MAAM,mCAAmC,CAAC;AACvE,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAU7C,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,YAAY;IACjE;QACE,KAAK,CAAC;YACJ,0BAA0B;YAC1B,sBAAsB;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,yBAAyB,EAAE,CAAC"}
@@ -1,4 +1,10 @@
1
+ import { PermissionSet } from '@jsforce/jsforce-node/lib/api/metadata.js';
1
2
  import RuleRegistry from './ruleRegistry.js';
3
+ export type ResolvedPermissionSet = {
4
+ name: string;
5
+ preset: string;
6
+ metadata: PermissionSet;
7
+ };
2
8
  export default class PermSetsRuleRegistry extends RuleRegistry {
3
9
  constructor();
4
10
  }
@@ -1,4 +1,4 @@
1
- import EnforceUserPermsClassificationOnPermSets from '../../policies/rules/enforceUserPermsClassificationOnPermSets.js';
1
+ import EnforceUserPermsClassificationOnPermSets from './rules/enforceUserPermsClassificationOnPermSets.js';
2
2
  import RuleRegistry from './ruleRegistry.js';
3
3
  export default class PermSetsRuleRegistry extends RuleRegistry {
4
4
  constructor() {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissionSets.js","sourceRoot":"","sources":["../../../../src/libs/core/registries/permissionSets.ts"],"names":[],"mappings":"AACA,OAAO,wCAAwC,MAAM,qDAAqD,CAAC;AAC3G,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAO7C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D;QACE,KAAK,CAAC;YACJ,oCAAoC,EAAE,wCAAwC;SAC/E,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
@@ -1,4 +1,10 @@
1
+ import { Profile as ProfileMetadata } from '@jsforce/jsforce-node/lib/api/metadata.js';
1
2
  import RuleRegistry from './ruleRegistry.js';
3
+ export type ResolvedProfile = {
4
+ name: string;
5
+ preset: string;
6
+ metadata: ProfileMetadata;
7
+ };
2
8
  export default class ProfilesRuleRegistry extends RuleRegistry {
3
9
  constructor();
4
10
  }
@@ -1,5 +1,5 @@
1
- import EnforceCustomPermsClassificationOnProfiles from '../../policies/rules/enforceCustomPermsClassificationOnProfiles.js';
2
- import EnforceUserPermsClassificationOnProfiles from '../../policies/rules/enforceUserPermsClassificationOnProfiles.js';
1
+ import EnforceCustomPermsClassificationOnProfiles from './rules/enforceCustomPermsClassificationOnProfiles.js';
2
+ import EnforceUserPermsClassificationOnProfiles from './rules/enforceUserPermsClassificationOnProfiles.js';
3
3
  import RuleRegistry from './ruleRegistry.js';
4
4
  export default class ProfilesRuleRegistry extends RuleRegistry {
5
5
  constructor() {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../../../src/libs/core/registries/profiles.ts"],"names":[],"mappings":"AACA,OAAO,0CAA0C,MAAM,uDAAuD,CAAC;AAC/G,OAAO,wCAAwC,MAAM,qDAAqD,CAAC;AAC3G,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAQ7C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D;QACE,KAAK,CAAC;YACJ,sCAAsC,EAAE,0CAA0C;YAClF,oCAAoC,EAAE,wCAAwC;SAC/E,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
@@ -1,7 +1,17 @@
1
- import { AuditRunConfig, RuleMap } from '../audit-run/schema.js';
2
- import { RowLevelPolicyRule } from '../../policies/interfaces/policyRuleInterfaces.js';
3
- import { RegistryRuleResolveResult } from './types.js';
1
+ import { EntityResolveError, PolicyRuleSkipResult } from '../result-types.js';
2
+ import { AuditRunConfig, RuleMap } from '../../core/file-mgmt/schema.js';
3
+ import { RowLevelPolicyRule } from './types.js';
4
4
  type Constructor<T, Args extends any[] = any[]> = new (...args: Args) => T;
5
+ /**
6
+ * Result contains the actually available and enabled rules
7
+ * from the raw config file. Rules that are not present in the
8
+ * policie's registry are errors, disabled rules are skipped.
9
+ */
10
+ export type RegistryRuleResolveResult = {
11
+ enabledRules: Array<RowLevelPolicyRule<unknown>>;
12
+ skippedRules: PolicyRuleSkipResult[];
13
+ resolveErrors: EntityResolveError[];
14
+ };
5
15
  /**
6
16
  * The rule registry holds all available rules for a given policy at run time.
7
17
  * It is designed to be extendible so we can easily register new rules and it will
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleRegistry.js","sourceRoot":"","sources":["../../../../src/libs/core/registries/ruleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,kBAAkB,CAAC,CAAC;AAgBjG;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IACL;IAA1B,YAA0B,KAA+D;QAA/D,UAAK,GAAL,KAAK,CAA0D;IAAG,CAAC;IAE7F;;;;OAIG;IACI,eAAe;QACpB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;OAOG;IACI,YAAY,CAAC,QAAiB,EAAE,YAA4B;QACjE,MAAM,YAAY,GAAG,IAAI,KAAK,EAA+B,CAAC;QAC9D,MAAM,YAAY,GAAG,IAAI,KAAK,EAAwB,CAAC;QACvD,MAAM,aAAa,GAAG,IAAI,KAAK,EAAsB,CAAC;QACtD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE;YAC1D,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;gBAC/C,YAAY,CAAC,IAAI,CACf,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CACrG,CAAC;YACJ,CAAC;iBAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBAC/B,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,EAAE,CAAC,CAAC;YACzG,CAAC;iBAAM,CAAC;gBACN,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAC;YAC5G,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;IACvD,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
- import { ResolvedConnectedApp } from '../connectedAppPolicy.js';
2
- import { PartialPolicyRuleResult, RuleAuditContext } from '../interfaces/policyRuleInterfaces.js';
1
+ import { PartialPolicyRuleResult, RuleAuditContext } from '../types.js';
2
+ import { ResolvedConnectedApp } from '../connectedApps.js';
3
3
  import PolicyRule, { RuleOptions } from './policyRule.js';
4
4
  export default class AllUsedAppsUnderManagement extends PolicyRule<ResolvedConnectedApp> {
5
5
  constructor(opts: RuleOptions);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allUsedAppsUnderManagement.js","sourceRoot":"","sources":["../../../../../src/libs/core/registries/rules/allUsedAppsUnderManagement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,UAA2B,MAAM,iBAAiB,CAAC;AAE1D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,qBAAqB,CAAC,CAAC;AAEpG,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,UAAgC;IACtF,YAAmB,IAAiB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,GAAG,CAAC,OAA+C;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACvD,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnD,IAAI,GAAG,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;gBAChC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;oBACrB,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;oBACtB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wCAAwC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;iBACzG,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
- import { PartialPolicyRuleResult, RuleAuditContext } from '../interfaces/policyRuleInterfaces.js';
2
- import { ResolvedProfile } from '../profilePolicy.js';
1
+ import { PartialPolicyRuleResult, RuleAuditContext } from '../types.js';
2
+ import { ResolvedProfile } from '../profiles.js';
3
3
  import PolicyRule, { RuleOptions } from './policyRule.js';
4
4
  export default class EnforceCustomPermsClassificationOnProfiles extends PolicyRule<ResolvedProfile> {
5
5
  constructor(opts: RuleOptions);
@@ -1,5 +1,6 @@
1
1
  import { Messages } from '@salesforce/core';
2
- import { permissionAllowedInPreset, PolicyRiskLevel } from '../types.js';
2
+ import { PermissionRiskLevel } from '../../classification-types.js';
3
+ import { permissionAllowedInPreset } from '../../policy-types.js';
3
4
  import PolicyRule from './policyRule.js';
4
5
  const messages = Messages.loadMessages('@j-schreiber/sf-cli-security-audit', 'rules.enforceClassificationPresets');
5
6
  export default class EnforceCustomPermsClassificationOnProfiles extends PolicyRule {
@@ -15,7 +16,7 @@ export default class EnforceCustomPermsClassificationOnProfiles extends PolicyRu
15
16
  const identifier = [profile.name, perm.name];
16
17
  const classifiedPerm = this.resolveCustomPermission(perm.name);
17
18
  if (classifiedPerm) {
18
- if (classifiedPerm.classification === PolicyRiskLevel.BLOCKED) {
19
+ if (classifiedPerm.classification === PermissionRiskLevel.BLOCKED) {
19
20
  result.violations.push({
20
21
  identifier,
21
22
  message: messages.getMessage('violations.permission-is-blocked'),
@@ -30,7 +31,7 @@ export default class EnforceCustomPermsClassificationOnProfiles extends PolicyRu
30
31
  ]),
31
32
  });
32
33
  }
33
- else if (classifiedPerm.classification === PolicyRiskLevel.UNKNOWN) {
34
+ else if (classifiedPerm.classification === PermissionRiskLevel.UNKNOWN) {
34
35
  result.warnings.push({
35
36
  identifier,
36
37
  message: messages.getMessage('warnings.permission-unknown'),
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforceCustomPermsClassificationOnProfiles.js","sourceRoot":"","sources":["../../../../../src/libs/core/registries/rules/enforceCustomPermsClassificationOnProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAA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2CAA2C,EAAE;gCACxE,cAAc,CAAC,cAAc;gCAC7B,OAAO,CAAC,MAAM;6BACf,CAAC;yBACH,CAAC,CAAC;oBACL,CAAC;yBAAM,IAAI,cAAc,CAAC,cAAc,KAAK,mBAAmB,CAAC,OAAO,EAAE,CAAC;wBACzE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;4BACnB,UAAU;4BACV,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;yBAC5D,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;wBACnB,UAAU;wBACV,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+CAA+C,CAAC;qBAC9E,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
- import { PartialPolicyRuleResult, RuleAuditContext } from '../interfaces/policyRuleInterfaces.js';
2
- import { ResolvedPermissionSet } from '../permissionSetPolicy.js';
1
+ import { PartialPolicyRuleResult, RuleAuditContext } from '../types.js';
2
+ import { ResolvedPermissionSet } from '../permissionSets.js';
3
3
  import PolicyRule, { RuleOptions } from './policyRule.js';
4
4
  export default class EnforceUserPermsClassificationOnPermSets extends PolicyRule<ResolvedPermissionSet> {
5
5
  constructor(opts: RuleOptions);
@@ -1,5 +1,6 @@
1
1
  import { Messages } from '@salesforce/core';
2
- import { permissionAllowedInPreset, PolicyRiskLevel } from '../types.js';
2
+ import { PermissionRiskLevel } from '../../classification-types.js';
3
+ import { permissionAllowedInPreset } from '../../policy-types.js';
3
4
  import PolicyRule from './policyRule.js';
4
5
  const messages = Messages.loadMessages('@j-schreiber/sf-cli-security-audit', 'rules.enforceClassificationPresets');
5
6
  export default class EnforceUserPermsClassificationOnPermSets extends PolicyRule {
@@ -15,7 +16,7 @@ export default class EnforceUserPermsClassificationOnPermSets extends PolicyRule
15
16
  const identifier = [permset.name, userPerm.name];
16
17
  const classifiedUserPerm = this.resolveUserPermission(userPerm.name);
17
18
  if (classifiedUserPerm) {
18
- if (classifiedUserPerm.classification === PolicyRiskLevel.BLOCKED) {
19
+ if (classifiedUserPerm.classification === PermissionRiskLevel.BLOCKED) {
19
20
  result.violations.push({
20
21
  identifier,
21
22
  message: messages.getMessage('violations.permission-is-blocked'),
@@ -30,7 +31,7 @@ export default class EnforceUserPermsClassificationOnPermSets extends PolicyRule
30
31
  ]),
31
32
  });
32
33
  }
33
- else if (classifiedUserPerm.classification === PolicyRiskLevel.UNKNOWN) {
34
+ else if (classifiedUserPerm.classification === PermissionRiskLevel.UNKNOWN) {
34
35
  result.warnings.push({
35
36
  identifier,
36
37
  message: messages.getMessage('warnings.permission-unknown'),
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforceUserPermsClassificationOnPermSets.js","sourceRoot":"","sources":["../../../../../src/libs/core/registries/rules/enforceUserPermsClassificationOnPermSets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,UAA2B,MAAM,iBAAiB,CAAC;AAE1D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,oCAAoC,CAAC,CAAC;AAEnH,MAAM,CAAC,OAAO,OAAO,wCAAyC,SAAQ,UAAiC;IACrG,YAAmB,IAAiB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,GAAG,CAAC,OAAgD;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,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ACnB,UAAU;wBACV,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sDAAsD,CAAC;qBACrF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
- import { PartialPolicyRuleResult, RuleAuditContext } from '../interfaces/policyRuleInterfaces.js';
2
- import { ResolvedProfile } from '../profilePolicy.js';
1
+ import { PartialPolicyRuleResult, RuleAuditContext } from '../types.js';
2
+ import { ResolvedProfile } from '../profiles.js';
3
3
  import PolicyRule, { RuleOptions } from './policyRule.js';
4
4
  export default class EnforceUserPermsClassificationOnProfiles extends PolicyRule<ResolvedProfile> {
5
5
  constructor(opts: RuleOptions);
@@ -1,6 +1,7 @@
1
1
  import { Messages } from '@salesforce/core';
2
2
  import { isNullish } from '../../utils.js';
3
- import { permissionAllowedInPreset, PolicyRiskLevel } from '../types.js';
3
+ import { PermissionRiskLevel } from '../../classification-types.js';
4
+ import { permissionAllowedInPreset } from '../../policy-types.js';
4
5
  import PolicyRule from './policyRule.js';
5
6
  const messages = Messages.loadMessages('@j-schreiber/sf-cli-security-audit', 'rules.enforceClassificationPresets');
6
7
  export default class EnforceUserPermsClassificationOnProfiles extends PolicyRule {
@@ -16,7 +17,7 @@ export default class EnforceUserPermsClassificationOnProfiles extends PolicyRule
16
17
  const identifier = [profile.name, userPerm.name];
17
18
  const classifiedUserPerm = this.resolveUserPermission(userPerm.name);
18
19
  if (classifiedUserPerm) {
19
- if (classifiedUserPerm.classification === PolicyRiskLevel.BLOCKED) {
20
+ if (classifiedUserPerm.classification === PermissionRiskLevel.BLOCKED) {
20
21
  result.violations.push({
21
22
  identifier,
22
23
  message: messages.getMessage('violations.permission-is-blocked'),
@@ -31,7 +32,7 @@ export default class EnforceUserPermsClassificationOnProfiles extends PolicyRule
31
32
  ]),
32
33
  });
33
34
  }
34
- else if (classifiedUserPerm.classification === PolicyRiskLevel.UNKNOWN) {
35
+ else if (classifiedUserPerm.classification === PermissionRiskLevel.UNKNOWN) {
35
36
  result.warnings.push({
36
37
  identifier,
37
38
  message: messages.getMessage('warnings.permission-unknown'),
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforceUserPermsClassificationOnProfiles.js","sourceRoot":"","sources":["../../../../../src/libs/core/registries/rules/enforceUserPermsClassificationOnProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,UAA2B,MAAM,iBAAiB,CAAC;AAE1D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,oCAAoC,CAAC,CAAC;AAEnH,MAAM,CAAC,OAAO,OAAO,wCAAyC,SAAQ,UAA2B;IAC/F,YAAmB,IAAiB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,GAAG,CAAC,OAA0C;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAClD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBACjD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;oBACpD,MAAM,UAAU,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;oBACjD,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.js';
2
- import { ResolvedConnectedApp } from '../connectedAppPolicy.js';
1
+ import { PartialPolicyRuleResult, RuleAuditContext } from '../types.js';
2
+ import { ResolvedConnectedApp } from '../connectedApps.js';
3
3
  import PolicyRule, { RuleOptions } from './policyRule.js';
4
4
  export default class NoUserCanSelfAuthorize extends PolicyRule<ResolvedConnectedApp> {
5
5
  constructor(opts: RuleOptions);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noUserCanSelfAuthorize.js","sourceRoot":"","sources":["../../../../../src/libs/core/registries/rules/noUserCanSelfAuthorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,UAA2B,MAAM,iBAAiB,CAAC;AAE1D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,qBAAqB,CAAC,CAAC;AAEpG,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAgC;IAClF,YAAmB,IAAiB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,GAAG,CAAC,OAA+C;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACvD,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnD,IAAI,CAAC,GAAG,CAAC,6BAA6B,EAAE,CAAC;gBACvC,IAAI,GAAG,CAAC,2BAA2B,EAAE,CAAC;oBACpC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;wBACnB,UAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;wBACtB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,yDAAyD,CAAC;qBACxF,CAAC,CAAC;gB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