Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c3ab792
feat: add n8n import UI
abhijeet-akto Dec 5, 2025
f3350c4
feat: add API for N8N import
abhijeet-akto Dec 5, 2025
4718440
chore: add database integration
abhijeet-akto Dec 5, 2025
0ee9315
chore: change collection name to generic
abhijeet-akto Dec 5, 2025
aca1368
fix: config structure
abhijeet-akto Dec 5, 2025
3a9f9a1
feat: add cron to schedule jobs
abhijeet-akto Dec 5, 2025
471d8e5
fix: issues with cron scheduler
abhijeet-akto Dec 6, 2025
d1913b9
feat: add langchain support
abhijeet-akto Dec 7, 2025
d1ab9b6
feat: add copilot studio support
abhijeet-akto Dec 7, 2025
9a7695f
chore: remove log statements
abhijeet-akto Dec 8, 2025
2b7a174
chore: add langchain logo
abhijeet-akto Dec 8, 2025
a9b2de6
feat: add cron support for AI agent
abhijeet-akto Dec 8, 2025
a02217e
feat: new implementation for scheduling ai agents jobs
abhijeet-akto Dec 9, 2025
ca1213b
feat: add azure download functionality
abhijeet-akto Dec 9, 2025
22861a8
chore: change job intervals
abhijeet-akto Dec 9, 2025
23cc09e
feat: add implementation for copilot and langchain
abhijeet-akto Dec 9, 2025
f92d6b5
fix: security valunerability
abhijeet-akto Dec 9, 2025
93008d0
fix: security valunerability
abhijeet-akto Dec 9, 2025
1c64776
fix: security valunerability
abhijeet-akto Dec 9, 2025
331e349
fix: security valunerability
abhijeet-akto Dec 9, 2025
9b8337c
fix: security valunerability
abhijeet-akto Dec 9, 2025
d785e77
fix: security valunerability
abhijeet-akto Dec 9, 2025
aad391c
fix: security valunerability
abhijeet-akto Dec 9, 2025
b5e5e69
Merge pull request #3720 from akto-api-security/abhi/feat/ai-agent-cr…
abhijeet-akto Dec 9, 2025
b682f0c
fix: security valunerability
abhijeet-akto Dec 9, 2025
dd68849
fix: security valunerability
abhijeet-akto Dec 9, 2025
a312c47
fix: security valunerability
abhijeet-akto Dec 9, 2025
bfe84eb
fix: security valunerability
abhijeet-akto Dec 9, 2025
722fe0e
fix: security valunerability
abhijeet-akto Dec 9, 2025
458dd0f
fix: security valunerability
abhijeet-akto Dec 9, 2025
548c056
fix: security valunerability
abhijeet-akto Dec 9, 2025
da4e570
fix: security valunerability
abhijeet-akto Dec 9, 2025
fd5c566
fix: security valunerability
abhijeet-akto Dec 9, 2025
f699ed2
fix: security valunerability
abhijeet-akto Dec 9, 2025
34caefe
fix: security valunerability
abhijeet-akto Dec 9, 2025
92cacc0
fix: security valunerability
abhijeet-akto Dec 9, 2025
1716090
fix: security valunerability
abhijeet-akto Dec 9, 2025
1a2b100
fix: security valunerability
abhijeet-akto Dec 9, 2025
b472977
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
2c85780
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
dd7ab2f
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
a494869
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
dce6fd1
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
a8879bf
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
246a0c6
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
a7b04f6
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
2980494
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
7a3ea6a
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
3c71b16
Update libs/utils/src/main/java/com/akto/jobs/executors/AIAgentConnec…
abhijeet-akto Dec 9, 2025
ea9214a
fix: security valunerability
abhijeet-akto Dec 9, 2025
f5dab11
fix: security valunerability
abhijeet-akto Dec 9, 2025
7efb3b4
fix: security valunerability
abhijeet-akto Dec 9, 2025
eae8e77
Merge pull request #3729 from akto-api-security/abhi/feat/ai-agent-cr…
abhijeet-akto Dec 9, 2025
d1c7d4e
chore: resolve pr comments
abhijeet-akto Dec 9, 2025
d44e07c
chore: code cleaning
abhijeet-akto Dec 9, 2025
43c703f
chore: remove unused code
abhijeet-akto Dec 9, 2025
58cd439
chore: resolved pr comments
abhijeet-akto Dec 10, 2025
152733b
chore: resolved pr comments
abhijeet-akto Dec 10, 2025
197daac
feat: add auth support for api key
abhijeet-akto Dec 10, 2025
9737cd7
feat: add auth logic
abhijeet-akto Dec 10, 2025
47adc21
chore: remove auth logic
abhijeet-akto Dec 10, 2025
d3dd787
chore: remove auth logic
abhijeet-akto Dec 10, 2025
f0c164e
feat: add jwt auth logic
abhijeet-akto Dec 10, 2025
8742fbf
chore: updated documentation
abhijeet-akto Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions apps/dashboard/src/main/java/com/akto/action/N8NImportAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
package com.akto.action;

import com.akto.dao.N8NImportInfoDao;
import com.akto.dao.context.Context;
import com.akto.dto.N8NImportInfo;
import com.akto.log.LoggerMaker;
import com.akto.log.LoggerMaker.LogDb;
import com.opensymphony.xwork2.Action;

public class N8NImportAction extends UserAction {

private String n8nUrl;
private String apiKey;
private String dataIngestionUrl;
private String dashboardUrl;
private N8NImportInfo createdImportInfo;

private static final LoggerMaker loggerMaker = new LoggerMaker(N8NImportAction.class, LoggerMaker.LogDb.DASHBOARD);

public String initiateN8NImport() {
try {
// Print the filled data to console
loggerMaker.info("=== N8N Import Request ===", LogDb.DASHBOARD);
loggerMaker.info("N8N URL: " + n8nUrl, LogDb.DASHBOARD);
loggerMaker.info("API Key: " + apiKey, LogDb.DASHBOARD);
loggerMaker.info("Data Ingestion Service URL: " + dataIngestionUrl, LogDb.DASHBOARD);
loggerMaker.info("Dashboard URL: " + dashboardUrl, LogDb.DASHBOARD);
loggerMaker.info("========================", LogDb.DASHBOARD);

// Print to standard output as well
System.out.println("\n=== N8N Import Request ===");
System.out.println("N8N URL: " + n8nUrl);
System.out.println("API Key: " + apiKey);
System.out.println("Data Ingestion Service URL: " + dataIngestionUrl);
System.out.println("Dashboard URL: " + dashboardUrl);
System.out.println("========================\n");

// Create the collection if it doesn't exist and set up indices
N8NImportInfoDao.instance.createIndicesIfAbsent();

// Get current timestamp
int currentTimestamp = Context.now();

// Create N8NImportInfo object with default status CREATED and type N8N
createdImportInfo = new N8NImportInfo(
N8NImportInfo.TYPE_N8N,
n8nUrl,
apiKey,
dataIngestionUrl,
dashboardUrl,
currentTimestamp,
currentTimestamp,
N8NImportInfo.STATUS_CREATED,
null
);

// Insert the document into the collection
N8NImportInfoDao.instance.insertOne(createdImportInfo);

loggerMaker.info("Successfully saved N8N Import data to collection: " + N8NImportInfoDao.COLLECTION_NAME + " with type: " + N8NImportInfo.TYPE_N8N + " and status: " + N8NImportInfo.STATUS_CREATED, LogDb.DASHBOARD);
System.out.println("Successfully saved N8N Import data to collection: " + N8NImportInfoDao.COLLECTION_NAME);
System.out.println("Type: " + N8NImportInfo.TYPE_N8N);
System.out.println("Status: " + N8NImportInfo.STATUS_CREATED);
System.out.println("Document ID: " + createdImportInfo.getHexId());

return Action.SUCCESS.toUpperCase();

} catch (Exception e) {
loggerMaker.error("Error while initiating N8N Import. Error: " + e.getMessage(), LoggerMaker.LogDb.DASHBOARD);
e.printStackTrace();

// Try to save error information to collection
try {
int currentTimestamp = Context.now();
createdImportInfo = new N8NImportInfo(
N8NImportInfo.TYPE_N8N,
n8nUrl,
apiKey,
dataIngestionUrl,
dashboardUrl,
currentTimestamp,
currentTimestamp,
N8NImportInfo.STATUS_FAILED_SCHEDULING,
e.getMessage()
);
N8NImportInfoDao.instance.insertOne(createdImportInfo);
} catch (Exception insertException) {
loggerMaker.error("Failed to save error information to collection: " + insertException.getMessage(), LogDb.DASHBOARD);
}

return Action.ERROR.toUpperCase();
}
}

// Getters and Setters
public String getN8nUrl() {
return n8nUrl;
}

public void setN8nUrl(String n8nUrl) {
this.n8nUrl = n8nUrl;
}

public String getApiKey() {
return apiKey;
}

public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}

public String getDataIngestionUrl() {
return dataIngestionUrl;
}

public void setDataIngestionUrl(String dataIngestionUrl) {
this.dataIngestionUrl = dataIngestionUrl;
}

public String getDashboardUrl() {
return dashboardUrl;
}

public void setDashboardUrl(String dashboardUrl) {
this.dashboardUrl = dashboardUrl;
}

public N8NImportInfo getCreatedImportInfo() {
return createdImportInfo;
}

public void setCreatedImportInfo(N8NImportInfo createdImportInfo) {
this.createdImportInfo = createdImportInfo;
}
}
27 changes: 27 additions & 0 deletions apps/dashboard/src/main/resources/struts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3143,6 +3143,33 @@
</result>
</action>

<action name="api/initiateN8NImport" class="com.akto.action.N8NImportAction" method="initiateN8NImport">
<interceptor-ref name="json"/>
<interceptor-ref name="defaultStack" />
<interceptor-ref name="roleAccessInterceptor">
<param name="featureLabel">INTEGRATIONS</param>
<param name="accessType">READ_WRITE</param>
<param name="actionDescription">User started N8N Import</param>
</interceptor-ref>
<result name="FORBIDDEN" type="json">
<param name="statusCode">403</param>
<param name="ignoreHierarchy">false</param>
<param name="includeProperties">^actionErrors.*</param>
</result>
<result name="SUCCESS" type="json">
</result>
<result name="ERROR" type="json">
<param name="statusCode">422</param>
<param name="ignoreHierarchy">false</param>
<param name="includeProperties">^actionErrors.*</param>
</result>
<result name="UNAUTHORIZED" type="json">
<param name="statusCode">403</param>
<param name="ignoreHierarchy">false</param>
<param name="includeProperties">^actionErrors.*</param>
</result>
</action>

<action name="api/initiateMCPRecon" class="com.akto.action.MCPReconAction" method="initiateMCPRecon">
<interceptor-ref name="json"/>
<interceptor-ref name="defaultStack" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ const api = {
})
},

initiateN8NImport(n8nUrl, apiKey, dataIngestionUrl, dashboardUrl) {
return request({
url: '/api/initiateN8NImport',
method: 'post',
data: {n8nUrl, apiKey, dataIngestionUrl, dashboardUrl}
})
},

}

export default api
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { Box, Button, ButtonGroup, Divider, Text, TextField, VerticalStack } from '@shopify/polaris';
import React, { useState } from 'react'
import api from '../api';
import func from "@/util/func";
import PasswordTextField from '../../../components/layouts/PasswordTextField';

const N8NImport = () => {
const [loading, setLoading] = useState(false)
const [apiKey, setApiKey] = useState('')
const [n8nUrl, setN8nUrl] = useState('')
const [dataIngestionUrl, setDataIngestionUrl] = useState('')

const goToDocs = () => {
window.open("https://docs.akto.io/n8n-import")
}

const primaryAction = () => {
if(n8nUrl?.length == 0 || n8nUrl == undefined) {
func.setToast(true, true, "Please enter a valid N8N URL.")
return
}

if(dataIngestionUrl?.length == 0 || dataIngestionUrl == undefined) {
func.setToast(true, true, "Please enter a valid Data Ingestion Service URL.")
return
}

if(apiKey?.length == 0 || apiKey == undefined) {
func.setToast(true, true, "Please enter a valid API Key.")
return
}

setLoading(true)
api.initiateN8NImport(n8nUrl, apiKey, dataIngestionUrl, window.location.origin).then((res) => {
func.setToast(true, false, "N8N Import initiated successfully. Please check your dashboard for updates.")
}).catch((err) => {
console.error("Error initiating N8N import:", err)
func.setToast(true, true, "Ensure that you have added the correct N8N URL and API Key.")
}).finally(() => {
setLoading(false)
setN8nUrl('')
setApiKey('')
setDataIngestionUrl('')
})
}

return (
<div className='card-items'>
<Text variant='bodyMd'>
Use our N8N Import feature to capture traffic and instantly send it to your dashboard for real-time insights.
</Text>

<Box paddingBlockStart={3}><Divider /></Box>

<VerticalStack gap="2">
<TextField
label="N8N URL"
value={n8nUrl}
type='url'
onChange={(value) => setN8nUrl(value)}
placeholder='https://n8n.example.com'
/>

<PasswordTextField
label="N8N API Key"
setField={setApiKey}
onFunc={true}
field={apiKey}
placeholder='*******'
/>

<TextField
label="URL for Data Ingestion Service"
value={dataIngestionUrl}
type='url'
onChange={(value) => setDataIngestionUrl(value)}
placeholder='https://ingestion.example.com'
/>

<ButtonGroup>
<Button
onClick={primaryAction}
primary
disabled={n8nUrl?.length == 0 || dataIngestionUrl?.length == 0 || apiKey?.length == 0}
loading={loading}
>
Import
</Button>
<Button onClick={goToDocs}>Go to docs</Button>
</ButtonGroup>
</VerticalStack>
</div>
)
}

export default N8NImport
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import McpGateway from "./McpGateway"
import AIAgentsGateway from "./AIAgentsGateway"
import ImpervaImport from "./components/ImpervaImport"
import BrowserExtension from "./components/BrowserExtension"
import N8NImport from "./components/N8NImport"

const mirroringObj = {
icon: '/public/aws.svg',
Expand Down Expand Up @@ -859,6 +860,15 @@ const safariExtensionObj = {
key: "SAFARI_BROWSER_EXTENSION",
}

const n8nImportObj = {
icon: '/public/n8n.svg',
label: "N8N Import",
text: "Use our N8N Import feature to capture traffic and instantly send it to your dashboard for real-time insights.",
docsUrl: 'https://docs.akto.io/n8n-import',
key: "N8N_IMPORT",
component: <N8NImport/>
}


const quick_start_policy_lines= [
`{`,
Expand Down Expand Up @@ -1459,7 +1469,7 @@ const quickStartFunc = {
]

const aiAgentConnectors = [
awsBedrockObj, azureAIFoundryObj, databricksObj, googleVertexAIObj, ibmWatsonxObj, customAgentObj, agenticShieldObj
awsBedrockObj, azureAIFoundryObj, databricksObj, googleVertexAIObj, ibmWatsonxObj, customAgentObj, agenticShieldObj, n8nImportObj
]

// MCP Scan
Expand Down Expand Up @@ -1532,13 +1542,13 @@ const quickStartFunc = {
getConnectorsList: function () {

if(func.checkLocal() || func.isLimitedAccount()){
return [burpObj, postmanObj, openApiObj, harFileUploadObj, impervaImportObj]
return [burpObj, postmanObj, openApiObj, harFileUploadObj, impervaImportObj, n8nImportObj]
}

// Combine all categories into connectorsList
let connectorsList = [
gcpObj, kubernetesObj, fargateObj, nginxObj, burpObj, postmanObj,
openApiObj, beanStalkObj, eksObj, dockerObj, envoyObj, mcpScanObj, mcpProxyObj, mcpGateway, mcpWrapperObj, impervaImportObj,
openApiObj, beanStalkObj, eksObj, dockerObj, envoyObj, mcpScanObj, mcpProxyObj, mcpGateway, mcpWrapperObj, impervaImportObj, n8nImportObj,
harFileUploadObj, kongObj, tcpObj, mirroringObj, hybridSaasObj, apiInventoryFromSourceCodeObj,
ebpfObj, ebpfMTLSObj, istioObj, pythonObj, awsApiGatewayObj, awsLambdaObj,
apigeeObj, iisObj, azureObj, cloudflareObj, f5Obj, goObj, haproxyObj, javaObj, kongmeshObj, layer7Obj, nodejsObj, openshiftObj, threescaleObj, githubObj, gitlabObj, bitbucketObj, aktoJaxObj,
Expand Down
13 changes: 13 additions & 0 deletions apps/dashboard/web/public/n8n.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading