@knowttl/mg-axi 0.1.2 → 0.1.4
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 +127 -45
- package/dist/api.js +119 -0
- package/dist/app-auth.js +5 -1
- package/dist/catalogue.js +311 -3
- package/dist/cli.js +44 -12
- package/dist/docs.js +139 -47
- package/dist/entra-apps.js +158 -6
- package/dist/entra-audit-logs.js +93 -12
- package/dist/entra-conditional-access.js +416 -11
- package/dist/entra-federation-configurations.js +7 -4
- package/dist/entra-grants.js +8 -4
- package/dist/entra-group-lifecycle.js +13 -8
- package/dist/entra-identity-providers.js +7 -4
- package/dist/entra-lifecycle-workflows.js +16 -4
- package/dist/entra-multi-tenant-organization.js +7 -4
- package/dist/entra-on-premises-synchronization.js +6 -4
- package/dist/entra-risk-prevention.js +10 -4
- package/dist/entra-risk.js +11 -4
- package/dist/entra-roles.js +194 -8
- package/dist/entra-terms-of-use.js +13 -8
- package/dist/graph-session.js +1 -0
- package/dist/msal-app-provider.js +96 -13
- package/dist/profiles.js +55 -9
- package/dist/setup.js +5 -2
- package/docs/coverage.md +721 -654
- package/inventory/operations.json +2 -2
- package/inventory/schema.json +1 -1
- package/package.json +1 -1
- package/skills/mg-axi/SKILL.md +34 -1
package/dist/cli.js
CHANGED
|
@@ -11,15 +11,15 @@ import { updateUserAccount } from "./entra-user-update.js";
|
|
|
11
11
|
import { revokeUserSessions } from "./entra-user-revoke-sessions.js";
|
|
12
12
|
import { createMutationCoordinator, mutationFetchTransport } from "./mutations.js";
|
|
13
13
|
import { TRANSITIVE_OPERATION, listGroupMemberOf, listGroupMembers, listGroups, showGroup } from "./entra-groups.js";
|
|
14
|
-
import { listDirectoryRoles, showDirectoryRole, listRoleAssignments, listPimEligible, listPimActive } from "./entra-roles.js";
|
|
14
|
+
import { listDirectoryRoles, showDirectoryRole, listDirectoryRoleTemplates, showDirectoryRoleTemplate, listRoleMembers, listScopedMembers, showScopedMember, listScopedRoleMemberships, showScopedRoleMembership, listRoleAssignments, listPimEligible, listPimActive } from "./entra-roles.js";
|
|
15
15
|
import { listGroupAssignmentSchedules, showGroupAssignmentSchedule, listGroupAssignmentInstances, showGroupAssignmentInstance, listGroupEligibilitySchedules, showGroupEligibilitySchedule, listGroupEligibilityInstances, showGroupEligibilityInstance, listGroupEligibilityRequests, showGroupEligibilityRequest } from "./entra-group-pim.js";
|
|
16
16
|
import { listAdministrativeUnitMembers, listAdministrativeUnits, listDevices, showAdministrativeUnit, showDevice } from "./entra-directory.js";
|
|
17
|
-
import { listSignIns, showSignIn, listDirectoryAudits, showDirectoryAudit } from "./entra-audit-logs.js";
|
|
18
|
-
import { listApplicationOwners, listApplications, listServicePrincipalOwners, listServicePrincipals, showApplication, showServicePrincipal } from "./entra-apps.js";
|
|
17
|
+
import { listSignIns, showSignIn, listDirectoryAudits, showDirectoryAudit, listProvisioning, showProvisioning } from "./entra-audit-logs.js";
|
|
18
|
+
import { listApplicationFederatedCredentials, listApplicationOwners, listApplications, listServicePrincipalAssignedTo, listServicePrincipalFederatedCredentials, listServicePrincipalOwners, listServicePrincipals, showApplication, showApplicationFederatedCredential, showServicePrincipal, showServicePrincipalAppRoleAssignment, showServicePrincipalAssignedTo, showServicePrincipalFederatedCredential } from "./entra-apps.js";
|
|
19
19
|
import { listAppRoleAssignments, listOAuth2Grants } from "./entra-grants.js";
|
|
20
20
|
import { listRiskyUsers, showRiskyUser, listRiskDetections, showRiskDetection, listRiskyServicePrincipals, showRiskyServicePrincipal, listRiskyServicePrincipalHistory, showRiskyServicePrincipalHistory, listServicePrincipalRiskDetections, showServicePrincipalRiskDetection } from "./entra-risk.js";
|
|
21
21
|
import { dismissRiskyUser } from "./entra-risk-dismiss.js";
|
|
22
|
-
import { listPolicies, showPolicy, listNamedLocations, showNamedLocation } from "./entra-conditional-access.js";
|
|
22
|
+
import { listPolicies, showPolicy, listNamedLocations, showNamedLocation, listAuthStrengthPolicies, showAuthStrengthPolicy, listCombinationConfigurations, showCombinationConfiguration, listAuthMethodModes, showAuthMethodMode, listTemplates, showTemplate, listAuthContexts, showAuthContext, listDeletedPolicies, showDeletedPolicy, listDeletedNamedLocations, showDeletedNamedLocation } from "./entra-conditional-access.js";
|
|
23
23
|
import { listBrandingLocalizations, listOrganizations, showBranding, showBrandingLocalization, showOrganization } from "./entra-organization.js";
|
|
24
24
|
import { updateCaPolicy } from "./entra-ca-policy-update.js";
|
|
25
25
|
import { listDomains, showDomain, listVerificationDnsRecords, showVerificationDnsRecord, listServiceConfigurationRecords, showServiceConfigurationRecord, listDomainDnsRecords, showDomainDnsRecord } from "./entra-domains.js";
|
|
@@ -118,10 +118,12 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
118
118
|
return localHome(flags.profile);
|
|
119
119
|
const profiles = new Profiles();
|
|
120
120
|
if (leaf.path === "profile create") {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
const credentialFlags = ["certificate-thumbprint", "client-secret-env", "client-secret-file", "certificate-key-file", "certificate-key-env", "federated-token-file-env"];
|
|
122
|
+
if (String(flags.mode ?? "delegated") !== "application" && (flags.federated || credentialFlags.some(name => flags[name] !== undefined)))
|
|
123
|
+
throw new AxiError("Certificate, client-secret and federated credentials belong to application profiles; pass --mode application", "VALIDATION_ERROR", [leafHelp(leaf)]);
|
|
124
|
+
const optional = (name) => flags[name] === undefined ? undefined : String(flags[name]);
|
|
123
125
|
return profiles.create(String(flags.name), String(flags.tenant), String(flags.client), String(flags.cloud), !!flags["allow-device-code"], String(flags.mode ?? "delegated") === "application"
|
|
124
|
-
? { certificateThumbprint:
|
|
126
|
+
? { certificateThumbprint: optional("certificate-thumbprint"), federated: !!flags.federated, clientSecretEnv: optional("client-secret-env"), clientSecretFile: optional("client-secret-file"), certificateKeyFile: optional("certificate-key-file"), certificateKeyEnv: optional("certificate-key-env"), federatedTokenFileEnv: optional("federated-token-file-env") }
|
|
125
127
|
: undefined);
|
|
126
128
|
}
|
|
127
129
|
if (leaf.path === "profile list") {
|
|
@@ -164,7 +166,7 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
164
166
|
const { MsalProvider } = await import("./msal-provider.js");
|
|
165
167
|
return { profile: selected.name, ...await new DelegatedAuth(new MsalProvider()).login(selected.profile, String(flags.method ?? "browser"), String(flags.scopes).split(",")) };
|
|
166
168
|
}
|
|
167
|
-
if (leaf.path === "entra conditional-access policy list" || leaf.path === "entra conditional-access policy show" || leaf.path === "entra conditional-access named-location list" || leaf.path === "entra conditional-access named-location show") {
|
|
169
|
+
if (leaf.path === "entra conditional-access policy list" || leaf.path === "entra conditional-access policy show" || leaf.path === "entra conditional-access named-location list" || leaf.path === "entra conditional-access named-location show" || leaf.path === "entra conditional-access auth-strength-policy list" || leaf.path === "entra conditional-access auth-strength-policy show" || leaf.path === "entra conditional-access combination-configuration list" || leaf.path === "entra conditional-access combination-configuration show" || leaf.path === "entra conditional-access auth-method-mode list" || leaf.path === "entra conditional-access auth-method-mode show" || leaf.path === "entra conditional-access template list" || leaf.path === "entra conditional-access template show" || leaf.path === "entra conditional-access auth-context list" || leaf.path === "entra conditional-access auth-context show" || leaf.path === "entra conditional-access deleted-policy list" || leaf.path === "entra conditional-access deleted-policy show" || leaf.path === "entra conditional-access deleted-named-location list" || leaf.path === "entra conditional-access deleted-named-location show") {
|
|
168
170
|
const selected = profiles.resolve(flags.profile);
|
|
169
171
|
const operation = operationFor(leaf, String(flags["api-version"] ?? "v1.0"));
|
|
170
172
|
if (!operation || operation.method !== "GET") {
|
|
@@ -190,7 +192,21 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
190
192
|
case "entra conditional-access policy list": return listPolicies(session, flags, selected.profile, operation, help, selected.name);
|
|
191
193
|
case "entra conditional-access policy show": return showPolicy(session, flags, selected.profile, operation, help, selected.name);
|
|
192
194
|
case "entra conditional-access named-location list": return listNamedLocations(session, flags, selected.profile, operation, help, selected.name);
|
|
193
|
-
|
|
195
|
+
case "entra conditional-access named-location show": return showNamedLocation(session, flags, selected.profile, operation, help, selected.name);
|
|
196
|
+
case "entra conditional-access auth-strength-policy list": return listAuthStrengthPolicies(session, flags, selected.profile, operation, help, selected.name);
|
|
197
|
+
case "entra conditional-access auth-strength-policy show": return showAuthStrengthPolicy(session, flags, selected.profile, operation, help, selected.name);
|
|
198
|
+
case "entra conditional-access combination-configuration list": return listCombinationConfigurations(session, flags, selected.profile, operation, help, selected.name);
|
|
199
|
+
case "entra conditional-access combination-configuration show": return showCombinationConfiguration(session, flags, selected.profile, operation, help, selected.name);
|
|
200
|
+
case "entra conditional-access auth-method-mode list": return listAuthMethodModes(session, flags, selected.profile, operation, help, selected.name);
|
|
201
|
+
case "entra conditional-access auth-method-mode show": return showAuthMethodMode(session, flags, selected.profile, operation, help, selected.name);
|
|
202
|
+
case "entra conditional-access template list": return listTemplates(session, flags, selected.profile, operation, help, selected.name);
|
|
203
|
+
case "entra conditional-access auth-context list": return listAuthContexts(session, flags, selected.profile, operation, help, selected.name);
|
|
204
|
+
case "entra conditional-access auth-context show": return showAuthContext(session, flags, selected.profile, operation, help, selected.name);
|
|
205
|
+
case "entra conditional-access deleted-policy list": return listDeletedPolicies(session, flags, selected.profile, operation, help, selected.name);
|
|
206
|
+
case "entra conditional-access deleted-policy show": return showDeletedPolicy(session, flags, selected.profile, operation, help, selected.name);
|
|
207
|
+
case "entra conditional-access deleted-named-location list": return listDeletedNamedLocations(session, flags, selected.profile, operation, help, selected.name);
|
|
208
|
+
case "entra conditional-access deleted-named-location show": return showDeletedNamedLocation(session, flags, selected.profile, operation, help, selected.name);
|
|
209
|
+
default: return showTemplate(session, flags, selected.profile, operation, help, selected.name);
|
|
194
210
|
}
|
|
195
211
|
}
|
|
196
212
|
if (leaf.path === "entra access-review definition list" || leaf.path === "entra access-review definition show" || leaf.path === "entra access-review instance list" || leaf.path === "entra access-review instance show" || leaf.path === "entra access-review decision list" || leaf.path === "entra access-review decision show" || leaf.path === "entra access-review contacted-reviewer list" || leaf.path === "entra access-review contacted-reviewer show" || leaf.path === "entra access-review stage list" || leaf.path === "entra access-review stage show") {
|
|
@@ -585,7 +601,7 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
585
601
|
help: leafHelp(leaf),
|
|
586
602
|
});
|
|
587
603
|
}
|
|
588
|
-
if (leaf.path === "entra directory-role list" || leaf.path === "entra directory-role show" || leaf.path === "entra role-assignment list" || leaf.path === "entra pim eligible list" || leaf.path === "entra pim active list"
|
|
604
|
+
if (leaf.path === "entra directory-role list" || leaf.path === "entra directory-role show" || leaf.path === "entra directory-role-template list" || leaf.path === "entra directory-role-template show" || leaf.path === "entra directory-role member list" || leaf.path === "entra directory-role scoped-member list" || leaf.path === "entra directory-role scoped-member show" || leaf.path === "entra scoped-role-membership list" || leaf.path === "entra scoped-role-membership show" || leaf.path === "entra role-assignment list" || leaf.path === "entra pim eligible list" || leaf.path === "entra pim active list"
|
|
589
605
|
|| leaf.path === "entra pim group-assignment-schedule list" || leaf.path === "entra pim group-assignment-schedule show"
|
|
590
606
|
|| leaf.path === "entra pim group-assignment-instance list" || leaf.path === "entra pim group-assignment-instance show"
|
|
591
607
|
|| leaf.path === "entra pim group-eligibility-schedule list" || leaf.path === "entra pim group-eligibility-schedule show"
|
|
@@ -616,6 +632,13 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
616
632
|
switch (leaf.path) {
|
|
617
633
|
case "entra directory-role list": return listDirectoryRoles(session, flags, selected.profile, operation, help, selected.name);
|
|
618
634
|
case "entra directory-role show": return showDirectoryRole(session, flags, selected.profile, operation, help, selected.name);
|
|
635
|
+
case "entra directory-role-template list": return listDirectoryRoleTemplates(session, flags, selected.profile, operation, help, selected.name);
|
|
636
|
+
case "entra directory-role-template show": return showDirectoryRoleTemplate(session, flags, selected.profile, operation, help, selected.name);
|
|
637
|
+
case "entra directory-role member list": return listRoleMembers(session, flags, selected.profile, operation, help, selected.name);
|
|
638
|
+
case "entra directory-role scoped-member list": return listScopedMembers(session, flags, selected.profile, operation, help, selected.name);
|
|
639
|
+
case "entra directory-role scoped-member show": return showScopedMember(session, flags, selected.profile, operation, help, selected.name);
|
|
640
|
+
case "entra scoped-role-membership list": return listScopedRoleMemberships(session, flags, selected.profile, operation, help, selected.name);
|
|
641
|
+
case "entra scoped-role-membership show": return showScopedRoleMembership(session, flags, selected.profile, operation, help, selected.name);
|
|
619
642
|
case "entra role-assignment list": return listRoleAssignments(session, flags, selected.profile, operation, help, selected.name);
|
|
620
643
|
case "entra pim eligible list": return listPimEligible(session, flags, selected.profile, operation, help, selected.name);
|
|
621
644
|
case "entra pim active list": return listPimActive(session, flags, selected.profile, operation, help, selected.name);
|
|
@@ -666,13 +689,13 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
666
689
|
default: return showBrandingLocalization(session, flags, selected.profile, operation, help, selected.name);
|
|
667
690
|
}
|
|
668
691
|
}
|
|
669
|
-
if (leaf.path === "entra sign-in list" || leaf.path === "entra sign-in show" || leaf.path === "entra directory-audit list" || leaf.path === "entra directory-audit show" || leaf.path === "entra application list" || leaf.path === "entra application show" || leaf.path === "entra service-principal list" || leaf.path === "entra service-principal show" || leaf.path === "entra application owner list" || leaf.path === "entra service-principal owner list") {
|
|
692
|
+
if (leaf.path === "entra sign-in list" || leaf.path === "entra sign-in show" || leaf.path === "entra directory-audit list" || leaf.path === "entra directory-audit show" || leaf.path === "entra provisioning list" || leaf.path === "entra provisioning show" || leaf.path === "entra application list" || leaf.path === "entra application show" || leaf.path === "entra service-principal list" || leaf.path === "entra service-principal show" || leaf.path === "entra application owner list" || leaf.path === "entra service-principal owner list" || leaf.path === "entra application federated-credential list" || leaf.path === "entra application federated-credential show" || leaf.path === "entra service-principal federated-credential list" || leaf.path === "entra service-principal federated-credential show" || leaf.path === "entra service-principal app-role-assigned-to list" || leaf.path === "entra service-principal app-role-assigned-to show" || leaf.path === "entra service-principal app-role-assignment show") {
|
|
670
693
|
const selected = profiles.resolve(flags.profile);
|
|
671
694
|
const operation = operationFor(leaf, String(flags["api-version"] ?? "v1.0"));
|
|
672
695
|
if (!operation || operation.method !== "GET") {
|
|
673
696
|
throw new AxiError(`Unknown catalogued Graph operation for ${leaf.path}`, "VALIDATION_ERROR", [leafHelp(leaf)]);
|
|
674
697
|
}
|
|
675
|
-
if ((leaf.path.startsWith("entra sign-in ") || leaf.path.startsWith("entra directory-audit ")) && flags.cursor !== undefined)
|
|
698
|
+
if ((leaf.path.startsWith("entra sign-in ") || leaf.path.startsWith("entra directory-audit ") || leaf.path.startsWith("entra provisioning ")) && flags.cursor !== undefined)
|
|
676
699
|
flags.cursor = (await readCursor(String(flags.cursor)));
|
|
677
700
|
let delegated = overrides.delegated;
|
|
678
701
|
let application = overrides.application;
|
|
@@ -693,11 +716,20 @@ export async function executeArgv(argv, overrides = {}) {
|
|
|
693
716
|
case "entra sign-in show": return showSignIn(session, flags, selected.profile, operation, help, selected.name);
|
|
694
717
|
case "entra directory-audit list": return listDirectoryAudits(session, flags, selected.profile, operation, help, selected.name);
|
|
695
718
|
case "entra directory-audit show": return showDirectoryAudit(session, flags, selected.profile, operation, help, selected.name);
|
|
719
|
+
case "entra provisioning list": return listProvisioning(session, flags, selected.profile, operation, help, selected.name);
|
|
720
|
+
case "entra provisioning show": return showProvisioning(session, flags, selected.profile, operation, help, selected.name);
|
|
696
721
|
case "entra application list": return listApplications(session, flags, selected.profile, operation, help, selected.name);
|
|
697
722
|
case "entra application show": return showApplication(session, flags, selected.profile, operation, help, selected.name);
|
|
698
723
|
case "entra service-principal list": return listServicePrincipals(session, flags, selected.profile, operation, help, selected.name);
|
|
699
724
|
case "entra service-principal show": return showServicePrincipal(session, flags, selected.profile, operation, help, selected.name);
|
|
700
725
|
case "entra application owner list": return listApplicationOwners(session, flags, selected.profile, operation, help, selected.name);
|
|
726
|
+
case "entra application federated-credential list": return listApplicationFederatedCredentials(session, flags, selected.profile, operation, help, selected.name);
|
|
727
|
+
case "entra application federated-credential show": return showApplicationFederatedCredential(session, flags, selected.profile, operation, help, selected.name);
|
|
728
|
+
case "entra service-principal federated-credential list": return listServicePrincipalFederatedCredentials(session, flags, selected.profile, operation, help, selected.name);
|
|
729
|
+
case "entra service-principal federated-credential show": return showServicePrincipalFederatedCredential(session, flags, selected.profile, operation, help, selected.name);
|
|
730
|
+
case "entra service-principal app-role-assigned-to list": return listServicePrincipalAssignedTo(session, flags, selected.profile, operation, help, selected.name);
|
|
731
|
+
case "entra service-principal app-role-assigned-to show": return showServicePrincipalAssignedTo(session, flags, selected.profile, operation, help, selected.name);
|
|
732
|
+
case "entra service-principal app-role-assignment show": return showServicePrincipalAppRoleAssignment(session, flags, selected.profile, operation, help, selected.name);
|
|
701
733
|
default: return listServicePrincipalOwners(session, flags, selected.profile, operation, help, selected.name);
|
|
702
734
|
}
|
|
703
735
|
}
|