Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Audit View: Policy Violations #772

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/containers/DefaultContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
ProfileEditModal,
SnapshotModal,
AppSidebar,
AppAside,

Check failure on line 50 in src/containers/DefaultContainer.vue

View workflow job for this annotation

GitHub Actions / lint

The "AppAside" component has been registered but not used
Breadcrumb,
DefaultHeaderProfileDropdown,

Check failure on line 52 in src/containers/DefaultContainer.vue

View workflow job for this annotation

GitHub Actions / lint

The "DefaultHeaderProfileDropdown" component has been registered but not used
SidebarForm,
SidebarFooter,
SidebarHeader,
Expand Down Expand Up @@ -117,14 +117,23 @@
element: '',
attributes: {},
},
permission: permissions.VIEW_VULNERABILITY,
permissions: [
permissions.VIEW_VULNERABILITY,
permissions.VIEW_POLICY_VIOLATION,
],
},
{
name: this.$t('message.vulnerability_audit'),
url: '/vulnerabilityAudit',
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'),
Expand Down Expand Up @@ -233,8 +242,12 @@
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);
}
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@
"policy_deleted": "नीति हटा दी गई",
"policy_management": "नीति प्रबंधन",
"policy_name": "पालिसी का नाम",
"policy_violation_audit": "नीति उल्लंघन ऑडिट",
"policy_violations": "नीति उल्लंघन",
"policy_violations_by_classification": "वर्गीकरण के अनुसार नीति उल्लंघन",
"policy_violations_by_state": "राज्यवार नीति उल्लंघन",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@
"policy_deleted": "ポリシーを削除しました",
"policy_management": "ポリシー管理",
"policy_name": "ポリシー名",
"policy_violation_audit": "ポリシー違反の監査",
"policy_violations": "ポリシー違反",
"policy_violations_by_classification": "分類別のポリシー違反",
"policy_violations_by_state": "州別のポリシー違反",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,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",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@
"policy_deleted": "Политика удалена.",
"policy_management": "Управление политиками",
"policy_name": "Имя политики",
"policy_violation_audit": "Аудит нарушений политики",
"policy_violations": "Нарушения политики",
"policy_violations_by_classification": "Нарушения политики по классификации",
"policy_violations_by_state": "Нарушения политики государством",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@
"policy_deleted": "Політику видалено",
"policy_management": "Управління політикою",
"policy_name": "Назва політики",
"policy_violation_audit": "Аудит порушень політики",
"policy_violations": "Порушення політики",
"policy_violations_by_classification": "Порушення політики за класифікацією",
"policy_violations_by_state": "Порушення політики державою",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@
"policy_deleted": "策略已删除",
"policy_management": "策略管理",
"policy_name": "策略名称",
"policy_violation_audit": "政策违规审计",
"policy_violations": "违反策略",
"policy_violations_by_classification": "违反策略的分类",
"policy_violations_by_state": "违反策略的情况",
Expand Down
12 changes: 12 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
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 = () =>
Expand Down Expand Up @@ -318,6 +320,16 @@
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,
Expand Down Expand Up @@ -780,7 +792,7 @@
path: 'project',
props: (route) => ({ uuid: route.query.uuid }),
redirect: (to) => {
let { hash, params, query } = to;

Check failure on line 795 in src/router/index.js

View workflow job for this annotation

GitHub Actions / lint

'hash' is assigned a value but never used

Check failure on line 795 in src/router/index.js

View workflow job for this annotation

GitHub Actions / lint

'params' is assigned a value but never used
if (query.uuid) {
let uuid = query.uuid;
return { path: '/projects/' + uuid, query: null };
Expand All @@ -793,7 +805,7 @@
path: 'component',
props: (route) => ({ uuid: route.query.uuid }),
redirect: (to) => {
let { hash, params, query } = to;

Check failure on line 808 in src/router/index.js

View workflow job for this annotation

GitHub Actions / lint

'hash' is assigned a value but never used

Check failure on line 808 in src/router/index.js

View workflow job for this annotation

GitHub Actions / lint

'params' is assigned a value but never used
if (query.uuid) {
let uuid = query.uuid;
return { path: '/components/' + uuid, query: null };
Expand Down
1 change: 1 addition & 0 deletions src/shared/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const acceptableRootContextPaths = [
'/vulnerability',
'/license',
'/vulnerabilityAudit',
'/policyViolationAudit',
'/login',
'/change-password',
];
Expand Down
Loading
Loading