Skip to content

Commit

Permalink
add more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmathia committed Oct 30, 2023
1 parent 05e97c7 commit 2145770
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
22 changes: 15 additions & 7 deletions Kexa/services/alerte.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export function alertLogGlobal(alert: GlobalConfigAlert, compteError: number[],
Object.entries(subResult).forEach(([key, value]) => {
context?.log("rule:"+key);
logger.info("rule:"+key);
context?.log("description:"+value[0].rule?.description);
logger.info("description:"+value[0].rule?.description);
context?.log("all resources who not respect the rules:");
logger.info("all resources who not respect the rules:");
value.map((scan:ResultScan) => scan.objectContent).forEach((resource, index) => {
Expand Down Expand Up @@ -231,10 +233,12 @@ export function alertLog(rule: Rules, conditions: SubResultScan[], objectResourc
switch(rule.level){
case LevelEnum.INFO:
if(fullDetail){
context?.log("info:"+rule.name);
logger.error("critical:"+rule.name);
context?.log("info name:"+rule.name);
logger.info("info name:"+rule.name);
context?.log("info description:"+rule?.description);
logger.info("info description:"+rule?.description);
context?.log(sentenceConditionLog(objectResource.id));
logger.error(sentenceConditionLog(objectResource.id));
logger.info(sentenceConditionLog(objectResource.id));
}
logger.debug(jsome.getColoredString(conditions));
context?.log(propertyToSend(rule, objectResource, true));
Expand All @@ -245,8 +249,10 @@ export function alertLog(rule: Rules, conditions: SubResultScan[], objectResourc
break;
case LevelEnum.ERROR:
if(fullDetail){
context?.log("error:"+rule.name);
logger.error("critical:"+rule.name);
context?.log("error name:"+rule.name);
logger.error("error name:"+rule.name);
context?.log("error description:"+rule?.description);
logger.error("error description:"+rule?.description);
context?.log(sentenceConditionLog(objectResource.id));
logger.error(sentenceConditionLog(objectResource.id));
}
Expand All @@ -256,8 +262,10 @@ export function alertLog(rule: Rules, conditions: SubResultScan[], objectResourc
break;
case LevelEnum.FATAL:
if(fullDetail){
context?.log("critical:"+rule.name);
logger.fatal("critical:"+rule.name);
context?.log("critical name:"+rule.name);
logger.fatal("critical name:"+rule.name);
context?.log("critical description:"+rule?.description);
logger.fatal("critical description:"+rule?.description);
context?.log(sentenceConditionLog(objectResource.id));
logger.fatal(sentenceConditionLog(objectResource.id));
}
Expand Down
2 changes: 1 addition & 1 deletion Kexa/services/analyse.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export function checkIncludeNS(condition:RulesConditions, value:any): boolean {
export function checkRegex(condition:RulesConditions, value:any): boolean {
logger.debug("check regex");
if (typeof value == "number") {
if (value.toString().match(condition.value.toString()))
if (RegExp(condition.value.toString()).exec(value.toString()))
return true;
else
return false;
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ If you want explanations and details about rules in Kexa, please refer to [this
# <div align="center" id="roadmap">**Roadmap**</div>
<br/>

<details>
<summary>All Achievements</summary>

- ✅ Setting notification levels
- ✅ Azure check in:
- ✅ virtual machine (vm)
Expand Down Expand Up @@ -468,8 +471,13 @@ If you want explanations and details about rules in Kexa, please refer to [this
- ✅ alert
- ✅ incident
- ✅ app_access_policy
- [ ] VM Ware

</details>

Next step:

- [ ] Kexa SaaS
- [ ] VM Ware
- [ ] OVH
- [ ] Database
- [ ] Postgres
Expand Down
Binary file modified images/Exemple_Scan_Security_html.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2145770

Please sign in to comment.