From 9f41a77b606174e0feac5f7ce332546f93bcb3f0 Mon Sep 17 00:00:00 2001 From: Mark Rivera Date: Wed, 10 Apr 2024 21:41:40 +0000 Subject: [PATCH 1/7] Merge from Internal Repo. Signed-off-by: Mark Rivera --- .gitignore | 1 + Dockerfile | 7 + README.md | 19 +- cert_loc/cert_response.json | 5 + components/BoundaryItems.vue | 465 +++++---- components/CompanyList.vue | 100 +- components/DashBoardItems.vue | 37 +- components/DashBoarditems/Dates.vue | 92 +- components/Export.vue | 325 ++++--- components/Footer.vue | 10 +- components/NavBar.vue | 497 +++++----- components/Override.vue | 653 ++++++++----- components/QuickAdd.vue | 501 ++++++---- components/UserAdmin.vue | 907 +++++++++++------- components/login/LoginFailed.vue | 71 ++ components/login/LoginForm.vue | 212 ++++ .../2023.11.14T04.26.48.EvaluationItems.ts | 2 +- .../2024.02.02T21.20.55.Classification.ts | 5 + .../2024.03.12T20.57.57.StigAliases.ts | 34 + .../2024.03.12T23.10.26.TirAliases.ts | 34 + .../2024.03.13T17.15.25.AssessmentUpdate.ts | 20 + .../2024.03.28T03.47.39.UserUpdate.ts | 133 +++ .../2024.03.28T15.42.10.EvalDates_User.ts | 32 + ...2024.03.28T19.15.44.MilestoneDates_User.ts | 32 + db/models/assessment.ts | 20 +- db/models/assessmentItem.ts | 23 +- db/models/boundary.ts | 12 +- db/models/boundaryRole.ts | 19 +- db/models/cciItem.ts | 14 +- db/models/cciList.ts | 6 +- db/models/cciReferences.ts | 12 +- db/models/classification.ts | 11 +- db/models/evaluation.ts | 21 +- db/models/evaluationItem.ts | 15 +- db/models/index.ts | 70 +- db/models/milestone.ts | 17 +- db/models/override.ts | 8 +- db/models/policyDocument.ts | 7 +- db/models/stig.ts | 14 +- db/models/stigAlias.ts | 49 + db/models/stigData.ts | 31 +- db/models/stigIdent.ts | 6 +- db/models/stigLibrary.ts | 21 +- db/models/stigReference.ts | 23 +- db/models/stigResponsibility.ts | 19 +- db/models/system.ts | 20 +- db/models/theme.ts | 15 +- db/models/tier.ts | 6 +- db/models/tierRole.ts | 22 +- db/models/timezone.ts | 15 +- db/models/tirAlias.ts | 47 + db/models/token.ts | 15 +- db/models/user.ts | 74 +- db/models/userRole.ts | 16 +- db/seeders/2023.11.22T05.09.28.Users.ts | 35 +- .../2024.02.03T01.28.29.Classifications.ts | 28 +- db/seeders/2024.03.12T20.58.29.StigAliases.ts | 29 + db/seeders/2024.03.12T23.10.33.TirAliases.ts | 29 + db/umzug.ts | 2 +- lib/schema/U_Checklist_Schema_V2.xsd | 333 +++++++ lib/schema/XMLSchema.dtd | 0 lib/schema/cci.xsd | 478 ++++----- lib/schema/cpe-language_2.3.xsd | 468 ++++----- lib/schema/cpe-naming_2.3.xsd | 88 +- lib/schema/datatypes.dtd | 0 lib/schema/xccdf_1.2.xsd | 0 lib/schema/xml.xsd | 0 lib/template/checklistv2.xml | 48 + nuxt.config.ts | 17 +- package.json | 16 +- pages/administration/configuration.vue | 419 +++++++- pages/administration/logs.vue | 213 ++-- .../BoundaryView/[enclave]-[StigId].vue | 103 +- .../SystemView/[enclave]-[system].vue | 127 ++- .../SystemView/[system]/[stig].vue | 858 ++++++++++------- .../boundaries/[boundary]id[id]/[details].vue | 215 ++--- .../[boundary]id[id]/[details]/SystemView.vue | 21 +- pages/company-boundaries.vue | 27 +- pages/index.vue | 258 ++--- pages/profile/[username].vue | 10 +- public/favicon.ico | Bin server/api/assessment/create.post.ts | 2 +- server/api/assessment/updateItem.put.ts | 60 +- server/api/auth/currentUser.get.ts | 2 +- server/api/auth/login/ldap.post.ts | 291 ++++++ server/api/auth/login/local.post.ts | 59 ++ server/api/auth/setPW.post.ts | 25 +- server/api/boundaries/alias.get.ts | 6 + server/api/boundaries/alias.put.ts | 28 + .../api/boundaries/changeStigLibrary.post.ts | 7 + server/api/boundaries/ckl2.get.ts | 139 +++ server/api/boundaries/create.post.ts | 50 +- server/api/boundaries/delete.post.ts | 16 +- server/api/boundaries/edit.put.ts | 31 +- .../api/boundaries/findingsDownload.post.ts | 7 +- server/api/boundaries/listRMFVersions.get.ts | 13 +- server/api/boundaries/poamDownload.post.ts | 8 +- server/api/boundaries/summary.get.ts | 13 + server/api/boundaries/users/add.post.ts | 7 +- server/api/boundaries/users/edit.put.ts | 16 +- server/api/boundaries/users/remove.post.ts | 6 + server/api/config/alert.get.ts | 26 +- server/api/config/alert.post.ts | 38 +- server/api/config/logConfig.get.ts | 31 +- server/api/config/logConfig.put.ts | 113 ++- server/api/evaluation/updateItem.put.ts | 132 ++- server/api/import/cci.post.ts | 23 +- server/api/import/cert.post.ts | 110 +++ server/api/import/results.post.ts | 135 ++- server/api/override/delete.post.ts | 14 + server/api/status.get.ts | 3 + server/api/stigLibrary/check.post.ts | 2 +- server/api/stigLibrary/upload.post.ts | 41 +- server/api/systems/create.post.ts | 38 +- server/api/systems/delete.post.ts | 57 +- server/api/systems/stig/add.post.ts | 49 +- server/api/systems/stig/list.post.ts | 39 +- server/api/systems/stig/remove.post.ts | 70 +- server/api/tiers/create.post.ts | 50 +- server/api/tiers/edit.put.ts | 41 +- server/api/tiers/remove.post.ts | 13 +- server/api/tiers/users/add.post.ts | 7 +- server/api/tiers/users/edit.put.ts | 10 +- server/api/tiers/users/remove.post.ts | 6 + server/api/users/checkAlert.get.ts | 186 ++++ server/api/users/create.post.ts | 20 +- server/api/users/delete.post.ts | 4 + server/api/users/edit.put.ts | 73 +- server/api/users/token/create.post.ts | 7 +- server/api/users/token/token.delete.ts | 4 + server/utils/assessments.ts | 79 ++ server/utils/checklist.ts | 422 ++++++-- server/utils/evaluations.ts | 4 + server/utils/excelExport/findingsSheet.ts | 19 + server/utils/excelExport/poamExport.ts | 34 +- server/utils/findings.ts | 3 + server/utils/hash.ts | 73 +- server/utils/importStig.ts | 87 +- server/utils/importStigData.ts | 277 +++--- server/utils/logger.ts | 59 +- server/utils/processLibrary.ts | 183 ---- server/utils/stigLibrary.ts | 291 ++++++ server/utils/xccdf.ts | 46 +- server/utils/zip.ts | 20 + 144 files changed, 8587 insertions(+), 3802 deletions(-) create mode 100644 Dockerfile create mode 100644 cert_loc/cert_response.json create mode 100644 components/login/LoginFailed.vue create mode 100644 components/login/LoginForm.vue create mode 100644 db/migrations/2024.03.12T20.57.57.StigAliases.ts create mode 100644 db/migrations/2024.03.12T23.10.26.TirAliases.ts create mode 100644 db/migrations/2024.03.13T17.15.25.AssessmentUpdate.ts create mode 100644 db/migrations/2024.03.28T03.47.39.UserUpdate.ts create mode 100644 db/migrations/2024.03.28T15.42.10.EvalDates_User.ts create mode 100644 db/migrations/2024.03.28T19.15.44.MilestoneDates_User.ts create mode 100644 db/models/stigAlias.ts create mode 100644 db/models/tirAlias.ts create mode 100644 db/seeders/2024.03.12T20.58.29.StigAliases.ts create mode 100644 db/seeders/2024.03.12T23.10.33.TirAliases.ts create mode 100644 lib/schema/U_Checklist_Schema_V2.xsd mode change 100644 => 100755 lib/schema/XMLSchema.dtd mode change 100644 => 100755 lib/schema/cci.xsd mode change 100644 => 100755 lib/schema/cpe-language_2.3.xsd mode change 100644 => 100755 lib/schema/datatypes.dtd mode change 100644 => 100755 lib/schema/xccdf_1.2.xsd mode change 100644 => 100755 lib/schema/xml.xsd create mode 100644 lib/template/checklistv2.xml mode change 100644 => 100755 public/favicon.ico create mode 100644 server/api/auth/login/ldap.post.ts create mode 100644 server/api/auth/login/local.post.ts create mode 100644 server/api/boundaries/alias.get.ts create mode 100644 server/api/boundaries/alias.put.ts create mode 100644 server/api/boundaries/changeStigLibrary.post.ts create mode 100644 server/api/boundaries/ckl2.get.ts create mode 100644 server/api/import/cert.post.ts create mode 100644 server/api/override/delete.post.ts create mode 100644 server/api/status.get.ts create mode 100644 server/api/users/checkAlert.get.ts create mode 100644 server/utils/assessments.ts mode change 100644 => 100755 server/utils/checklist.ts delete mode 100644 server/utils/processLibrary.ts create mode 100644 server/utils/stigLibrary.ts create mode 100644 server/utils/zip.ts diff --git a/.gitignore b/.gitignore index b970d3c..a765c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ db/tirdb.sqlite-journal # internal test test +server/api/localtest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b6f7301 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +ARG BASE_CONTAINER +FROM $BASE_CONTAINER +USER node +WORKDIR /src +COPY --chown=node:node . . +RUN npm run build +RUN npm prune -production diff --git a/README.md b/README.md index 62b2c08..ca50bd8 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ TIR is a web application to dynamically manage compliance data for a system. -Tir is a Armenian god of wisdom and the namesake of the TIR (Test Ingest Respository). TIR will help manage a system's STIG/SRG/SCTM content from a myriad of test tool formats. +Tir is a Armenian god of wisdom and the namesake of the TIR (Test Ingest Respository). TIR will help manage a system's STIG/SRG/SCTM content from a myriad of test tool formats. ## Features -* Group system compliance data -* Store STIG results files and their hsitory for a system . -* Store Quarterly DISA STIG libraries. -* Streamline Quarterly STIG Update Process -* Import automated test tool results -* Export compliance data +- Group system compliance data +- Store STIG results files and their hsitory for a system . +- Store Quarterly DISA STIG libraries. +- Streamline Quarterly STIG Update Process +- Import automated test tool results +- Export compliance data ## Dev Setup @@ -22,6 +22,7 @@ Tir is a Armenian god of wisdom and the namesake of the TIR (Test Ingest Resposi - node v18+ ### Clone repo + ```bash git clone cd tir @@ -33,15 +34,17 @@ cd tir npm install ``` - #### `.env` for SQLite config + ```ini SQLITE=true JWT_KEY= //Required: Key that TIR will use for JWT +SECRET_KEY= //Required INIT_PASSWORD= //Required: Initial Password for initial TIR admin Account ``` #### `.env` for Postgres config + ```ini PORT= //Optional: Dev Web Server Port Defaults to 3000 DATABASE_HOST= //Required: Postgres Database IP/FQDN diff --git a/cert_loc/cert_response.json b/cert_loc/cert_response.json new file mode 100644 index 0000000..ae41665 --- /dev/null +++ b/cert_loc/cert_response.json @@ -0,0 +1,5 @@ +{ + "result": "Success", + "filename": "good.tar", + "error": false +} diff --git a/components/BoundaryItems.vue b/components/BoundaryItems.vue index 23d338b..4f2c339 100644 --- a/components/BoundaryItems.vue +++ b/components/BoundaryItems.vue @@ -4,7 +4,9 @@

{{ $route.params.company }}

-

A list of all the boundaries you are a member of.

+

+ A list of all the {{ inflection.pluralize(boundaryView.alias.toLowerCase()) }} you are a member of. +

@@ -104,9 +106,11 @@ {{ enclave.owner.email }} None - Need Data - {{ enclave.lastUpdate }} + {{ formatDate(enclave.creationDate) }} + + + {{ formatDate(enclave.lastUpdate) }} @@ -156,15 +160,7 @@ active ? 'bg-gray-200 dark:bg-gray-700' : 'text-gray-300', 'group flex items-center px-3 py-1 text-sm leading-6 text-gray-500 dark:text-gray-100', ]" - @click.stop=" - [ - (edit = true), - (open = true), - (newName = enclave.name), - (editId = enclave.id), - editUpdate(enclave.ownerId, enclave.StigLibraryId), - ] - " + @click.stop="[(edit = true), (open = true), editUpdate(enclave)]" >