first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Test MicrosoftGraphSecurity, secureScore => get', () => {
|
||||
const credentials = {
|
||||
microsoftGraphSecurityOAuth2Api: {
|
||||
oauthTokenData: {
|
||||
access_token: 'test-access-token',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
nock('https://graph.microsoft.com')
|
||||
.get('/v1.0/security/secureScores/test-secure-score-id')
|
||||
.matchHeader('Authorization', 'Bearer test-access-token')
|
||||
.reply(200, {
|
||||
'@odata.context':
|
||||
'https://graph.microsoft.com/v1.0/$metadata#security/secureScores/$entity',
|
||||
id: 'test-secure-score-id',
|
||||
azureTenantId: 'tenant-123',
|
||||
activeUserCount: 100,
|
||||
createdDateTime: '2023-01-01T00:00:00Z',
|
||||
currentScore: 85,
|
||||
maxScore: 100,
|
||||
averageComparativeScores: [
|
||||
{
|
||||
basis: 'AllTenants',
|
||||
averageScore: 75.5,
|
||||
},
|
||||
],
|
||||
controlScores: [
|
||||
{
|
||||
controlName: 'Enable MFA',
|
||||
controlCategory: 'Identity',
|
||||
score: 10,
|
||||
maxScore: 10,
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
credentials,
|
||||
workflowFiles: ['secureScore.get.workflow.json'],
|
||||
});
|
||||
});
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"name": "Microsoft GraphSecurity SecureScore Get Test",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "trigger-id",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "secureScore",
|
||||
"operation": "get",
|
||||
"secureScoreId": "test-secure-score-id"
|
||||
},
|
||||
"id": "node-id",
|
||||
"name": "Microsoft Graph Security",
|
||||
"type": "n8n-nodes-base.microsoftGraphSecurity",
|
||||
"typeVersion": 1,
|
||||
"position": [1040, 360],
|
||||
"credentials": {
|
||||
"microsoftGraphSecurityOAuth2Api": {
|
||||
"id": "credential-id",
|
||||
"name": "Microsoft Graph Security OAuth2"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Microsoft Graph Security": [
|
||||
{
|
||||
"json": {
|
||||
"id": "test-secure-score-id",
|
||||
"azureTenantId": "tenant-123",
|
||||
"activeUserCount": 100,
|
||||
"createdDateTime": "2023-01-01T00:00:00Z",
|
||||
"currentScore": 85,
|
||||
"maxScore": 100,
|
||||
"averageComparativeScores": [
|
||||
{
|
||||
"basis": "AllTenants",
|
||||
"averageScore": 75.5
|
||||
}
|
||||
],
|
||||
"controlScores": [
|
||||
{
|
||||
"controlName": "Enable MFA",
|
||||
"controlCategory": "Identity",
|
||||
"score": 10,
|
||||
"maxScore": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Graph Security",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "test-version-id",
|
||||
"id": "test-workflow-id",
|
||||
"meta": {
|
||||
"instanceId": "test-instance-id"
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Test MicrosoftGraphSecurity, secureScore => getAll', () => {
|
||||
const credentials = {
|
||||
microsoftGraphSecurityOAuth2Api: {
|
||||
oauthTokenData: {
|
||||
access_token: 'test-access-token',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
nock('https://graph.microsoft.com')
|
||||
.get('/v1.0/security/secureScores')
|
||||
.matchHeader('Authorization', 'Bearer test-access-token')
|
||||
.reply(200, {
|
||||
'@odata.context': 'https://graph.microsoft.com/v1.0/$metadata#security/secureScores',
|
||||
value: [
|
||||
{
|
||||
id: 'test-secure-score-1',
|
||||
azureTenantId: 'tenant-123',
|
||||
activeUserCount: 100,
|
||||
createdDateTime: '2023-01-01T00:00:00Z',
|
||||
currentScore: 85,
|
||||
maxScore: 100,
|
||||
averageComparativeScores: [
|
||||
{
|
||||
basis: 'AllTenants',
|
||||
averageScore: 75.5,
|
||||
},
|
||||
],
|
||||
controlScores: [
|
||||
{
|
||||
controlName: 'Enable MFA',
|
||||
controlCategory: 'Identity',
|
||||
score: 10,
|
||||
maxScore: 10,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'test-secure-score-2',
|
||||
azureTenantId: 'tenant-456',
|
||||
activeUserCount: 200,
|
||||
createdDateTime: '2023-01-02T00:00:00Z',
|
||||
currentScore: 90,
|
||||
maxScore: 100,
|
||||
averageComparativeScores: [
|
||||
{
|
||||
basis: 'AllTenants',
|
||||
averageScore: 78.2,
|
||||
},
|
||||
],
|
||||
controlScores: [
|
||||
{
|
||||
controlName: 'Enable Conditional Access',
|
||||
controlCategory: 'Identity',
|
||||
score: 15,
|
||||
maxScore: 15,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
credentials,
|
||||
workflowFiles: ['secureScore.getAll.workflow.json'],
|
||||
});
|
||||
});
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"name": "Microsoft GraphSecurity SecureScore GetAll Test",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "trigger-id",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "secureScore",
|
||||
"operation": "getAll",
|
||||
"returnAll": true
|
||||
},
|
||||
"id": "node-id",
|
||||
"name": "Microsoft Graph Security",
|
||||
"type": "n8n-nodes-base.microsoftGraphSecurity",
|
||||
"typeVersion": 1,
|
||||
"position": [1040, 360],
|
||||
"credentials": {
|
||||
"microsoftGraphSecurityOAuth2Api": {
|
||||
"id": "credential-id",
|
||||
"name": "Microsoft Graph Security OAuth2"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Microsoft Graph Security": [
|
||||
{
|
||||
"json": {
|
||||
"id": "test-secure-score-1",
|
||||
"azureTenantId": "tenant-123",
|
||||
"activeUserCount": 100,
|
||||
"createdDateTime": "2023-01-01T00:00:00Z",
|
||||
"currentScore": 85,
|
||||
"maxScore": 100,
|
||||
"averageComparativeScores": [
|
||||
{
|
||||
"basis": "AllTenants",
|
||||
"averageScore": 75.5
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"id": "test-secure-score-2",
|
||||
"azureTenantId": "tenant-456",
|
||||
"activeUserCount": 200,
|
||||
"createdDateTime": "2023-01-02T00:00:00Z",
|
||||
"currentScore": 90,
|
||||
"maxScore": 100,
|
||||
"averageComparativeScores": [
|
||||
{
|
||||
"basis": "AllTenants",
|
||||
"averageScore": 78.2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Graph Security",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "test-version-id",
|
||||
"id": "test-workflow-id",
|
||||
"meta": {
|
||||
"instanceId": "test-instance-id"
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Test MicrosoftGraphSecurity, secureScoreControlProfile => get', () => {
|
||||
const credentials = {
|
||||
microsoftGraphSecurityOAuth2Api: {
|
||||
oauthTokenData: {
|
||||
access_token: 'test-access-token',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
nock('https://graph.microsoft.com')
|
||||
.get('/v1.0/security/secureScoreControlProfiles/test-control-profile-id')
|
||||
.matchHeader('Authorization', 'Bearer test-access-token')
|
||||
.reply(200, {
|
||||
'@odata.context':
|
||||
'https://graph.microsoft.com/v1.0/$metadata#security/secureScoreControlProfiles/$entity',
|
||||
id: 'test-control-profile-id',
|
||||
azureTenantId: 'tenant-123',
|
||||
controlName: 'Enable multifactor authentication',
|
||||
controlCategory: 'Identity',
|
||||
actionType: 'Config',
|
||||
service: 'AAD',
|
||||
maxScore: 10,
|
||||
tier: 'Core',
|
||||
userImpact: 'Low',
|
||||
implementationCost: 'Low',
|
||||
rank: 1,
|
||||
threats: ['Account Breach', 'Credential Theft'],
|
||||
deprecated: false,
|
||||
remediation: 'Enable multi-factor authentication for all users',
|
||||
remediationImpact: 'Users will need to use an additional authentication method',
|
||||
actionUrl: 'https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/MFA',
|
||||
controlStateUpdates: [],
|
||||
vendorInformation: {
|
||||
provider: 'Microsoft',
|
||||
vendor: 'Microsoft',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
credentials,
|
||||
workflowFiles: ['secureScoreControlProfile.get.workflow.json'],
|
||||
});
|
||||
});
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "Microsoft GraphSecurity SecureScoreControlProfile Get Test",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "trigger-id",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "secureScoreControlProfile",
|
||||
"operation": "get",
|
||||
"secureScoreControlProfileId": "test-control-profile-id"
|
||||
},
|
||||
"id": "node-id",
|
||||
"name": "Microsoft Graph Security",
|
||||
"type": "n8n-nodes-base.microsoftGraphSecurity",
|
||||
"typeVersion": 1,
|
||||
"position": [1040, 360],
|
||||
"credentials": {
|
||||
"microsoftGraphSecurityOAuth2Api": {
|
||||
"id": "credential-id",
|
||||
"name": "Microsoft Graph Security OAuth2"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Microsoft Graph Security": [
|
||||
{
|
||||
"json": {
|
||||
"id": "test-control-profile-id",
|
||||
"azureTenantId": "tenant-123",
|
||||
"controlName": "Enable multifactor authentication",
|
||||
"controlCategory": "Identity",
|
||||
"actionType": "Config",
|
||||
"service": "AAD",
|
||||
"maxScore": 10,
|
||||
"tier": "Core",
|
||||
"userImpact": "Low",
|
||||
"implementationCost": "Low",
|
||||
"rank": 1,
|
||||
"threats": ["Account Breach", "Credential Theft"],
|
||||
"deprecated": false,
|
||||
"remediation": "Enable multi-factor authentication for all users",
|
||||
"remediationImpact": "Users will need to use an additional authentication method",
|
||||
"actionUrl": "https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/MFA",
|
||||
"controlStateUpdates": [],
|
||||
"vendorInformation": {
|
||||
"provider": "Microsoft",
|
||||
"vendor": "Microsoft"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Graph Security",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "test-version-id",
|
||||
"id": "test-workflow-id",
|
||||
"meta": {
|
||||
"instanceId": "test-instance-id"
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Test MicrosoftGraphSecurity, secureScoreControlProfile => getAll', () => {
|
||||
const credentials = {
|
||||
microsoftGraphSecurityOAuth2Api: {
|
||||
oauthTokenData: {
|
||||
access_token: 'test-access-token',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
nock('https://graph.microsoft.com')
|
||||
.get('/v1.0/security/secureScoreControlProfiles')
|
||||
.matchHeader('Authorization', 'Bearer test-access-token')
|
||||
.reply(200, {
|
||||
'@odata.context':
|
||||
'https://graph.microsoft.com/v1.0/$metadata#security/secureScoreControlProfiles',
|
||||
value: [
|
||||
{
|
||||
id: 'test-control-profile-1',
|
||||
azureTenantId: 'tenant-123',
|
||||
controlName: 'Enable multifactor authentication',
|
||||
controlCategory: 'Identity',
|
||||
actionType: 'Config',
|
||||
service: 'AAD',
|
||||
maxScore: 10,
|
||||
tier: 'Core',
|
||||
userImpact: 'Low',
|
||||
implementationCost: 'Low',
|
||||
rank: 1,
|
||||
threats: ['Account Breach', 'Credential Theft'],
|
||||
deprecated: false,
|
||||
remediation: 'Enable multi-factor authentication for all users',
|
||||
remediationImpact: 'Users will need to use an additional authentication method',
|
||||
actionUrl:
|
||||
'https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/MFA',
|
||||
controlStateUpdates: [],
|
||||
vendorInformation: {
|
||||
provider: 'Microsoft',
|
||||
vendor: 'Microsoft',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'test-control-profile-2',
|
||||
azureTenantId: 'tenant-456',
|
||||
controlName: 'Enable conditional access',
|
||||
controlCategory: 'Identity',
|
||||
actionType: 'Config',
|
||||
service: 'AAD',
|
||||
maxScore: 15,
|
||||
tier: 'Core',
|
||||
userImpact: 'Medium',
|
||||
implementationCost: 'Medium',
|
||||
rank: 2,
|
||||
threats: ['Account Breach', 'Data Exfiltration'],
|
||||
deprecated: false,
|
||||
remediation: 'Configure conditional access policies',
|
||||
remediationImpact: 'Users may need to authenticate differently based on location',
|
||||
actionUrl:
|
||||
'https://portal.azure.com/#blade/Microsoft_AAD_ConditionalAccess/ConditionalAccessBlade',
|
||||
controlStateUpdates: [],
|
||||
vendorInformation: {
|
||||
provider: 'Microsoft',
|
||||
vendor: 'Microsoft',
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
credentials,
|
||||
workflowFiles: ['secureScoreControlProfile.getAll.workflow.json'],
|
||||
});
|
||||
});
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"name": "Microsoft GraphSecurity SecureScoreControlProfile GetAll Test",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "trigger-id",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "secureScoreControlProfile",
|
||||
"operation": "getAll",
|
||||
"returnAll": true
|
||||
},
|
||||
"id": "node-id",
|
||||
"name": "Microsoft Graph Security",
|
||||
"type": "n8n-nodes-base.microsoftGraphSecurity",
|
||||
"typeVersion": 1,
|
||||
"position": [1040, 360],
|
||||
"credentials": {
|
||||
"microsoftGraphSecurityOAuth2Api": {
|
||||
"id": "credential-id",
|
||||
"name": "Microsoft Graph Security OAuth2"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Microsoft Graph Security": [
|
||||
{
|
||||
"json": {
|
||||
"id": "test-control-profile-1",
|
||||
"azureTenantId": "tenant-123",
|
||||
"controlName": "Enable multifactor authentication",
|
||||
"controlCategory": "Identity",
|
||||
"actionType": "Config",
|
||||
"service": "AAD",
|
||||
"maxScore": 10,
|
||||
"tier": "Core",
|
||||
"userImpact": "Low",
|
||||
"implementationCost": "Low",
|
||||
"rank": 1,
|
||||
"threats": ["Account Breach", "Credential Theft"],
|
||||
"deprecated": false,
|
||||
"remediation": "Enable multi-factor authentication for all users",
|
||||
"remediationImpact": "Users will need to use an additional authentication method",
|
||||
"actionUrl": "https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/MFA",
|
||||
"controlStateUpdates": [],
|
||||
"vendorInformation": {
|
||||
"provider": "Microsoft",
|
||||
"vendor": "Microsoft"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"json": {
|
||||
"id": "test-control-profile-2",
|
||||
"azureTenantId": "tenant-456",
|
||||
"controlName": "Enable conditional access",
|
||||
"controlCategory": "Identity",
|
||||
"actionType": "Config",
|
||||
"service": "AAD",
|
||||
"maxScore": 15,
|
||||
"tier": "Core",
|
||||
"userImpact": "Medium",
|
||||
"implementationCost": "Medium",
|
||||
"rank": 2,
|
||||
"threats": ["Account Breach", "Data Exfiltration"],
|
||||
"deprecated": false,
|
||||
"remediation": "Configure conditional access policies",
|
||||
"remediationImpact": "Users may need to authenticate differently based on location",
|
||||
"actionUrl": "https://portal.azure.com/#blade/Microsoft_AAD_ConditionalAccess/ConditionalAccessBlade",
|
||||
"controlStateUpdates": [],
|
||||
"vendorInformation": {
|
||||
"provider": "Microsoft",
|
||||
"vendor": "Microsoft"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Graph Security",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "test-version-id",
|
||||
"id": "test-workflow-id",
|
||||
"meta": {
|
||||
"instanceId": "test-instance-id"
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('Test MicrosoftGraphSecurity, secureScoreControlProfile => update', () => {
|
||||
const credentials = {
|
||||
microsoftGraphSecurityOAuth2Api: {
|
||||
oauthTokenData: {
|
||||
access_token: 'test-access-token',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
nock('https://graph.microsoft.com')
|
||||
.patch('/v1.0/security/secureScoreControlProfiles/test-control-profile-id', {
|
||||
vendorInformation: {
|
||||
provider: 'Microsoft',
|
||||
vendor: 'Microsoft',
|
||||
},
|
||||
state: 'Ignored',
|
||||
})
|
||||
.matchHeader('Authorization', 'Bearer test-access-token')
|
||||
.matchHeader('Prefer', 'return=representation')
|
||||
.reply(200, {
|
||||
'@odata.context':
|
||||
'https://graph.microsoft.com/v1.0/$metadata#security/secureScoreControlProfiles/$entity',
|
||||
id: 'test-control-profile-id',
|
||||
azureTenantId: 'tenant-123',
|
||||
controlName: 'Enable multifactor authentication',
|
||||
controlCategory: 'Identity',
|
||||
actionType: 'Config',
|
||||
service: 'AAD',
|
||||
maxScore: 10,
|
||||
tier: 'Core',
|
||||
userImpact: 'Low',
|
||||
implementationCost: 'Low',
|
||||
rank: 1,
|
||||
threats: ['Account Breach', 'Credential Theft'],
|
||||
deprecated: false,
|
||||
remediation: 'Enable multi-factor authentication for all users',
|
||||
remediationImpact: 'Users will need to use an additional authentication method',
|
||||
actionUrl: 'https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/MFA',
|
||||
controlStateUpdates: [],
|
||||
state: 'Ignored',
|
||||
vendorInformation: {
|
||||
provider: 'Microsoft',
|
||||
vendor: 'Microsoft',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
new NodeTestHarness().setupTests({
|
||||
credentials,
|
||||
workflowFiles: ['secureScoreControlProfile.update.workflow.json'],
|
||||
});
|
||||
});
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "Microsoft GraphSecurity SecureScoreControlProfile Update Test",
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "trigger-id",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [820, 360]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"resource": "secureScoreControlProfile",
|
||||
"operation": "update",
|
||||
"secureScoreControlProfileId": "test-control-profile-id",
|
||||
"provider": "Microsoft",
|
||||
"vendor": "Microsoft",
|
||||
"updateFields": {
|
||||
"state": "Ignored"
|
||||
}
|
||||
},
|
||||
"id": "node-id",
|
||||
"name": "Microsoft Graph Security",
|
||||
"type": "n8n-nodes-base.microsoftGraphSecurity",
|
||||
"typeVersion": 1,
|
||||
"position": [1040, 360],
|
||||
"credentials": {
|
||||
"microsoftGraphSecurityOAuth2Api": {
|
||||
"id": "credential-id",
|
||||
"name": "Microsoft Graph Security OAuth2"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Microsoft Graph Security": [
|
||||
{
|
||||
"json": {
|
||||
"id": "test-control-profile-id",
|
||||
"azureTenantId": "tenant-123",
|
||||
"controlName": "Enable multifactor authentication",
|
||||
"controlCategory": "Identity",
|
||||
"actionType": "Config",
|
||||
"service": "AAD",
|
||||
"maxScore": 10,
|
||||
"tier": "Core",
|
||||
"userImpact": "Low",
|
||||
"implementationCost": "Low",
|
||||
"rank": 1,
|
||||
"threats": ["Account Breach", "Credential Theft"],
|
||||
"deprecated": false,
|
||||
"remediation": "Enable multi-factor authentication for all users",
|
||||
"remediationImpact": "Users will need to use an additional authentication method",
|
||||
"actionUrl": "https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/MFA",
|
||||
"controlStateUpdates": [],
|
||||
"state": "Ignored",
|
||||
"vendorInformation": {
|
||||
"provider": "Microsoft",
|
||||
"vendor": "Microsoft"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Graph Security",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "test-version-id",
|
||||
"id": "test-workflow-id",
|
||||
"meta": {
|
||||
"instanceId": "test-instance-id"
|
||||
},
|
||||
"tags": []
|
||||
}
|
||||
Reference in New Issue
Block a user