Skip to content

Commit

Permalink
Merge pull request #82 from 4urcloud/dev
Browse files Browse the repository at this point in the history
feat: multi-config + azure ml + script init
  • Loading branch information
aeppling authored Nov 29, 2023
2 parents 3ea1687 + 0b4c7c2 commit 0adf4f2
Show file tree
Hide file tree
Showing 57 changed files with 13,326 additions and 9,781 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ build/*
*.js
.idea
config/default.json
config/Config.d.ts
build
Kexa/rules/aws-tests.yaml
config_kuber
eastern-rider-263712-9376010a1184.json
config/addOnNeed.json
config/headers.json
config_kuber
config/resources*.html
config/resources*.json
output/*
271 changes: 271 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,274 @@ Kexa/services/updateCapability.service.ts was changed
package.json was changed


## 1.8.0-SNAPSHOT.53.56373d8

### Files added: 0

### Files changed: 10

Kexa/rules/Deployement.yaml was changed

Kexa/rules/Economy.yaml was changed

Kexa/rules/HTTPRules.yaml was changed

Kexa/rules/OperationalExcellence.yaml was changed

Kexa/rules/Performance.yaml was changed

Kexa/rules/PostDeployement.yaml was changed

Kexa/rules/PreDeployement.yaml was changed

Kexa/rules/Security.yaml was changed

Kexa/rules/driveRules.yaml was changed

Kexa/rules/rules-testing.yaml was changed


## 1.8.0-SNAPSHOT.55.c3f6d1b

### Files added: 0

### Files changed: 1

README.md was changed


## 1.8.0-SNAPSHOT.58.885a664

### Files added: 0

### Files changed: 6

Kexa/rules/Economy.yaml was changed

Kexa/rules/OperationalExcellence.yaml was changed

Kexa/rules/Performance.yaml was changed

Kexa/rules/Security.yaml was changed

Kexa/rules/rules-testing.yaml was changed

README.md was changed


## 1.8.0-SNAPSHOT.61.b5ef343

### Files added: 1

images/schema-engine.png was added

### Files changed: 2

images/schema-engine.png was changed

documentation/Documentation-Kexa.md was changed


## 1.8.0-SNAPSHOT.67.e122e26

### Files added: 0

### Files changed: 14

.gitignore was changed

Kexa/emails/emails.ts was changed

Kexa/helpers/files.ts was changed

Kexa/main.ts was changed

Kexa/models/resultScan.models.ts was changed

Kexa/models/settingFile/rules.models.ts was changed

Kexa/rules/Deployement.yaml was changed

Kexa/services/alerte.service.ts was changed

Kexa/services/analyse.service.ts was changed

Kexa/services/display.service.ts was changed

README.md was changed

config/default.json was changed

documentation/Documentation-Kexa.md was changed

package.json was changed


## 1.8.0-SNAPSHOT.69.12ed96c

### Files added: 0

### Files changed: 8

Kexa/services/addOn/awsGathering.service.ts was changed

Kexa/services/addOn/azureGathering.service.ts was changed

Kexa/services/addOn/gcpGathering.service.ts was changed

Kexa/services/addOn/githubGathering.service.ts was changed

Kexa/services/addOn/googleDriveGathering.service.ts was changed

Kexa/services/addOn/googleWorkspaceGathering.service.ts was changed

Kexa/services/addOn/kubernetesGathering.service.ts was changed

Kexa/services/addOn/o365Gathering.service.ts was changed


## 1.8.0-SNAPSHOT.76.2e20887

### Files added: 0

### Files changed: 1

Kexa/services/addOn/o365Gathering.service.ts was changed


## 1.8.0-SNAPSHOT.80.a324899

### Files added: 0

### Files changed: 2

README.md was changed

documentation/Documentation-Kexa.md was changed


## 1.8.0-SNAPSHOT.91.b5c4d86

### Files added: 0

### Files changed: 3

Kexa/services/analyse.service.ts was changed

config/env/office365.json was changed

documentation/Documentation-Kexa.md was changed


## 1.8.0-SNAPSHOT.93.aa30113

### Files added: 1

config/default.json was added

### Files changed: 1

config/default.json was changed


## 1.8.0-SNAPSHOT.98.874b280

### Files added: 0

### Files changed: 5

Kexa/models/azure/resource.models.ts was changed

Kexa/rules/OperationalExcellence.yaml was changed

Kexa/services/addOn/azureGathering.service.ts was changed

package-lock.json was changed

package.json was changed


## 1.8.0-SNAPSHOT.100.29206c4

### Files added: 0

### Files changed: 1

README.md was changed


## 1.8.0-SNAPSHOT.102.b8694e9

### Files added: 0

### Files changed: 3

.gitignore was changed

documentation/Documentation-Kexa.md was changed


## 1.8.0-SNAPSHOT.109.96001d8

### Files added: 10

Kexa/rules/rulesByProvider/awsSetRules.yaml was added

Kexa/rules/rulesByProvider/azureSetRules.yaml was added

Kexa/rules/rulesByProvider/gcpSetRules.yaml was added

Kexa/rules/rulesByProvider/githubSetRules.yaml was added

Kexa/rules/rulesByProvider/googleDriveSetRules.yaml was added

Kexa/rules/rulesByProvider/googleWorkspaceSetRules.yaml was added

Kexa/rules/rulesByProvider/httpSetRules.yaml was added

Kexa/rules/rulesByProvider/kubernetesSetRules.yaml was added

Kexa/rules/rulesByProvider/o365SetRules.yaml was added

initKexa.ps1 was added

### Files changed: 14

Kexa/rules/rulesByProvider/awsSetRules.yaml was changed

Kexa/rules/rulesByProvider/azureSetRules.yaml was changed

Kexa/rules/rulesByProvider/gcpSetRules.yaml was changed

Kexa/rules/rulesByProvider/githubSetRules.yaml was changed

Kexa/rules/rulesByProvider/googleDriveSetRules.yaml was changed

Kexa/rules/rulesByProvider/googleWorkspaceSetRules.yaml was changed

Kexa/rules/rulesByProvider/httpSetRules.yaml was changed

Kexa/rules/rulesByProvider/kubernetesSetRules.yaml was changed

Kexa/rules/rulesByProvider/o365SetRules.yaml was changed

initKexa.ps1 was changed

Kexa/services/analyse.service.ts was changed

README.md was changed

config/default.json was changed

documentation/Documentation-Kexa.md was changed


## 1.8.0-SNAPSHOT.111.ef2090d

### Files added: 0

### Files changed: 1

initKexa.ps1 was changed


12 changes: 10 additions & 2 deletions Kexa/emails/emails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const Emails = {
<![endif]--></div>
</html>`
},
GlobalAlert : (receiver:string, compteError: number[], allScanRenderTable: string, alert: GlobalConfigAlert) => {return `<!doctype html>
GlobalAlert : (receiver:string, compteError: number[], allScanRenderTable: string, allScanLoudRenderTable: string, alert: GlobalConfigAlert) => {return `<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
Expand Down Expand Up @@ -313,6 +313,10 @@ export const Emails = {
</tr>
`+
allScanRenderTable
+
((allScanLoudRenderTable.length>30)?'<tr><td><h3>Loud rules section :</h3></td></tr>':'')
+
allScanLoudRenderTable
+`
<tr><td style="word-break:break-word;font-size:0px;padding:0px;" align="left"><div style="cursor:auto;color:#747F8D;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;line-height:16px;text-align:left;">
<p style="direction:ltr;;padding:20px 0;text-align:center">Thank you, for using Kexa</p>
Expand Down Expand Up @@ -342,7 +346,7 @@ export const Emails = {
<![endif]--></div>
</html>`
},
Recap : (compteError: number[], allScanRenderTable: string, alert: GlobalConfigAlert) => {return `<!doctype html>
Recap : (compteError: number[], allScanRenderTable: string, allScanLoudRenderTable: string, alert: GlobalConfigAlert) => {return `<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
Expand Down Expand Up @@ -479,6 +483,10 @@ export const Emails = {
</tr>
`+
allScanRenderTable
+
((allScanLoudRenderTable.length>30)?'<tr><td><h3>Loud rules section :</h3></td></tr>':'')
+
allScanLoudRenderTable
+`
<tr><td style="word-break:break-word;font-size:0px;padding:0px;" align="left"><div style="cursor:auto;color:#747F8D;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;line-height:16px;text-align:left;">
<p style="direction:ltr;;padding:20px 0;text-align:center">Thank you, for using Kexa</p>
Expand Down
28 changes: 18 additions & 10 deletions Kexa/helpers/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,27 @@ export function getFile(filePath: string){
}
}

export function writeFileSync(data: string, filePath:string):boolean{
export function createFileSync(data:string, filePath:string, jsonData:boolean=false): boolean{
try{
const fileExists = fs.existsSync(filePath);
logger.debug("File exists: " + fileExists);
if(!fileExists){
logger.debug("Creating file: " + filePath);
fs.writeFileSync(filePath, "");
}
logger.debug("Writing data to file: " + filePath);
fs.writeFileSync(filePath, data);
let pathFolder = filePath.split("/").slice(0, -1).join("/");
createFolderIfNotExists(pathFolder);
logger.debug("Writing data to file in "+ (jsonData)?'JSON':'RAW' +": " + filePath);
fs.writeFileSync(filePath, (jsonData)?JSON.stringify(JSON.parse(data), null, 4):data);
return true;
}catch(error){
logger.error(error);
logger.debug(error);
return false;
}
}

function createFolderIfNotExists(filePath:string): boolean{
try{
fs.mkdirSync(filePath, { recursive: true });
logger.debug("Folder created: " + filePath);
return true;
}catch(error){
logger.debug(error);
return false;
}

}
Loading

0 comments on commit 0adf4f2

Please sign in to comment.