Skip to content

Commit be681f5

Browse files
Make Interface
1 parent 33aed24 commit be681f5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Sigma_rule_validation_program

-864 Bytes
Binary file not shown.

Sigma_rule_validation_program.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void parse_yaml(const char *filename, Rule *rule) {
185185
}
186186

187187
void print_yaml(const Rule *rule) {
188-
printf("----------- PARSED SIGMA RULE -----------\n");
188+
printf("+--------------------------- PARSED SIGMA RULE ---------------------------+\n");
189189
printf("title: %s\n", rule->title);
190190
printf("id: %s\n", rule->id);
191191
printf("status: %s\n", rule->status);
@@ -210,20 +210,20 @@ void print_yaml(const Rule *rule) {
210210
printf("tags: \n");
211211
for (int i = 0; rule->tags[i].tags[0] != '\0';i++)
212212
printf(" - %s\n", rule->tags[i].tags);
213-
printf("-----------------------------------------\n\n\n");
213+
printf("+--------------------------------------------------------------------------+\n\n\n");
214214
}
215215

216216
void validate_yamllint(const char *filename){
217-
printf("----------- YAMLlint VALIDATION -----------\n\n");
217+
printf("\n\n+--------------------------- YAMLlint VALIDATION --------------------------+\n");
218218
char command[256] = "yamllint ";
219219
strcat(command, filename);
220-
printf("----------------- RESULT ----------------- \n\n");
220+
printf("\n----------------------------------- RESULT ---------------------------------\n\n");
221221
int result = system(command);
222222
if (result != 0){
223223
printf("ERROR: YAMLlint Failed\n\n");
224224
exit(1);
225225
}
226-
printf("------------------------------------------\n\n");
226+
printf("+--------------------------------------------------------------------------+\n\n\n");
227227

228228
}
229229

@@ -476,22 +476,26 @@ void validate_uuid(const char *id) {
476476
}
477477

478478
void validate_sigma(const Rule *rule){
479-
printf("----------- SIGMA RULE VALIDATION -----------\n");
479+
printf("+--------------------------- SIGMA RULE VALIDATION ------------------------+\n\n");
480480
validate_uuid(rule->id);
481481
validate_status(rule->status);
482482
validate_date(rule->date);
483483
validate_logsource(rule->logsource->category);
484484
validate_detection(rule->logsource->category, rule->detection);
485485
validate_level(rule->level);
486-
printf("------------ VALIDATION COMPLETE ------------\n\n\n");
486+
printf("\n+---------------------------- VALIDATION COMPLETE -------------------------+\n\n\n");
487487
}
488488

489489
int main() {
490490
char fname[256];
491491
Rule rule;
492492
memset(&rule, 0, sizeof(rule));
493+
494+
printf("+--------------------------------------------------------------------------+\n");
495+
printf("| SIGMA Rule Validator v1.0 |\n");
496+
printf("+--------------------------------------------------------------------------+\n\n");
493497

494-
printf("SIGMA RULE NAME(.yaml): ");
498+
printf("Enter Sigma file path (.yaml) > ");
495499
if (!fgets(fname, sizeof(fname), stdin)) {
496500
fprintf(stderr, "Failed to read filename\n");
497501
exit(1);

0 commit comments

Comments
 (0)