diff --git a/src/containers/DefaultContainer.vue b/src/containers/DefaultContainer.vue index 9b67884ba..27fd69019 100644 --- a/src/containers/DefaultContainer.vue +++ b/src/containers/DefaultContainer.vue @@ -117,7 +117,10 @@ export default { element: '', attributes: {}, }, - permission: permissions.VIEW_VULNERABILITY, + permissions: [ + permissions.VIEW_VULNERABILITY, + permissions.VIEW_POLICY_VIOLATION, + ], }, { name: this.$t('message.vulnerability_audit'), @@ -125,6 +128,12 @@ export default { icon: 'fa fa-tasks', permission: permissions.VIEW_VULNERABILITY, }, + { + name: this.$t('message.policy_violation_audit'), + url: '/policyViolationAudit', + icon: 'fa fa-fire', + permission: permissions.VIEW_POLICY_VIOLATION, + }, { title: true, name: this.$t('message.administration'), @@ -233,8 +242,12 @@ export default { let array = []; for (const item of this.nav) { if ( - item.permission !== null && - permissions.hasPermission(item.permission, decodedToken) + (item.permission !== null && + permissions.hasPermission(item.permission, decodedToken)) || + (Object.prototype.hasOwnProperty.call(item, 'permissions') && + item.permissions.some((permission) => + permissions.hasPermission(permission, decodedToken), + )) ) { array.push(item); } diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 262714d90..279869c09 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -695,6 +695,7 @@ "policy_deleted": "Richtlinie gelöscht", "policy_management": "Richtlinienverwaltung", "policy_name": "Versicherungsname", + "policy_violation_audit": "Richtlinienverstoß-Audit", "policy_violations": "Richtlinienverstöße", "policy_violations_by_classification": "Richtlinienverletzungen nach Klassifizierung", "policy_violations_by_state": "Richtlinienverstöße nach Status", diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index e87800cbf..5683ada03 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -695,6 +695,7 @@ "policy_deleted": "Policy deleted", "policy_management": "Policy Management", "policy_name": "Policy Name", + "policy_violation_audit": "Policy Violation Audit", "policy_violations": "Policy Violations", "policy_violations_by_classification": "Policy Violations by Classification", "policy_violations_by_state": "Policy Violations by State", diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 427feda69..45f0867a7 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -695,6 +695,7 @@ "policy_deleted": "Política eliminada", "policy_management": "Gestión de políticas", "policy_name": "Nombre de directiva", + "policy_violation_audit": "Auditoría de violaciones de políticas", "policy_violations": "Violaciones de políticas", "policy_violations_by_classification": "Violaciones de políticas por clasificación", "policy_violations_by_state": "Violaciones de políticas por estado", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 9e3075cf3..9073bc763 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -695,6 +695,7 @@ "policy_deleted": "Politique supprimée", "policy_management": "Gestion des politiques", "policy_name": "Nom de la politique", + "policy_violation_audit": "Audit des violations des politiques", "policy_violations": "Violations de politiques", "policy_violations_by_classification": "Violations de politiques par classification", "policy_violations_by_state": "Violations de politiques par État", diff --git a/src/i18n/locales/hi.json b/src/i18n/locales/hi.json index 389f584e9..f360f9d08 100644 --- a/src/i18n/locales/hi.json +++ b/src/i18n/locales/hi.json @@ -695,6 +695,7 @@ "policy_deleted": "नीति हटा दी गई", "policy_management": "नीति प्रबंधन", "policy_name": "पालिसी का नाम", + "policy_violation_audit": "नीति उल्लंघन ऑडिट", "policy_violations": "नीति उल्लंघन", "policy_violations_by_classification": "वर्गीकरण के अनुसार नीति उल्लंघन", "policy_violations_by_state": "राज्यवार नीति उल्लंघन", diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 2ed1d6c2b..1b3cb263e 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -695,6 +695,7 @@ "policy_deleted": "Politica eliminata", "policy_management": "Gestione delle politiche", "policy_name": "Nome della politica", + "policy_violation_audit": "Controllo della violazione delle policy", "policy_violations": "Violazioni delle norme", "policy_violations_by_classification": "Violazioni delle policy per classificazione", "policy_violations_by_state": "Violazioni delle politiche da parte dello Stato", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index c09d8e932..f4f05bd82 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -695,6 +695,7 @@ "policy_deleted": "ポリシーを削除しました", "policy_management": "ポリシー管理", "policy_name": "ポリシー名", + "policy_violation_audit": "ポリシー違反の監査", "policy_violations": "ポリシー違反", "policy_violations_by_classification": "分類別のポリシー違反", "policy_violations_by_state": "州別のポリシー違反", diff --git a/src/i18n/locales/pl.json b/src/i18n/locales/pl.json index be207393f..2bac27747 100644 --- a/src/i18n/locales/pl.json +++ b/src/i18n/locales/pl.json @@ -695,6 +695,7 @@ "policy_deleted": "Polityka została usunięta", "policy_management": "Zarządzanie polityką", "policy_name": "Nazwa zasady", + "policy_violation_audit": "Audyt naruszeń zasad", "policy_violations": "Naruszenia zasad", "policy_violations_by_classification": "Naruszenia zasad według klasyfikacji", "policy_violations_by_state": "Naruszenia zasad według stanu", diff --git a/src/i18n/locales/pt-BR.json b/src/i18n/locales/pt-BR.json index 39cccd72b..65ad9c2df 100644 --- a/src/i18n/locales/pt-BR.json +++ b/src/i18n/locales/pt-BR.json @@ -695,6 +695,7 @@ "policy_deleted": "Política excluída", "policy_management": "Gerenciamento de Políticas", "policy_name": "Nome da política", + "policy_violation_audit": "Auditoria de violação de política", "policy_violations": "Violações de política", "policy_violations_by_classification": "Violações de política por classificação", "policy_violations_by_state": "Violações de políticas por estado", diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index 006091353..637b6c872 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -695,6 +695,7 @@ "policy_deleted": "Política excluída", "policy_management": "Gerenciamento de Políticas", "policy_name": "Nome da política", + "policy_violation_audit": "Auditoria de violação de políticas", "policy_violations": "Violações de política", "policy_violations_by_classification": "Violações de política por classificação", "policy_violations_by_state": "Violações de políticas por estado", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 1213d4d3c..352a50609 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -695,6 +695,7 @@ "policy_deleted": "Политика удалена.", "policy_management": "Управление политиками", "policy_name": "Имя политики", + "policy_violation_audit": "Аудит нарушений политики", "policy_violations": "Нарушения политики", "policy_violations_by_classification": "Нарушения политики по классификации", "policy_violations_by_state": "Нарушения политики государством", diff --git a/src/i18n/locales/uk-UA.json b/src/i18n/locales/uk-UA.json index 6b9c8f81b..ea53b12a5 100644 --- a/src/i18n/locales/uk-UA.json +++ b/src/i18n/locales/uk-UA.json @@ -695,6 +695,7 @@ "policy_deleted": "Політику видалено", "policy_management": "Управління політикою", "policy_name": "Назва політики", + "policy_violation_audit": "Аудит порушень політики", "policy_violations": "Порушення політики", "policy_violations_by_classification": "Порушення політики за класифікацією", "policy_violations_by_state": "Порушення політики державою", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 4d7182d2c..06bcfc041 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -695,6 +695,7 @@ "policy_deleted": "策略已删除", "policy_management": "策略管理", "policy_name": "策略名称", + "policy_violation_audit": "政策违规审计", "policy_violations": "违反策略", "policy_violations_by_classification": "违反策略的分类", "policy_violations_by_state": "违反策略的情况", diff --git a/src/router/index.js b/src/router/index.js index 3f66346dc..68b299c55 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -22,6 +22,8 @@ const LicenseList = () => import('@/views/portfolio/licenses/LicenseList'); const PolicyManagement = () => import('@/views/policy/PolicyManagement'); const Project = () => import('@/views/portfolio/projects/Project'); +const PolicyViolationAudit = () => import('@/views/audit/PolicyViolationAudit'); + const Administration = () => import('@/views/administration/Administration'); const General = () => import('@/views/administration/configuration/General'); const BomFormats = () => @@ -318,6 +320,16 @@ function configRoutes() { permission: 'POLICY_MANAGEMENT', }, }, + { + path: 'policyViolationAudit', + component: PolicyViolationAudit, + meta: { + title: i18n.t('message.policy_violation_audit'), + i18n: 'message.policy_violation_audit', + sectionPath: '/audit', + permission: 'VIEW_POLICY_VIOLATION', + }, + }, { path: 'admin', component: Administration, diff --git a/src/shared/utils.js b/src/shared/utils.js index f5c30de06..9bad6c62b 100644 --- a/src/shared/utils.js +++ b/src/shared/utils.js @@ -53,6 +53,7 @@ const acceptableRootContextPaths = [ '/vulnerability', '/license', '/vulnerabilityAudit', + '/policyViolationAudit', '/login', '/change-password', ]; diff --git a/src/views/audit/PolicyViolationAudit.vue b/src/views/audit/PolicyViolationAudit.vue new file mode 100644 index 000000000..64918916c --- /dev/null +++ b/src/views/audit/PolicyViolationAudit.vue @@ -0,0 +1,505 @@ + + +