| 11 | tables: { [policyPack: string]: Table } = {} |
| 12 | |
| 13 | pushData({ |
| 14 | policyPack, |
| 15 | ruleDescription, |
| 16 | results, |
| 17 | }: { |
| 18 | policyPack: string |
| 19 | ruleDescription: string |
| 20 | results: RuleFinding[] |
| 21 | }): void { |
| 22 | for (const { resourceId, id, result } of results) { |
| 23 | const tableName = `${policyPack}-${id}` |
| 24 | if (!this.tables[tableName]) { |
| 25 | this.tables[tableName] = new Table({ style: { head: [], border: [] } }) |
| 26 | this.tables[tableName].push( |
| 27 | [chalk.italic.green(ruleDescription)], |
| 28 | this.tableHeaders |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | const status = this.getStatus(result) |
| 33 | this.tables[tableName].push([resourceId, status]) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | private getStatus(result: string): string { |
| 38 | let status |