@grc-claw/integration-marketplace 0.8.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/dist/IntegrationMarketplace.d.ts +32 -0
- package/dist/IntegrationMarketplace.js +319 -0
- package/dist/connectors/ADPConnector.d.ts +12 -0
- package/dist/connectors/ADPConnector.js +97 -0
- package/dist/connectors/AWSCloudTrailConnector.d.ts +12 -0
- package/dist/connectors/AWSCloudTrailConnector.js +77 -0
- package/dist/connectors/AWSCloudWatchConnector.d.ts +12 -0
- package/dist/connectors/AWSCloudWatchConnector.js +70 -0
- package/dist/connectors/AWSGuardDutyConnector.d.ts +12 -0
- package/dist/connectors/AWSGuardDutyConnector.js +139 -0
- package/dist/connectors/AWSIAMConnector.d.ts +12 -0
- package/dist/connectors/AWSIAMConnector.js +90 -0
- package/dist/connectors/AWSKMSConnector.d.ts +12 -0
- package/dist/connectors/AWSKMSConnector.js +70 -0
- package/dist/connectors/AWSLambdaConnector.d.ts +12 -0
- package/dist/connectors/AWSLambdaConnector.js +84 -0
- package/dist/connectors/AWSRDSConnector.d.ts +12 -0
- package/dist/connectors/AWSRDSConnector.js +84 -0
- package/dist/connectors/AWSS3Connector.d.ts +12 -0
- package/dist/connectors/AWSS3Connector.js +112 -0
- package/dist/connectors/AkamaiConnector.d.ts +12 -0
- package/dist/connectors/AkamaiConnector.js +98 -0
- package/dist/connectors/ArgoCDConnector.d.ts +12 -0
- package/dist/connectors/ArgoCDConnector.js +93 -0
- package/dist/connectors/ArtifactoryConnector.d.ts +12 -0
- package/dist/connectors/ArtifactoryConnector.js +94 -0
- package/dist/connectors/AtlassianJiraConnector.d.ts +12 -0
- package/dist/connectors/AtlassianJiraConnector.js +134 -0
- package/dist/connectors/Auth0Connector.d.ts +12 -0
- package/dist/connectors/Auth0Connector.js +150 -0
- package/dist/connectors/AzureADConnector.d.ts +12 -0
- package/dist/connectors/AzureADConnector.js +115 -0
- package/dist/connectors/AzureDevOpsConnector.d.ts +12 -0
- package/dist/connectors/AzureDevOpsConnector.js +130 -0
- package/dist/connectors/AzureDevOpsPipelinesConnector.d.ts +12 -0
- package/dist/connectors/AzureDevOpsPipelinesConnector.js +72 -0
- package/dist/connectors/AzurePipelinesConnector.d.ts +12 -0
- package/dist/connectors/AzurePipelinesConnector.js +72 -0
- package/dist/connectors/AzurePolicyConnector.d.ts +12 -0
- package/dist/connectors/AzurePolicyConnector.js +141 -0
- package/dist/connectors/AzureReposConnector.d.ts +12 -0
- package/dist/connectors/AzureReposConnector.js +96 -0
- package/dist/connectors/AzureSentinelConnector.d.ts +12 -0
- package/dist/connectors/AzureSentinelConnector.js +88 -0
- package/dist/connectors/BambooCICDConnector.d.ts +12 -0
- package/dist/connectors/BambooCICDConnector.js +72 -0
- package/dist/connectors/BambooHRConnector.d.ts +12 -0
- package/dist/connectors/BambooHRConnector.js +84 -0
- package/dist/connectors/BeyondTrustConnector.d.ts +12 -0
- package/dist/connectors/BeyondTrustConnector.js +94 -0
- package/dist/connectors/BitbucketConnector.d.ts +12 -0
- package/dist/connectors/BitbucketConnector.js +100 -0
- package/dist/connectors/BitbucketPipelinesConnector.d.ts +12 -0
- package/dist/connectors/BitbucketPipelinesConnector.js +72 -0
- package/dist/connectors/BoxConnector.d.ts +12 -0
- package/dist/connectors/BoxConnector.js +122 -0
- package/dist/connectors/BuildkiteConnector.d.ts +12 -0
- package/dist/connectors/BuildkiteConnector.js +95 -0
- package/dist/connectors/CarbonBlackConnector.d.ts +12 -0
- package/dist/connectors/CarbonBlackConnector.js +89 -0
- package/dist/connectors/CassandraConnector.d.ts +12 -0
- package/dist/connectors/CassandraConnector.js +69 -0
- package/dist/connectors/CheckPointConnector.d.ts +12 -0
- package/dist/connectors/CheckPointConnector.js +98 -0
- package/dist/connectors/CircleCIConnector.d.ts +12 -0
- package/dist/connectors/CircleCIConnector.js +129 -0
- package/dist/connectors/CircleCIConnectorsConnector.d.ts +12 -0
- package/dist/connectors/CircleCIConnectorsConnector.js +69 -0
- package/dist/connectors/CiscoUmbrellaConnector.d.ts +12 -0
- package/dist/connectors/CiscoUmbrellaConnector.js +96 -0
- package/dist/connectors/CloudBeesJenkinsConnector.d.ts +12 -0
- package/dist/connectors/CloudBeesJenkinsConnector.js +70 -0
- package/dist/connectors/CloudflareDNSConnector.d.ts +12 -0
- package/dist/connectors/CloudflareDNSConnector.js +71 -0
- package/dist/connectors/CloudflareWAFConnector.d.ts +12 -0
- package/dist/connectors/CloudflareWAFConnector.js +98 -0
- package/dist/connectors/ConfluenceConnector.d.ts +12 -0
- package/dist/connectors/ConfluenceConnector.js +101 -0
- package/dist/connectors/ConstantContactConnector.d.ts +12 -0
- package/dist/connectors/ConstantContactConnector.js +70 -0
- package/dist/connectors/CouchDBConnector.d.ts +12 -0
- package/dist/connectors/CouchDBConnector.js +69 -0
- package/dist/connectors/CrowdStrikeConnector.d.ts +12 -0
- package/dist/connectors/CrowdStrikeConnector.js +86 -0
- package/dist/connectors/CrowdStrikeFalconConnector.d.ts +12 -0
- package/dist/connectors/CrowdStrikeFalconConnector.js +92 -0
- package/dist/connectors/CrowdStrikeSpotlightConnector.d.ts +12 -0
- package/dist/connectors/CrowdStrikeSpotlightConnector.js +139 -0
- package/dist/connectors/CyberArkConnector.d.ts +12 -0
- package/dist/connectors/CyberArkConnector.js +95 -0
- package/dist/connectors/DatabricksConnector.d.ts +12 -0
- package/dist/connectors/DatabricksConnector.js +95 -0
- package/dist/connectors/DatadogConnector.d.ts +12 -0
- package/dist/connectors/DatadogConnector.js +110 -0
- package/dist/connectors/DigitalOceanConnector.d.ts +12 -0
- package/dist/connectors/DigitalOceanConnector.js +85 -0
- package/dist/connectors/DiscordConnector.d.ts +12 -0
- package/dist/connectors/DiscordConnector.js +98 -0
- package/dist/connectors/DockerHubConnector.d.ts +12 -0
- package/dist/connectors/DockerHubConnector.js +80 -0
- package/dist/connectors/DocuSignConnector.d.ts +12 -0
- package/dist/connectors/DocuSignConnector.js +96 -0
- package/dist/connectors/DriftConnector.d.ts +12 -0
- package/dist/connectors/DriftConnector.js +69 -0
- package/dist/connectors/DropboxConnector.d.ts +12 -0
- package/dist/connectors/DropboxConnector.js +127 -0
- package/dist/connectors/ESETConnector.d.ts +12 -0
- package/dist/connectors/ESETConnector.js +70 -0
- package/dist/connectors/ElasticsearchCloudConnector.d.ts +12 -0
- package/dist/connectors/ElasticsearchCloudConnector.js +70 -0
- package/dist/connectors/FSecureConnector.d.ts +12 -0
- package/dist/connectors/FSecureConnector.js +70 -0
- package/dist/connectors/FeatureFlagConnector.d.ts +12 -0
- package/dist/connectors/FeatureFlagConnector.js +70 -0
- package/dist/connectors/FluxCDConnector.d.ts +12 -0
- package/dist/connectors/FluxCDConnector.js +94 -0
- package/dist/connectors/ForgeRockConnector.d.ts +12 -0
- package/dist/connectors/ForgeRockConnector.js +95 -0
- package/dist/connectors/FortinetConnector.d.ts +12 -0
- package/dist/connectors/FortinetConnector.js +98 -0
- package/dist/connectors/FreshdeskConnector.d.ts +12 -0
- package/dist/connectors/FreshdeskConnector.js +71 -0
- package/dist/connectors/GCPBigQueryConnector.d.ts +12 -0
- package/dist/connectors/GCPBigQueryConnector.js +71 -0
- package/dist/connectors/GCPComputeConnector.d.ts +12 -0
- package/dist/connectors/GCPComputeConnector.js +87 -0
- package/dist/connectors/GCPConfigConnector.d.ts +12 -0
- package/dist/connectors/GCPConfigConnector.js +149 -0
- package/dist/connectors/GCPFirestoreConnector.d.ts +12 -0
- package/dist/connectors/GCPFirestoreConnector.js +71 -0
- package/dist/connectors/GCPIAMConnector.d.ts +12 -0
- package/dist/connectors/GCPIAMConnector.js +98 -0
- package/dist/connectors/GCPSCCConnector.d.ts +12 -0
- package/dist/connectors/GCPSCCConnector.js +94 -0
- package/dist/connectors/GitHubActionsConnector.d.ts +12 -0
- package/dist/connectors/GitHubActionsConnector.js +104 -0
- package/dist/connectors/GitHubConnector.d.ts +12 -0
- package/dist/connectors/GitHubConnector.js +135 -0
- package/dist/connectors/GitHubCopilotConnector.d.ts +12 -0
- package/dist/connectors/GitHubCopilotConnector.js +72 -0
- package/dist/connectors/GitLabCIConnector.d.ts +12 -0
- package/dist/connectors/GitLabCIConnector.js +71 -0
- package/dist/connectors/GitLabConnector.d.ts +12 -0
- package/dist/connectors/GitLabConnector.js +101 -0
- package/dist/connectors/GitLabSASTConnector.d.ts +12 -0
- package/dist/connectors/GitLabSASTConnector.js +130 -0
- package/dist/connectors/GoogleWorkspaceConnector.d.ts +12 -0
- package/dist/connectors/GoogleWorkspaceConnector.js +136 -0
- package/dist/connectors/HelmConnector.d.ts +12 -0
- package/dist/connectors/HelmConnector.js +94 -0
- package/dist/connectors/HubSpotConnector.d.ts +12 -0
- package/dist/connectors/HubSpotConnector.js +77 -0
- package/dist/connectors/IFTTTConnector.d.ts +12 -0
- package/dist/connectors/IFTTTConnector.js +70 -0
- package/dist/connectors/ImpervaConnector.d.ts +12 -0
- package/dist/connectors/ImpervaConnector.js +94 -0
- package/dist/connectors/InfluxDBConnector.d.ts +12 -0
- package/dist/connectors/InfluxDBConnector.js +70 -0
- package/dist/connectors/IntercomConnector.d.ts +12 -0
- package/dist/connectors/IntercomConnector.js +69 -0
- package/dist/connectors/JenkinsConnector.d.ts +12 -0
- package/dist/connectors/JenkinsConnector.js +96 -0
- package/dist/connectors/JiraConnector.d.ts +12 -0
- package/dist/connectors/JiraConnector.js +103 -0
- package/dist/connectors/KafkaConnector.d.ts +12 -0
- package/dist/connectors/KafkaConnector.js +70 -0
- package/dist/connectors/KasperskyConnector.d.ts +12 -0
- package/dist/connectors/KasperskyConnector.js +70 -0
- package/dist/connectors/KubernetesConnector.d.ts +12 -0
- package/dist/connectors/KubernetesConnector.js +109 -0
- package/dist/connectors/LaceworkConnector.d.ts +13 -0
- package/dist/connectors/LaceworkConnector.js +143 -0
- package/dist/connectors/LaunchDarklyConnector.d.ts +12 -0
- package/dist/connectors/LaunchDarklyConnector.js +86 -0
- package/dist/connectors/LinodeConnector.d.ts +12 -0
- package/dist/connectors/LinodeConnector.js +70 -0
- package/dist/connectors/LookerConnector.d.ts +12 -0
- package/dist/connectors/LookerConnector.js +94 -0
- package/dist/connectors/MailchimpConnector.d.ts +12 -0
- package/dist/connectors/MailchimpConnector.js +71 -0
- package/dist/connectors/MalwarebytesConnector.d.ts +12 -0
- package/dist/connectors/MalwarebytesConnector.js +85 -0
- package/dist/connectors/McAfeeConnector.d.ts +12 -0
- package/dist/connectors/McAfeeConnector.js +85 -0
- package/dist/connectors/Microsoft365Connector.d.ts +12 -0
- package/dist/connectors/Microsoft365Connector.js +139 -0
- package/dist/connectors/MongoDBConnector.d.ts +12 -0
- package/dist/connectors/MongoDBConnector.js +86 -0
- package/dist/connectors/NamelyConnector.d.ts +12 -0
- package/dist/connectors/NamelyConnector.js +97 -0
- package/dist/connectors/Neo4jConnector.d.ts +12 -0
- package/dist/connectors/Neo4jConnector.js +70 -0
- package/dist/connectors/NetSuiteConnector.d.ts +12 -0
- package/dist/connectors/NetSuiteConnector.js +94 -0
- package/dist/connectors/NetskopeConnector.d.ts +12 -0
- package/dist/connectors/NetskopeConnector.js +98 -0
- package/dist/connectors/NexusConnector.d.ts +12 -0
- package/dist/connectors/NexusConnector.js +93 -0
- package/dist/connectors/NotionConnector.d.ts +12 -0
- package/dist/connectors/NotionConnector.js +109 -0
- package/dist/connectors/OktaConnector.d.ts +12 -0
- package/dist/connectors/OktaConnector.js +123 -0
- package/dist/connectors/OktaSystemLogConnector.d.ts +12 -0
- package/dist/connectors/OktaSystemLogConnector.js +129 -0
- package/dist/connectors/OpsgenieConnector.d.ts +12 -0
- package/dist/connectors/OpsgenieConnector.js +70 -0
- package/dist/connectors/PagerDutyConnector.d.ts +12 -0
- package/dist/connectors/PagerDutyConnector.js +106 -0
- package/dist/connectors/PalantirConnector.d.ts +12 -0
- package/dist/connectors/PalantirConnector.js +95 -0
- package/dist/connectors/PaloAltoPrismaCloudConnector.d.ts +12 -0
- package/dist/connectors/PaloAltoPrismaCloudConnector.js +110 -0
- package/dist/connectors/PingFederateConnector.d.ts +12 -0
- package/dist/connectors/PingFederateConnector.js +97 -0
- package/dist/connectors/PostgreSQLCloudConnector.d.ts +12 -0
- package/dist/connectors/PostgreSQLCloudConnector.js +70 -0
- package/dist/connectors/PowerBIConnector.d.ts +12 -0
- package/dist/connectors/PowerBIConnector.js +95 -0
- package/dist/connectors/PrismaCloudConnector.d.ts +12 -0
- package/dist/connectors/PrismaCloudConnector.js +147 -0
- package/dist/connectors/QualysConnector.d.ts +12 -0
- package/dist/connectors/QualysConnector.js +96 -0
- package/dist/connectors/QualysScannerConnector.d.ts +12 -0
- package/dist/connectors/QualysScannerConnector.js +131 -0
- package/dist/connectors/QuickBooksConnector.d.ts +12 -0
- package/dist/connectors/QuickBooksConnector.js +97 -0
- package/dist/connectors/RabbitMQConnector.d.ts +12 -0
- package/dist/connectors/RabbitMQConnector.js +69 -0
- package/dist/connectors/RadwareConnector.d.ts +12 -0
- package/dist/connectors/RadwareConnector.js +94 -0
- package/dist/connectors/RedisCloudConnector.d.ts +12 -0
- package/dist/connectors/RedisCloudConnector.js +70 -0
- package/dist/connectors/RingCentralConnector.d.ts +12 -0
- package/dist/connectors/RingCentralConnector.js +94 -0
- package/dist/connectors/SAPSuccessFactorsConnector.d.ts +12 -0
- package/dist/connectors/SAPSuccessFactorsConnector.js +103 -0
- package/dist/connectors/SailPointConnector.d.ts +12 -0
- package/dist/connectors/SailPointConnector.js +97 -0
- package/dist/connectors/SalesforceConnector.d.ts +12 -0
- package/dist/connectors/SalesforceConnector.js +91 -0
- package/dist/connectors/SendGridConnector.d.ts +12 -0
- package/dist/connectors/SendGridConnector.js +69 -0
- package/dist/connectors/SentinelOneConnector.d.ts +12 -0
- package/dist/connectors/SentinelOneConnector.js +89 -0
- package/dist/connectors/ServiceNowConnector.d.ts +12 -0
- package/dist/connectors/ServiceNowConnector.js +123 -0
- package/dist/connectors/SlackConnector.d.ts +12 -0
- package/dist/connectors/SlackConnector.js +109 -0
- package/dist/connectors/SnowflakeConnector.d.ts +12 -0
- package/dist/connectors/SnowflakeConnector.js +105 -0
- package/dist/connectors/SnykConnector.d.ts +12 -0
- package/dist/connectors/SnykConnector.js +84 -0
- package/dist/connectors/SnykMonitorConnector.d.ts +12 -0
- package/dist/connectors/SnykMonitorConnector.js +131 -0
- package/dist/connectors/SophosConnector.d.ts +12 -0
- package/dist/connectors/SophosConnector.js +87 -0
- package/dist/connectors/SpinnakerConnector.d.ts +12 -0
- package/dist/connectors/SpinnakerConnector.js +70 -0
- package/dist/connectors/SplunkConnector.d.ts +12 -0
- package/dist/connectors/SplunkConnector.js +126 -0
- package/dist/connectors/StripeConnector.d.ts +12 -0
- package/dist/connectors/StripeConnector.js +97 -0
- package/dist/connectors/TableauConnector.d.ts +12 -0
- package/dist/connectors/TableauConnector.js +101 -0
- package/dist/connectors/TaniumConnector.d.ts +12 -0
- package/dist/connectors/TaniumConnector.js +97 -0
- package/dist/connectors/TeamCityConnector.d.ts +12 -0
- package/dist/connectors/TeamCityConnector.js +71 -0
- package/dist/connectors/TeamsConnector.d.ts +12 -0
- package/dist/connectors/TeamsConnector.js +96 -0
- package/dist/connectors/TenableIOConnector.d.ts +12 -0
- package/dist/connectors/TenableIOConnector.js +130 -0
- package/dist/connectors/TerraformCloudConnector.d.ts +12 -0
- package/dist/connectors/TerraformCloudConnector.js +106 -0
- package/dist/connectors/TravisCIConnector.d.ts +12 -0
- package/dist/connectors/TravisCIConnector.js +95 -0
- package/dist/connectors/TrendMicroConnector.d.ts +12 -0
- package/dist/connectors/TrendMicroConnector.js +85 -0
- package/dist/connectors/TwilioConnector.d.ts +12 -0
- package/dist/connectors/TwilioConnector.js +70 -0
- package/dist/connectors/VercelConnector.d.ts +12 -0
- package/dist/connectors/VercelConnector.js +70 -0
- package/dist/connectors/VultrConnector.d.ts +12 -0
- package/dist/connectors/VultrConnector.js +70 -0
- package/dist/connectors/WebexConnector.d.ts +12 -0
- package/dist/connectors/WebexConnector.js +94 -0
- package/dist/connectors/WizConnector.d.ts +12 -0
- package/dist/connectors/WizConnector.js +172 -0
- package/dist/connectors/WorkdayConnector.d.ts +12 -0
- package/dist/connectors/WorkdayConnector.js +100 -0
- package/dist/connectors/XeroConnector.d.ts +12 -0
- package/dist/connectors/XeroConnector.js +96 -0
- package/dist/connectors/ZapierConnector.d.ts +12 -0
- package/dist/connectors/ZapierConnector.js +70 -0
- package/dist/connectors/ZendeskConnector.d.ts +12 -0
- package/dist/connectors/ZendeskConnector.js +71 -0
- package/dist/connectors/ZenefitsConnector.d.ts +12 -0
- package/dist/connectors/ZenefitsConnector.js +93 -0
- package/dist/connectors/ZoomConnector.d.ts +12 -0
- package/dist/connectors/ZoomConnector.js +97 -0
- package/dist/connectors/ZscalerConnector.d.ts +12 -0
- package/dist/connectors/ZscalerConnector.js +97 -0
- package/dist/connectors/index.d.ts +150 -0
- package/dist/connectors/index.js +157 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +16 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +139 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.js +8 -0
- package/package.json +33 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { hashEvidence, generateEvidenceId } from "../types.js";
|
|
2
|
+
const capabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "aad-conditional-access",
|
|
5
|
+
name: "Conditional Access Policies",
|
|
6
|
+
description: "Fetch Azure AD conditional access policies",
|
|
7
|
+
evidenceCategories: ["access_control"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "aad-mfa-enrollment",
|
|
11
|
+
name: "MFA Enrollment",
|
|
12
|
+
description: "Fetch MFA enrollment statistics and per-user MFA status",
|
|
13
|
+
evidenceCategories: ["authentication"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "aad-app-registrations",
|
|
17
|
+
name: "App Registrations",
|
|
18
|
+
description: "Fetch app registrations and service principals",
|
|
19
|
+
evidenceCategories: ["access_control", "application_security"],
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
export class AzureADConnector {
|
|
23
|
+
id = "azure-ad";
|
|
24
|
+
name = "Azure Active Directory";
|
|
25
|
+
category = "identity";
|
|
26
|
+
authType = "oauth2";
|
|
27
|
+
capabilities = capabilities;
|
|
28
|
+
frameworks = [
|
|
29
|
+
"SOC2",
|
|
30
|
+
"ISO27001",
|
|
31
|
+
"NIST_CSF",
|
|
32
|
+
"HIPAA",
|
|
33
|
+
];
|
|
34
|
+
async getAccessToken(config) {
|
|
35
|
+
const resp = await fetch(`https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/token`, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
38
|
+
body: new URLSearchParams({
|
|
39
|
+
grant_type: "client_credentials",
|
|
40
|
+
client_id: config.clientId || "",
|
|
41
|
+
client_secret: config.clientSecret || "",
|
|
42
|
+
scope: "https://graph.microsoft.com/.default",
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
if (!resp.ok)
|
|
46
|
+
throw new Error(`Azure AD token ${resp.status}`);
|
|
47
|
+
const data = (await resp.json());
|
|
48
|
+
return data.access_token;
|
|
49
|
+
}
|
|
50
|
+
async testConnection(config) {
|
|
51
|
+
try {
|
|
52
|
+
const token = await this.getAccessToken(config);
|
|
53
|
+
const resp = await fetch("https://graph.microsoft.com/v1.0/$metadata", {
|
|
54
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
55
|
+
});
|
|
56
|
+
return resp.ok;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async collectEvidence(config) {
|
|
63
|
+
const artifacts = [];
|
|
64
|
+
const now = new Date().toISOString();
|
|
65
|
+
const token = await this.getAccessToken(config);
|
|
66
|
+
const headers = { Authorization: `Bearer ${token}` };
|
|
67
|
+
const policies = await fetch("https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies", { headers }).then((r) => r.json());
|
|
68
|
+
artifacts.push({
|
|
69
|
+
id: generateEvidenceId(),
|
|
70
|
+
connectorId: this.id,
|
|
71
|
+
capabilityId: "aad-conditional-access",
|
|
72
|
+
timestamp: now,
|
|
73
|
+
hash: hashEvidence(policies),
|
|
74
|
+
framework: "SOC2",
|
|
75
|
+
controlId: "CC6.1",
|
|
76
|
+
source: "azure-ad/conditionalAccess/policies",
|
|
77
|
+
status: (policies.value || []).length > 0 ? "compliant" : "non_compliant",
|
|
78
|
+
data: { policyCount: (policies.value || []).length, policies: policies.value },
|
|
79
|
+
metadata: { tenantId: config.tenantId || "" },
|
|
80
|
+
});
|
|
81
|
+
const mfaReport = await fetch("https://graph.microsoft.com/v1.0/reports/authenticationMethods/userRegistrationDetails?$select=isMfaRegistered,isMfaCapable", { headers }).then((r) => r.json());
|
|
82
|
+
const users = (mfaReport.value || []);
|
|
83
|
+
const mfaRegistered = users.filter((u) => u.isMfaRegistered === true).length;
|
|
84
|
+
artifacts.push({
|
|
85
|
+
id: generateEvidenceId(),
|
|
86
|
+
connectorId: this.id,
|
|
87
|
+
capabilityId: "aad-mfa-enrollment",
|
|
88
|
+
timestamp: now,
|
|
89
|
+
hash: hashEvidence(mfaReport),
|
|
90
|
+
framework: "SOC2",
|
|
91
|
+
controlId: "CC6.1",
|
|
92
|
+
source: "azure-ad/authenticationMethods/userRegistrationDetails",
|
|
93
|
+
status: users.length > 0 && mfaRegistered / users.length > 0.9 ? "compliant" : "partial",
|
|
94
|
+
data: { totalUsers: users.length, mfaRegistered, mfaCapable: users.filter((u) => u.isMfaCapable === true).length },
|
|
95
|
+
metadata: { tenantId: config.tenantId || "" },
|
|
96
|
+
});
|
|
97
|
+
const apps = await fetch("https://graph.microsoft.com/v1.0/applicationRegistrations", {
|
|
98
|
+
headers,
|
|
99
|
+
}).then((r) => r.json());
|
|
100
|
+
artifacts.push({
|
|
101
|
+
id: generateEvidenceId(),
|
|
102
|
+
connectorId: this.id,
|
|
103
|
+
capabilityId: "aad-app-registrations",
|
|
104
|
+
timestamp: now,
|
|
105
|
+
hash: hashEvidence(apps),
|
|
106
|
+
framework: "ISO27001",
|
|
107
|
+
controlId: "A.14.2.5",
|
|
108
|
+
source: "azure-ad/applicationRegistrations",
|
|
109
|
+
status: "unknown",
|
|
110
|
+
data: { appCount: (apps.value || []).length, apps: apps.value },
|
|
111
|
+
metadata: { tenantId: config.tenantId || "" },
|
|
112
|
+
});
|
|
113
|
+
return artifacts;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntegrationConnector, ConnectorConfig, EvidenceArtifact, IntegrationCapability, ComplianceFramework } from "../types.js";
|
|
2
|
+
export declare class AzureDevOpsConnector implements IntegrationConnector {
|
|
3
|
+
readonly id = "azure_devops";
|
|
4
|
+
readonly name = "Azure DevOps";
|
|
5
|
+
readonly category: "ci_cd";
|
|
6
|
+
readonly authType: "bearer_token";
|
|
7
|
+
readonly capabilities: IntegrationCapability[];
|
|
8
|
+
readonly frameworks: ComplianceFramework[];
|
|
9
|
+
private fetchApi;
|
|
10
|
+
testConnection(config: ConnectorConfig): Promise<boolean>;
|
|
11
|
+
collectEvidence(config: ConnectorConfig): Promise<EvidenceArtifact[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { hashEvidence, generateEvidenceId } from "../types.js";
|
|
2
|
+
const capabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "ado-pipelines",
|
|
5
|
+
name: "Pipeline Definitions",
|
|
6
|
+
description: "Fetch Azure DevOps pipeline definitions and run history",
|
|
7
|
+
evidenceCategories: ["ci_cd", "change_management"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "ado-repos",
|
|
11
|
+
name: "Repository Settings",
|
|
12
|
+
description: "Fetch repo branch policies and access control lists",
|
|
13
|
+
evidenceCategories: ["version_control", "access_control"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "ado-builds",
|
|
17
|
+
name: "Build Artifacts",
|
|
18
|
+
description: "Fetch build artifact integrity and retention policies",
|
|
19
|
+
evidenceCategories: ["ci_cd", "data_protection"],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "ado-pr",
|
|
23
|
+
name: "Pull Request Policies",
|
|
24
|
+
description: "Fetch PR merge policies and required reviewers",
|
|
25
|
+
evidenceCategories: ["change_management", "access_control"],
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
export class AzureDevOpsConnector {
|
|
29
|
+
id = "azure_devops";
|
|
30
|
+
name = "Azure DevOps";
|
|
31
|
+
category = "ci_cd";
|
|
32
|
+
authType = "bearer_token";
|
|
33
|
+
capabilities = capabilities;
|
|
34
|
+
frameworks = [
|
|
35
|
+
"SOC2",
|
|
36
|
+
"ISO27001",
|
|
37
|
+
"NIST_CSF",
|
|
38
|
+
"PCI_DSS",
|
|
39
|
+
];
|
|
40
|
+
async fetchApi(config, endpoint) {
|
|
41
|
+
const base = config.baseUrl || "https://dev.azure.com";
|
|
42
|
+
const org = config.extra?.org || "default";
|
|
43
|
+
const resp = await fetch(`${base}/${org}/_apis${endpoint}`, {
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: `Bearer ${config.apiToken}`,
|
|
46
|
+
Accept: "application/json",
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
if (!resp.ok)
|
|
50
|
+
throw new Error(`Azure DevOps API ${resp.status}: ${resp.statusText}`);
|
|
51
|
+
return (await resp.json());
|
|
52
|
+
}
|
|
53
|
+
async testConnection(config) {
|
|
54
|
+
try {
|
|
55
|
+
const org = config.extra?.org || "default";
|
|
56
|
+
await this.fetchApi(config, "/core/teams?api-version=7.0");
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async collectEvidence(config) {
|
|
64
|
+
const artifacts = [];
|
|
65
|
+
const now = new Date().toISOString();
|
|
66
|
+
const org = config.extra?.org || "default";
|
|
67
|
+
const project = config.extra?.project || "default";
|
|
68
|
+
const pipelines = await this.fetchApi(config, `/build/definitions?api-version=7.0&searchFilter=owner&path=/`).catch(() => ({ count: 0, value: [] }));
|
|
69
|
+
const pipelineList = Array.isArray(pipelines.value) ? pipelines.value : [];
|
|
70
|
+
artifacts.push({
|
|
71
|
+
id: generateEvidenceId(),
|
|
72
|
+
connectorId: this.id,
|
|
73
|
+
capabilityId: "ado-pipelines",
|
|
74
|
+
timestamp: now,
|
|
75
|
+
hash: hashEvidence({ count: pipelineList.length }),
|
|
76
|
+
framework: "SOC2",
|
|
77
|
+
controlId: "CC8.1",
|
|
78
|
+
source: `azure-devops/${org}/${project}/pipelines`,
|
|
79
|
+
status: pipelineList.length > 0 ? "compliant" : "partial",
|
|
80
|
+
data: { pipelineCount: pipelineList.length },
|
|
81
|
+
metadata: { org, project },
|
|
82
|
+
});
|
|
83
|
+
const repos = await this.fetchApi(config, `/git/repositories?api-version=7.0`).catch(() => ({ count: 0, value: [] }));
|
|
84
|
+
const repoList = Array.isArray(repos.value) ? repos.value : [];
|
|
85
|
+
artifacts.push({
|
|
86
|
+
id: generateEvidenceId(),
|
|
87
|
+
connectorId: this.id,
|
|
88
|
+
capabilityId: "ado-repos",
|
|
89
|
+
timestamp: now,
|
|
90
|
+
hash: hashEvidence({ count: repoList.length }),
|
|
91
|
+
framework: "ISO27001",
|
|
92
|
+
controlId: "A.12.1.1",
|
|
93
|
+
source: `azure-devops/${org}/${project}/repos`,
|
|
94
|
+
status: repoList.length > 0 ? "compliant" : "partial",
|
|
95
|
+
data: { repositoryCount: repoList.length },
|
|
96
|
+
metadata: { org, project },
|
|
97
|
+
});
|
|
98
|
+
const builds = await this.fetchApi(config, `/build/builds?api-version=7.0&top=10&resultFilter=succeeded,failed`).catch(() => ({ count: 0, value: [] }));
|
|
99
|
+
const buildList = Array.isArray(builds.value) ? builds.value : [];
|
|
100
|
+
artifacts.push({
|
|
101
|
+
id: generateEvidenceId(),
|
|
102
|
+
connectorId: this.id,
|
|
103
|
+
capabilityId: "ado-builds",
|
|
104
|
+
timestamp: now,
|
|
105
|
+
hash: hashEvidence({ count: buildList.length }),
|
|
106
|
+
framework: "NIST_CSF",
|
|
107
|
+
controlId: "PR.DS",
|
|
108
|
+
source: `azure-devops/${org}/${project}/builds`,
|
|
109
|
+
status: buildList.length > 0 ? "compliant" : "partial",
|
|
110
|
+
data: { recentBuilds: buildList.length },
|
|
111
|
+
metadata: { org, project },
|
|
112
|
+
});
|
|
113
|
+
const prPolicies = await this.fetchApi(config, `/git/policies/configurations?api-version=7.0`).catch(() => ({ count: 0, value: [] }));
|
|
114
|
+
const prList = Array.isArray(prPolicies.value) ? prPolicies.value : [];
|
|
115
|
+
artifacts.push({
|
|
116
|
+
id: generateEvidenceId(),
|
|
117
|
+
connectorId: this.id,
|
|
118
|
+
capabilityId: "ado-pr",
|
|
119
|
+
timestamp: now,
|
|
120
|
+
hash: hashEvidence({ count: prList.length }),
|
|
121
|
+
framework: "PCI_DSS",
|
|
122
|
+
controlId: "6.5.2",
|
|
123
|
+
source: `azure-devops/${org}/${project}/pr-policies`,
|
|
124
|
+
status: prList.length > 0 ? "compliant" : "partial",
|
|
125
|
+
data: { policyCount: prList.length },
|
|
126
|
+
metadata: { org, project },
|
|
127
|
+
});
|
|
128
|
+
return artifacts;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntegrationConnector, ConnectorConfig, EvidenceArtifact, IntegrationCapability, ComplianceFramework } from "../types.js";
|
|
2
|
+
export declare class AzureDevOpsPipelinesConnector implements IntegrationConnector {
|
|
3
|
+
readonly id = "azuredevops-pipelines";
|
|
4
|
+
readonly name = "Azure DevOps Pipelines";
|
|
5
|
+
readonly category: "ci_cd";
|
|
6
|
+
readonly authType: "bearer_token";
|
|
7
|
+
readonly capabilities: IntegrationCapability[];
|
|
8
|
+
readonly frameworks: ComplianceFramework[];
|
|
9
|
+
private fetchApi;
|
|
10
|
+
testConnection(config: ConnectorConfig): Promise<boolean>;
|
|
11
|
+
collectEvidence(config: ConnectorConfig): Promise<EvidenceArtifact[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { hashEvidence, generateEvidenceId } from "../types.js";
|
|
2
|
+
const capabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "azuredevops-pipelines",
|
|
5
|
+
name: "Build Pipelines",
|
|
6
|
+
description: "Fetch Azure DevOps pipeline definitions and run history",
|
|
7
|
+
evidenceCategories: ["ci_cd", "change_management"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "azuredevops-releases",
|
|
11
|
+
name: "Release Pipelines",
|
|
12
|
+
description: "Fetch release pipeline configurations and deployment approvals",
|
|
13
|
+
evidenceCategories: ["ci_cd", "access_control"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "azuredevops-security",
|
|
17
|
+
name: "Pipeline Security",
|
|
18
|
+
description: "Fetch pipeline permissions, service connections, and variable groups",
|
|
19
|
+
evidenceCategories: ["access_control", "secret_management"],
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
export class AzureDevOpsPipelinesConnector {
|
|
23
|
+
id = "azuredevops-pipelines";
|
|
24
|
+
name = "Azure DevOps Pipelines";
|
|
25
|
+
category = "ci_cd";
|
|
26
|
+
authType = "bearer_token";
|
|
27
|
+
capabilities = capabilities;
|
|
28
|
+
frameworks = ["SOC2", "ISO27001", "NIST_CSF"];
|
|
29
|
+
async fetchApi(config, endpoint) {
|
|
30
|
+
const org = config.extra?.org || "default";
|
|
31
|
+
const base = config.baseUrl || `https://dev.azure.com/${org}`;
|
|
32
|
+
const resp = await fetch(`${base}${endpoint}`, {
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: `Bearer ${config.apiToken}`,
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
if (!resp.ok)
|
|
39
|
+
throw new Error(`Azure DevOps API ${resp.status}: ${resp.statusText}`);
|
|
40
|
+
return (await resp.json());
|
|
41
|
+
}
|
|
42
|
+
async testConnection(config) {
|
|
43
|
+
try {
|
|
44
|
+
await this.fetchApi(config, "/_apis/projects?api-version=7.0&$top=1");
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async collectEvidence(config) {
|
|
52
|
+
const artifacts = [];
|
|
53
|
+
const now = new Date().toISOString();
|
|
54
|
+
const project = config.extra?.project || "default";
|
|
55
|
+
const pipelines = await this.fetchApi(config, `/${project}/_apis/pipelines?api-version=7.0`).catch(() => ({ value: [] }));
|
|
56
|
+
const pipelineList = (pipelines.value || []);
|
|
57
|
+
artifacts.push({
|
|
58
|
+
id: generateEvidenceId(),
|
|
59
|
+
connectorId: this.id,
|
|
60
|
+
capabilityId: "azuredevops-pipelines",
|
|
61
|
+
timestamp: now,
|
|
62
|
+
hash: hashEvidence({ pipelineCount: pipelineList.length }),
|
|
63
|
+
framework: "SOC2",
|
|
64
|
+
controlId: "CC8.1",
|
|
65
|
+
source: "azuredevops/pipelines",
|
|
66
|
+
status: pipelineList.length > 0 ? "compliant" : "unknown",
|
|
67
|
+
data: { pipelineCount: pipelineList.length },
|
|
68
|
+
metadata: { project },
|
|
69
|
+
});
|
|
70
|
+
return artifacts;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntegrationConnector, ConnectorConfig, EvidenceArtifact, IntegrationCapability, ComplianceFramework } from "../types.js";
|
|
2
|
+
export declare class AzurePipelinesConnector implements IntegrationConnector {
|
|
3
|
+
readonly id = "azure-pipelines";
|
|
4
|
+
readonly name = "Azure Pipelines";
|
|
5
|
+
readonly category: "ci_cd";
|
|
6
|
+
readonly authType: "bearer_token";
|
|
7
|
+
readonly capabilities: IntegrationCapability[];
|
|
8
|
+
readonly frameworks: ComplianceFramework[];
|
|
9
|
+
private fetchApi;
|
|
10
|
+
testConnection(config: ConnectorConfig): Promise<boolean>;
|
|
11
|
+
collectEvidence(config: ConnectorConfig): Promise<EvidenceArtifact[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { hashEvidence, generateEvidenceId } from "../types.js";
|
|
2
|
+
const capabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "azurepipelines-builds",
|
|
5
|
+
name: "Build Pipelines",
|
|
6
|
+
description: "Fetch Azure Pipelines build definitions and execution history",
|
|
7
|
+
evidenceCategories: ["ci_cd", "change_management"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "azurepipelines-releases",
|
|
11
|
+
name: "Release Pipelines",
|
|
12
|
+
description: "Fetch release pipeline configurations and approval gates",
|
|
13
|
+
evidenceCategories: ["ci_cd", "access_control"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "azurepipelines-service-connections",
|
|
17
|
+
name: "Service Connections",
|
|
18
|
+
description: "Fetch service connection authorizations and shared variables",
|
|
19
|
+
evidenceCategories: ["access_control", "secret_management"],
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
export class AzurePipelinesConnector {
|
|
23
|
+
id = "azure-pipelines";
|
|
24
|
+
name = "Azure Pipelines";
|
|
25
|
+
category = "ci_cd";
|
|
26
|
+
authType = "bearer_token";
|
|
27
|
+
capabilities = capabilities;
|
|
28
|
+
frameworks = ["SOC2", "ISO27001", "NIST_CSF"];
|
|
29
|
+
async fetchApi(config, endpoint) {
|
|
30
|
+
const org = config.extra?.org || "default";
|
|
31
|
+
const project = config.extra?.project || "default";
|
|
32
|
+
const base = config.baseUrl || `https://dev.azure.com/${org}/${project}/_apis`;
|
|
33
|
+
const resp = await fetch(`${base}${endpoint}`, {
|
|
34
|
+
headers: {
|
|
35
|
+
Authorization: `Bearer ${config.apiToken}`,
|
|
36
|
+
"Content-Type": "application/json",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
if (!resp.ok)
|
|
40
|
+
throw new Error(`Azure Pipelines API ${resp.status}: ${resp.statusText}`);
|
|
41
|
+
return (await resp.json());
|
|
42
|
+
}
|
|
43
|
+
async testConnection(config) {
|
|
44
|
+
try {
|
|
45
|
+
await this.fetchApi(config, "/build/builds?api-version=7.0&$top=1");
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async collectEvidence(config) {
|
|
53
|
+
const artifacts = [];
|
|
54
|
+
const now = new Date().toISOString();
|
|
55
|
+
const builds = await this.fetchApi(config, "/build/builds?api-version=7.0&$top=100").catch(() => ({ value: [] }));
|
|
56
|
+
const buildList = (builds.value || []);
|
|
57
|
+
artifacts.push({
|
|
58
|
+
id: generateEvidenceId(),
|
|
59
|
+
connectorId: this.id,
|
|
60
|
+
capabilityId: "azurepipelines-builds",
|
|
61
|
+
timestamp: now,
|
|
62
|
+
hash: hashEvidence({ buildCount: buildList.length }),
|
|
63
|
+
framework: "SOC2",
|
|
64
|
+
controlId: "CC8.1",
|
|
65
|
+
source: "azure-pipelines/builds",
|
|
66
|
+
status: "unknown",
|
|
67
|
+
data: { buildCount: buildList.length },
|
|
68
|
+
metadata: {},
|
|
69
|
+
});
|
|
70
|
+
return artifacts;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntegrationConnector, ConnectorConfig, EvidenceArtifact, IntegrationCapability, ComplianceFramework } from "../types.js";
|
|
2
|
+
export declare class AzurePolicyConnector implements IntegrationConnector {
|
|
3
|
+
readonly id = "azure_policy";
|
|
4
|
+
readonly name = "Azure Policy";
|
|
5
|
+
readonly category: "cloud_provider";
|
|
6
|
+
readonly authType: "oauth2";
|
|
7
|
+
readonly capabilities: IntegrationCapability[];
|
|
8
|
+
readonly frameworks: ComplianceFramework[];
|
|
9
|
+
private getToken;
|
|
10
|
+
testConnection(config: ConnectorConfig): Promise<boolean>;
|
|
11
|
+
collectEvidence(config: ConnectorConfig): Promise<EvidenceArtifact[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { hashEvidence, generateEvidenceId } from "../types.js";
|
|
2
|
+
const capabilities = [
|
|
3
|
+
{
|
|
4
|
+
id: "az-policy-compliance",
|
|
5
|
+
name: "Policy Compliance State",
|
|
6
|
+
description: "Fetch Azure Policy compliance state per scope",
|
|
7
|
+
evidenceCategories: ["compliance", "configuration"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "az-policy-assignments",
|
|
11
|
+
name: "Policy Assignments",
|
|
12
|
+
description: "Fetch assigned policies and initiatives across management groups",
|
|
13
|
+
evidenceCategories: ["configuration", "access_control"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "az-policy-remediation",
|
|
17
|
+
name: "Remediation Tasks",
|
|
18
|
+
description: "Fetch policy remediation task status and non-compliant resources",
|
|
19
|
+
evidenceCategories: ["change_management", "compliance"],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "az-policy-deny",
|
|
23
|
+
name: "Deny Effect Evaluations",
|
|
24
|
+
description: "Fetch deny-effect policy evaluation results",
|
|
25
|
+
evidenceCategories: ["access_control", "configuration"],
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
export class AzurePolicyConnector {
|
|
29
|
+
id = "azure_policy";
|
|
30
|
+
name = "Azure Policy";
|
|
31
|
+
category = "cloud_provider";
|
|
32
|
+
authType = "oauth2";
|
|
33
|
+
capabilities = capabilities;
|
|
34
|
+
frameworks = [
|
|
35
|
+
"SOC2",
|
|
36
|
+
"ISO27001",
|
|
37
|
+
"NIST_CSF",
|
|
38
|
+
"HIPAA",
|
|
39
|
+
"CIS",
|
|
40
|
+
];
|
|
41
|
+
async getToken(config) {
|
|
42
|
+
if (config.apiToken)
|
|
43
|
+
return config.apiToken;
|
|
44
|
+
const resp = await fetch(`https://login.microsoftonline.com/${config.tenantId}/oauth2/v2.0/token`, {
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
47
|
+
body: new URLSearchParams({
|
|
48
|
+
grant_type: "client_credentials",
|
|
49
|
+
client_id: config.clientId || "",
|
|
50
|
+
client_secret: config.clientSecret || "",
|
|
51
|
+
scope: "https://management.azure.com/.default",
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
const data = (await resp.json());
|
|
55
|
+
return data.access_token;
|
|
56
|
+
}
|
|
57
|
+
async testConnection(config) {
|
|
58
|
+
try {
|
|
59
|
+
const token = await this.getToken(config);
|
|
60
|
+
const resp = await fetch("https://management.azure.com/subscriptions?api-version=2020-01-01", { headers: { Authorization: `Bearer ${token}` } });
|
|
61
|
+
return resp.ok;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async collectEvidence(config) {
|
|
68
|
+
const artifacts = [];
|
|
69
|
+
const now = new Date().toISOString();
|
|
70
|
+
const token = await this.getToken(config);
|
|
71
|
+
const subscriptionId = config.extra?.subscriptionId || "default";
|
|
72
|
+
const scope = `/subscriptions/${subscriptionId}`;
|
|
73
|
+
const complianceState = await fetch(`https://management.azure.com${scope}/providers/Microsoft.PolicyInsights/policyStates/latest/summarizeByPolicyGroup?api-version=2021-10-01`, { headers: { Authorization: `Bearer ${token}` } })
|
|
74
|
+
.then((r) => r.json())
|
|
75
|
+
.catch(() => ({ value: [] }));
|
|
76
|
+
artifacts.push({
|
|
77
|
+
id: generateEvidenceId(),
|
|
78
|
+
connectorId: this.id,
|
|
79
|
+
capabilityId: "az-policy-compliance",
|
|
80
|
+
timestamp: now,
|
|
81
|
+
hash: hashEvidence(complianceState),
|
|
82
|
+
framework: "SOC2",
|
|
83
|
+
controlId: "CC6.1",
|
|
84
|
+
source: `azure/policy/${subscriptionId}/compliance`,
|
|
85
|
+
status: "compliant",
|
|
86
|
+
data: { policyGroups: Array.isArray(complianceState.value) ? complianceState.value.length : 0 },
|
|
87
|
+
metadata: { subscriptionId },
|
|
88
|
+
});
|
|
89
|
+
const assignments = await fetch(`https://management.azure.com${scope}/providers/Microsoft.Authorization/policyAssignments?api-version=2021-06-01`, { headers: { Authorization: `Bearer ${token}` } })
|
|
90
|
+
.then((r) => r.json())
|
|
91
|
+
.catch(() => ({ value: [] }));
|
|
92
|
+
artifacts.push({
|
|
93
|
+
id: generateEvidenceId(),
|
|
94
|
+
connectorId: this.id,
|
|
95
|
+
capabilityId: "az-policy-assignments",
|
|
96
|
+
timestamp: now,
|
|
97
|
+
hash: hashEvidence(assignments),
|
|
98
|
+
framework: "ISO27001",
|
|
99
|
+
controlId: "A.12.1.1",
|
|
100
|
+
source: `azure/policy/${subscriptionId}/assignments`,
|
|
101
|
+
status: Array.isArray(assignments.value) && assignments.value.length > 0
|
|
102
|
+
? "compliant"
|
|
103
|
+
: "partial",
|
|
104
|
+
data: { assignmentCount: Array.isArray(assignments.value) ? assignments.value.length : 0 },
|
|
105
|
+
metadata: { subscriptionId },
|
|
106
|
+
});
|
|
107
|
+
const remediations = await fetch(`https://management.azure.com${scope}/providers/Microsoft.PolicyInsights/remediations?api-version=2021-10-01`, { headers: { Authorization: `Bearer ${token}` } })
|
|
108
|
+
.then((r) => r.json())
|
|
109
|
+
.catch(() => ({ value: [] }));
|
|
110
|
+
artifacts.push({
|
|
111
|
+
id: generateEvidenceId(),
|
|
112
|
+
connectorId: this.id,
|
|
113
|
+
capabilityId: "az-policy-remediation",
|
|
114
|
+
timestamp: now,
|
|
115
|
+
hash: hashEvidence(remediations),
|
|
116
|
+
framework: "NIST_CSF",
|
|
117
|
+
controlId: "ID.RA",
|
|
118
|
+
source: `azure/policy/${subscriptionId}/remediations`,
|
|
119
|
+
status: "compliant",
|
|
120
|
+
data: { remediationCount: Array.isArray(remediations.value) ? remediations.value.length : 0 },
|
|
121
|
+
metadata: { subscriptionId },
|
|
122
|
+
});
|
|
123
|
+
const denyEvaluations = await fetch(`https://management.azure.com${scope}/providers/Microsoft.PolicyInsights/policyStates/latest/summarize?api-version=2021-10-01&$filter=PolicyDefinitionAction%20eq%20'deny'`, { headers: { Authorization: `Bearer ${token}` } })
|
|
124
|
+
.then((r) => r.json())
|
|
125
|
+
.catch(() => ({ value: [] }));
|
|
126
|
+
artifacts.push({
|
|
127
|
+
id: generateEvidenceId(),
|
|
128
|
+
connectorId: this.id,
|
|
129
|
+
capabilityId: "az-policy-deny",
|
|
130
|
+
timestamp: now,
|
|
131
|
+
hash: hashEvidence(denyEvaluations),
|
|
132
|
+
framework: "CIS",
|
|
133
|
+
controlId: "2.1",
|
|
134
|
+
source: `azure/policy/${subscriptionId}/deny-evaluations`,
|
|
135
|
+
status: "compliant",
|
|
136
|
+
data: { evaluationCount: Array.isArray(denyEvaluations.value) ? denyEvaluations.value.length : 0 },
|
|
137
|
+
metadata: { subscriptionId },
|
|
138
|
+
});
|
|
139
|
+
return artifacts;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntegrationConnector, ConnectorConfig, EvidenceArtifact, IntegrationCapability, ComplianceFramework } from "../types.js";
|
|
2
|
+
export declare class AzureReposConnector implements IntegrationConnector {
|
|
3
|
+
readonly id = "azure-repos";
|
|
4
|
+
readonly name = "Azure Repos";
|
|
5
|
+
readonly category: "version_control";
|
|
6
|
+
readonly authType: "api_key";
|
|
7
|
+
readonly capabilities: IntegrationCapability[];
|
|
8
|
+
readonly frameworks: ComplianceFramework[];
|
|
9
|
+
private fetchApi;
|
|
10
|
+
testConnection(config: ConnectorConfig): Promise<boolean>;
|
|
11
|
+
collectEvidence(config: ConnectorConfig): Promise<EvidenceArtifact[]>;
|
|
12
|
+
}
|