Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@al/aecoral

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@al/aecoral - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

105

dist/commonjs/al-coral-client.js

@@ -73,2 +73,107 @@ "use strict";

/**
* Delete correlation rule
*/
AlCoralClientInstance.prototype.removeCorrelationRule = function (accountId, correlationId) {
return __awaiter(this, void 0, void 0, function () {
var correlation;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, client_1.ALClient.delete({
service_name: this.serviceName,
account_id: accountId,
path: "/correlations/" + correlationId
})];
case 1:
correlation = _a.sent();
return [2 /*return*/, correlation];
}
});
});
};
/**
* Get correlation rule by ID
*/
AlCoralClientInstance.prototype.getCorrelationRule = function (accountId, correlationId) {
return __awaiter(this, void 0, void 0, function () {
var correlation;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, client_1.ALClient.get({
service_name: this.serviceName,
account_id: accountId,
path: "/correlations/" + correlationId,
})];
case 1:
correlation = _a.sent();
return [2 /*return*/, correlation];
}
});
});
};
/**
* Get all correlation rules
*/
AlCoralClientInstance.prototype.getAllCorrelations = function (accountId) {
return __awaiter(this, void 0, void 0, function () {
var correlations;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, client_1.ALClient.get({
service_name: this.serviceName,
account_id: accountId,
path: '/correlations'
})];
case 1:
correlations = _a.sent();
return [2 /*return*/, correlations];
}
});
});
};
/**
* Update correlation rule
*/
AlCoralClientInstance.prototype.updateCorrelationRule = function (accountId, correlationId, correlation) {
return __awaiter(this, void 0, void 0, function () {
var correlationResult;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, client_1.ALClient.post({
service_name: this.serviceName,
account_id: accountId,
path: "/correlations/" + correlationId,
data: correlation
})];
case 1:
correlationResult = _a.sent();
if (!correlationResult.hasOwnProperty("correlation_id")) {
throw new common_1.AlResponseValidationError("Service returned unexpected result; missing 'correlation_id' property.");
}
return [2 /*return*/, correlationResult.correlation_id];
}
});
});
};
/**
* It tests the validity of an input or in a debugging capacity to see what content aecoral would generate for a given input.
*/
AlCoralClientInstance.prototype.validateCorrelationPolicy = function (accountId, correlation) {
return __awaiter(this, void 0, void 0, function () {
var validation;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, client_1.ALClient.post({
service_name: this.serviceName,
account_id: accountId,
path: '/validations/correlations',
data: correlation
})];
case 1:
validation = _a.sent();
return [2 /*return*/, validation];
}
});
});
};
/**
* Get possible correlation incident severities and classifications.

@@ -75,0 +180,0 @@ */

70

dist/typings/al-coral-client.d.ts

@@ -17,2 +17,13 @@ export interface AlCreateCorrelationNotificationOnlyRequest {

}
export interface AlCreateIncidentsFromCorrelationRequest extends AlCreateCorrelationNotificationOnlyRequest {
observation?: AlIncidentDefinition;
}
export interface AlCorrelationRule {
attacker_field: string;
enabled: boolean;
expression: string;
expression_window: string;
name: string;
victim_field: string;
}
export interface AlIncidentSpecificationResponse {

@@ -25,2 +36,39 @@ severities: string[];

}
export interface AlCorrelationValidationResponse {
agg_select_params: string[];
artifact_name: string;
attacker_field: string;
elab_search: {
omitted: string;
};
enabled: boolean;
expression: {
omitted: string;
};
expression_window: string;
incident: AlIncidentDefinition;
name: string;
nonagg_select_params: string[];
notification: {
filter: {
something: boolean;
};
name: string;
};
notification_keys: string[];
object_name: string;
object_summary: string;
observation_def: {
omitted: string;
};
original_expression: string;
rta: {
omitted: string;
};
trigger: {
omitted: string;
};
unique: string;
victim_field: string;
}
export declare class AlCoralClientInstance {

@@ -31,4 +79,24 @@ private serviceName;

*/
createCorrelationRule(accountId: string, correlationRequest: AlCreateCorrelationNotificationOnlyRequest): Promise<string>;
createCorrelationRule(accountId: string, correlationRequest: AlCreateIncidentsFromCorrelationRequest | AlCreateCorrelationNotificationOnlyRequest): Promise<string>;
/**
* Delete correlation rule
*/
removeCorrelationRule(accountId: string, correlationId: string): Promise<any>;
/**
* Get correlation rule by ID
*/
getCorrelationRule(accountId: string, correlationId: string): Promise<AlCorrelationRule>;
/**
* Get all correlation rules
*/
getAllCorrelations(accountId: string): Promise<AlCorrelationRule[]>;
/**
* Update correlation rule
*/
updateCorrelationRule(accountId: string, correlationId: string, correlation: AlCreateIncidentsFromCorrelationRequest): Promise<string>;
/**
* It tests the validity of an input or in a debugging capacity to see what content aecoral would generate for a given input.
*/
validateCorrelationPolicy(accountId: string, correlation: AlCreateIncidentsFromCorrelationRequest): Promise<AlCorrelationValidationResponse>;
/**
* Get possible correlation incident severities and classifications.

@@ -35,0 +103,0 @@ */

2

dist/umd/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.coralClient=t():e.coralClient=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=require("@al/common")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,c)}a((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),u=n(3),c=function(){function e(){this.serviceName="aecoral"}return e.prototype.createCorrelationRule=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return[4,u.ALClient.post({service_name:this.serviceName,account_id:e,path:"/correlations",data:t})];case 1:if(!(n=r.sent()).hasOwnProperty("correlation_id"))throw new i.AlResponseValidationError("Service returned unexpected result; missing 'correlation_id' property.");return[2,n.correlation_id]}}))}))},e.prototype.getIncidentSpecifications=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,u.ALClient.get({service_name:this.serviceName,account_id:e,path:"/incident_spec"})];case 1:return[2,t.sent()]}}))}))},e}();t.AlCoralClientInstance=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1);!function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(1)),t.AlCoralClient=r.AlGlobalizer.instantiate("AlCoralClient",(function(){return new o.AlCoralClientInstance}))},function(e,t){e.exports=require("@al/client")}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.coralClient=t():e.coralClient=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=require("@al/common")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(3),a=function(){function e(){this.serviceName="aecoral"}return e.prototype.createCorrelationRule=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return[4,c.ALClient.post({service_name:this.serviceName,account_id:e,path:"/correlations",data:t})];case 1:if(!(n=r.sent()).hasOwnProperty("correlation_id"))throw new i.AlResponseValidationError("Service returned unexpected result; missing 'correlation_id' property.");return[2,n.correlation_id]}}))}))},e.prototype.removeCorrelationRule=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,c.ALClient.delete({service_name:this.serviceName,account_id:e,path:"/correlations/"+t})];case 1:return[2,n.sent()]}}))}))},e.prototype.getCorrelationRule=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,c.ALClient.get({service_name:this.serviceName,account_id:e,path:"/correlations/"+t})];case 1:return[2,n.sent()]}}))}))},e.prototype.getAllCorrelations=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,c.ALClient.get({service_name:this.serviceName,account_id:e,path:"/correlations"})];case 1:return[2,t.sent()]}}))}))},e.prototype.updateCorrelationRule=function(e,t,n){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return[4,c.ALClient.post({service_name:this.serviceName,account_id:e,path:"/correlations/"+t,data:n})];case 1:if(!(r=o.sent()).hasOwnProperty("correlation_id"))throw new i.AlResponseValidationError("Service returned unexpected result; missing 'correlation_id' property.");return[2,r.correlation_id]}}))}))},e.prototype.validateCorrelationPolicy=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,c.ALClient.post({service_name:this.serviceName,account_id:e,path:"/validations/correlations",data:t})];case 1:return[2,n.sent()]}}))}))},e.prototype.getIncidentSpecifications=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,c.ALClient.get({service_name:this.serviceName,account_id:e,path:"/incident_spec"})];case 1:return[2,t.sent()]}}))}))},e}();t.AlCoralClientInstance=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(1);!function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(1)),t.AlCoralClient=r.AlGlobalizer.instantiate("AlCoralClient",(function(){return new o.AlCoralClientInstance}))},function(e,t){e.exports=require("@al/client")}])}));
{
"name": "@al/aecoral",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A client for interacting with the Alert Logic Analytics Engine Correlations Public API",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc