diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 628cda8..30a7deb 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -22,7 +22,8 @@ jobs: - run: | pip install mkdocs-material pip install mike + pip install mkdocs-glightbox git config --global user.email "action@github.com" git config --global user.name 'Actions' - - run: mike deploy --push --update-aliases 0.1 latest \ No newline at end of file + - run: mike deploy --push --update-aliases 1.0 latest \ No newline at end of file diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..28090cb --- /dev/null +++ b/docs/API.md @@ -0,0 +1,4 @@ +- [Postman APIs](https://www.postman.com/aptrs-api/aptrs-workspace/api/7714b268-664f-4300-b389-f6ec34829350/definition/b12bbcd0-6a19-4b80-bc1e-0315d2730c80?version=62baf360-29f0-466f-9579-ffdae037a890&view=documentation) +- [Postman API Collection](https://www.postman.com/aptrs-api/aptrs-workspace/collection/gly1r21/aptrs) +- [Swagger](https://api.aptrs.com) + \ No newline at end of file diff --git a/docs/Company.md b/docs/Company.md deleted file mode 100644 index cb335f0..0000000 --- a/docs/Company.md +++ /dev/null @@ -1,15 +0,0 @@ -# Company - -The company option allows you to create a new customer company for which you are doing penetration testing. The company will be required while create a project. Once you install the APTRS you can see a demo company created to get an idea of how it works. - -## Company List - -If you acess the `http://127.0.0.1:8000/company/` you are see all the companines create in the table. You can either delete, edit or add new company from the same page. - - - -## Edit/Add Company - -Once you click on the edit/add button in the above table. You can edit/add the company details like Logo, Name and address. The logo will be used on the cove page of the report. As of now the address will not be displayed in the report will be fixed in the later version. - - \ No newline at end of file diff --git a/docs/Customer.md b/docs/Customer.md deleted file mode 100644 index a6d7627..0000000 --- a/docs/Customer.md +++ /dev/null @@ -1,15 +0,0 @@ -# Customer - -The Customer option allows you to create a new customer for the company. For each project and company, there will be a team involved from the penetration tester and Customer company. You can create a customer for the company. The details will be used while creating the report for the project. - -## Customer List - -If you acess the `http://127.0.0.1:8000/company/customer/` you are see all the customer and company for the customer in the table. You can either delete, edit or add new new from the same page. - - - -## Edit/Add Customer - -Once you click on the edit/add button in the above table. You can edit/add the customer details like Company Name, Customer Name, Customer Emaill and Customer Mobile Number. - - \ No newline at end of file diff --git a/docs/Features/Users/users.md b/docs/Features/Users/users.md new file mode 100644 index 0000000..3515bfe --- /dev/null +++ b/docs/Features/Users/users.md @@ -0,0 +1,33 @@ +# User Management in APTRS + +APTRS provides robust user management capabilities, allowing you to add, edit, and delete users. Each user can log in to the APTRS platform using their credentials, and they have the option to set a profile photo through the Edit Profile feature. In version 1.0, users are also able to change their passwords. + + + + +### User Types +There are two types of users in APTRS: + +1. Admin Users: Admin users have elevated permissions and can perform administrative tasks, including managing user accounts and configurations. +2. Non-Admin Users: Non-admin users have restricted access and can perform tasks based on the permissions and groups assigned to them. + + +All users can log in and perform tasks according to their assigned permissions and groups. + + +!!! info + + For detailed information on permissions and groups, please refer to the Permissions and Groups section. + + +### User Classification +Users are classified into two categories: + +1. Internal Users (Staff Users): By default, all users added to the system are marked as staff users, indicating they are internal users of the APTRS. +2. External Users (Non-Staff Users): External users are designated as non-staff users. For details on managing non-staff users, please refer to the Customer section. + +This structured approach to user management ensures that you can effectively manage access levels and user capabilities within the APTRS platform. + + +### Important Note on Deleting Users +All projects in APTRS must have an owner. Deleting a user will cause errors, as projects assigned to that user will no longer have an owner. If you need to disable a user’s account, it is recommended to set the account to "inactive" rather than deleting it. If you choose to delete the user, be aware that you will need to manually reassign ownership of all the projects associated with that user to avoid issues. \ No newline at end of file diff --git a/docs/Features/company/company.md b/docs/Features/company/company.md new file mode 100644 index 0000000..0470522 --- /dev/null +++ b/docs/Features/company/company.md @@ -0,0 +1,33 @@ +# Company Management in APTRS + +APTRS allows you to add and manage companies, with two types of companies supported: Internal Companies and External (Non-Internal) Companies. + + + + +## Internal Companies +APTRS assumes that your company, the one deploying and using APTRS, is the internal company. When you deploy APTRS for the first time, an internal company is automatically created. This company is assigned to you and cannot be deleted or replaced. However, you can rename it to reflect your actual company name. + +Key details about internal companies: + +- **Internal Company Setup**: The internal company is auto-created during the initial setup, and no additional internal companies can be added afterward. +- **User Assignment**: All users added through the User Management page will automatically be part of the internal company. +- **Reports**: Users and data from the internal company will be reflected in your reports as staff or internal users. + + +## External (Non-Internal) Companies +All companies manually added after the initial setup are classified as External Companies. These are typically client companies or third-party organizations. + +Key details about external companies: + +- **User Management**: You cannot add users to external companies through the User Management page. Any user added through this page will be assigned as a staff member of the internal company. +- **Assigning Users to External Companies**: To assign users to external companies, you need to go through the Customer section, which manages external users. +- **Projects**: You can create projects for both internal and external companies, allowing you to track and manage work for client companies separately from your own. + +This setup ensures a clear distinction between your internal users and external client companies, making it easier to manage access, projects, and reports within APTRS. + + +!!! warning + + Deleting a company will also delete all associated users. Make sure to reassign or handle any users before deleting a company. + diff --git a/docs/Features/company/customer.md b/docs/Features/company/customer.md new file mode 100644 index 0000000..a08b602 --- /dev/null +++ b/docs/Features/company/customer.md @@ -0,0 +1,20 @@ +# Customer Management in APTRS + + +Customers in APTRS are external users who belong to external (non-internal) companies. You can manage these users from the Customer page, where external users are added and tracked, and they are included in reports as customer users. + + + + + +### Adding Customers +When adding a customer, you will need to provide the following information: + +- Email: The customer's email address. +- Company: The external company they belong to. +- Password: A password is required as part of the future functionality. + + +Though passwords are required during customer creation, as of version 1.0, external users do not yet have access to login, API, or dashboard features. These features are planned for future releases, where customers will be able to log into the APTRS dashboard, view ongoing and past projects, download reports, and more. + +This allows APTRS to lay the groundwork for future functionality while managing customer data and ensuring they are accurately represented in reports. \ No newline at end of file diff --git a/docs/Features/configuration/configuration.md b/docs/Features/configuration/configuration.md new file mode 100644 index 0000000..da0b53a --- /dev/null +++ b/docs/Features/configuration/configuration.md @@ -0,0 +1,7 @@ +# Configuration + +The Configuration section allows admin users or users with the Manage Configurations permission to add and manage various settings. In APTRS, users can define Project Types, such as "Mobile Application Testing," which are used when creating projects and are also referenced in PDF and DOCX reports. Multiple project types can be added to suit different testing needs. + +In addition to project types, users can also create Report Standards. When generating a report, users are required to select the applicable testing standard, such as OWASP for web application testing. Users can add additional standards here, which can then be used in the generated reports. + + \ No newline at end of file diff --git a/docs/Features/dashboard/dashboard.md b/docs/Features/dashboard/dashboard.md new file mode 100644 index 0000000..34dde88 --- /dev/null +++ b/docs/Features/dashboard/dashboard.md @@ -0,0 +1,10 @@ +# Dashboard + + +The Dashboard provides a personalized view of projects based on the logged-in user’s ownership and project status. Unlike the Projects View Page, which lists all projects within APTRS, the Dashboard only displays projects where the logged-in user is the owner and the project is not marked as completed. The Dashboard shows projects with the following statuses: Delay, In Progress, or Upcoming, as long as the user is the owner of those projects. + +In addition to active or upcoming projects, the Dashboard also displays completed projects if the project has an active retest. Even if a project is marked as completed, it will be shown in the Dashboard if it has any upcoming, in-progress, or delayed retests where the logged-in user is the owner of the retest task. + +This also applies in cases where the user is the owner of the retest task for a completed project, even if the user is not the owner of the original project. In such cases, the project will still appear on the Dashboard, allowing the user to view and manage their active retest tasks. + + \ No newline at end of file diff --git a/docs/Features/index.md b/docs/Features/index.md new file mode 100644 index 0000000..29cf72d --- /dev/null +++ b/docs/Features/index.md @@ -0,0 +1,2 @@ +APTRS offers various features and configurations, including the management of companies, customers, projects, retests, different types of reports, configurations, templates, and more. The Features Documentation provides detailed information on the different setups, features, and use cases. + diff --git a/docs/Features/permission/permission.md b/docs/Features/permission/permission.md new file mode 100644 index 0000000..d78884d --- /dev/null +++ b/docs/Features/permission/permission.md @@ -0,0 +1,42 @@ + +# Groups and Permissions in APTRS + +APTRS uses permissions to control access to certain APIs and restrict features to specific users. To streamline this process, APTRS allows you to create groups and assign permissions to those groups. Once a group is created, you can assign users to one or more groups. A user assigned to multiple groups will inherit all the permissions from those groups. + + + + + +### How Permissions Work +Permissions are pre-defined within APTRS to regulate access to various functionalities. These permissions cannot be modified or created from the user interface, as they are hard-coded in the backend. However, you can create custom groups and assign these predefined permissions to the groups. When users are assigned to a group, they will automatically gain all the permissions associated with that group. + +### Admin Users and Permissions +Admin users in APTRS are not restricted by permissions or group assignments. This means that even if an admin user has no group assigned or is assigned to a group with limited permissions, they will still have full access to all features and APIs in the system. Admin users are always granted full control, regardless of group membership or assigned permissions. + +### Default Groups +When you first deploy APTRS, several default groups are created with specific permissions. The most important groups are Project Manager and Manager. These groups are crucial for report generation, as they are used to add project manager and manager details to reports. + +While you can edit the permissions assigned to these groups, it is important to retain the group names ("Project Manager" and "Manager") if you want APTRS to correctly include project manager and manager details in the reports. Removing or renaming these groups may cause issues with report generation and prevent the correct user details from being added to reports. + +### List of Permissions (as of version 1.0) + +- Manage Users: +Users with this permission can add, edit, and delete users, manage groups, and assign permissions to groups. They can also create and delete groups. + +- Manage Projects: +Users with this permission can create, edit, and delete projects. They can add vulnerabilities or retests within a project, generate reports, and add scope to projects. By default, users cannot select project or retest owners; projects and retests created by users with this permission will automatically mark the creator as the owner. + +- Assign Projects: +This permission allows users to select and assign project or retest owners. Users with this permission can assign any user as the owner of a project or retest. + +- Manage Vulnerability Data: +Users with this permission can add, edit, and delete entries in the vulnerability database or templates. + +- Manage Customers: +Users with this permission can add, edit, and delete customers. + +- Manage Companies: +Users with this permission can add, edit, and delete companies. + +- Manage Configurations: +Users with this permission can manage various application configurations. \ No newline at end of file diff --git a/docs/Features/project/Vulnerability.md b/docs/Features/project/Vulnerability.md new file mode 100644 index 0000000..06beafd --- /dev/null +++ b/docs/Features/project/Vulnerability.md @@ -0,0 +1,89 @@ +Each project can have associated vulnerabilities. You can navigate to the Vulnerability tab within a project to manage its vulnerabilities. This tab allows you to add, edit, or remove vulnerabilities specific to that project, providing a dedicated space to document identified security issues, their descriptions, solutions, CVSS scores, and other relevant details. + +Using the Vulnerability Database, you can quickly import common vulnerabilities with pre-filled information, saving time when adding recurring or well-documented issues across multiple projects. + + + + + +### Adding Vulnerabilities + +APTRS provides multiple ways to add vulnerabilities to a project, offering flexibility in how you manage and document security issues. + + +- **Search and Add**: This feature allows you to search for vulnerabilities by title or name from the Vulnerability DB or Template. Once you select a vulnerability from the search results, a new entry is created within the project, automatically populated with the title, description, solution, reference link, and CVSS score from the Vulnerability DB. This approach allows for efficient reuse of information with pre-filled details, saving time on repetitive entries. + +- **Add New**: Selecting "Add New" will create a blank vulnerability entry within the project. All fields are initially empty except for the title, which is set to "New Vulnerability." This option is ideal if you need to manually document unique vulnerabilities not in the database. You can fill in all required details such as description, solution, and severity. + +- **Upload CSV**: This option is designed specifically for importing vulnerabilities from Nessus scan outputs. You can upload a Nessus vulnerability scan CSV report, which APTRS will parse to extract details such as URL or IP, port, title, description, and more. Parsed vulnerabilities are then added directly to the project, saving time on data entry for larger assessments. + +### Nessus CSV + +This feature can also be used for other, non-Nessus scan reports. As long as the CSV file contains the required columns with matching names, APTRS will process it just like a Nessus report, making it a versatile option for importing vulnerabilities from various sources. + + +#### Required CSV Columns +To ensure that vulnerabilities are parsed correctly, your CSV file should include the following columns: + +- Host: The IP address or URL of the affected system. +- Port: The network port where the vulnerability was found. +- Name: The title of the vulnerability, providing a brief identifier. +- Description: A detailed explanation of the vulnerability, including its nature and potential impact. +- Solution: Recommended actions or patches to mitigate or resolve the vulnerability. +- Risk: The severity level of the vulnerability (e.g., Info, Low, Medium, High, Critical). APTRS uses this to assign a default CVSS score and vector. + + +#### CVSS Score and Vector + + +As of version 1.0, APTRS does not accept CVSS scores and vectors from CSV imports because default Nessus reports do not include them. Instead, APTRS assigns a default CVSS score and vector based on the **Risk** level provided in the CSV file. + +#### Default CVSS Scores and Vectors (CVSS 3.1) + +These default values are automatically assigned based on the risk level when the CSV is parsed: + + + +| Severity | Base Score | Vector | +| ----------- | ------------------------------------ |---------------------- | +| `Critical` | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | +| `High` | 7.6 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L | +| `Medium` | 5.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L | +| `Low` | 3.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N | +| `Informational` | 0.0 | CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:N | + + +These defaults ensure consistency in reporting for imported vulnerabilities, even if specific CVSS details aren’t included in the CSV file. + + +### Vulnerability Instances + +Each vulnerability in a project is required to have an **instance**. An instance represents the specific URL, parameter, IP address, and port number of the affected vulnerability. Each instance within a vulnerability can have its own status, allowing for more granular tracking and resolution. + + + + + + + +### Vulnerability and Instance Status + +The status of each vulnerability and its instances is tracked individually to provide clear insights into the resolution progress. Below are the details on how the status is managed and calculated for both vulnerabilities and their instances. + +The status of a vulnerability and its instances are interconnected. There are three possible statuses for both vulnerabilities and instances: + +- **Vulnerable**: The vulnerability or instance has unresolved security issues. +- **Confirmed Fix**: The vulnerability or instance has been resolved and no longer has security issues. +- **Accepted Risk**: The vulnerability or instance remains unresolved, but the customer or client has accepted the associated risk. + +These statuses function as follows: + +1. **Changing Vulnerability Status**: If you change the status of a vulnerability, all instances associated with that vulnerability will automatically be set to the same status. For example, setting a vulnerability to **Accepted Risk** will update all instances within that vulnerability to **Accepted Risk** as well. + +2. **Changing Instance Status**: When modifying the status of individual instances within a vulnerability, the overall vulnerability status is recalculated based on its instances' statuses. The rules are as follows: + + - **Confirmed Fix**: For a vulnerability to be marked as Confirmed Fix, all instances must be set to Confirmed Fix. Even a single instance with a different status prevents the vulnerability from being marked as Confirmed Fix. + - **Vulnerable**: If any instance is marked as Vulnerable, the entire vulnerability is marked as Vulnerable, regardless of other instances’ statuses. + - **Accepted Risk**: If all instances are marked as Accepted Risk, the vulnerability status will also be set to Accepted Risk. + + In short, for a vulnerability to be considered Confirmed Fix, all instances must be Confirmed Fix. To be marked as Accepted Risk, all instances must have that status. Any instance marked as Vulnerable will cause the vulnerability itself to be marked as Vulnerable. diff --git a/docs/Features/project/project-view.md b/docs/Features/project/project-view.md new file mode 100644 index 0000000..332779f --- /dev/null +++ b/docs/Features/project/project-view.md @@ -0,0 +1,27 @@ + + +APTRS allows users to create and manage projects, which are typically created when conducting a pentest for a company. When setting up a project, you can associate it with a specific company, select multiple internal users as project owners, and define key details such as project type, start and end dates, and a brief description. + +Once the project is created, you can later add vulnerabilities, generate reports, and track progress within the project. This feature helps organize pentesting efforts efficiently, ensuring clear project ownership and structure. + + + +### Project Status +The project status is automatically calculated based on the project’s start and end dates: + +- **Upcoming**: If the start date is in the future. +- **In Progress**: If the start date has passed or is today, but the end date is still in the future. +- **Delayed**: If the end date has passed. +- **Completed**: If the projct is marked as completed. + +If your project is completed, you can manually mark it as **Completed** from the project summary. To do this, navigate to the project from the project table or dashboard, and you’ll find an option to mark it as completed on the project summary page. + + +### Project Details +Once a project is created, it is not possible to change the associated company. However, you can still edit other details, such as project type, dates, description, and owners. + + + +### Project Owners +In Version 1.0, APTRS supports assigning multiple project owners, allowing you to add as many project owners as needed. Assigning or selecting a project owner requires admin privileges or the Assign Projects permission. Otherwise, the user creating the project is automatically added as the project owner. + diff --git a/docs/Features/project/report.md b/docs/Features/project/report.md new file mode 100644 index 0000000..a7ce067 --- /dev/null +++ b/docs/Features/project/report.md @@ -0,0 +1,30 @@ +Once your project is ready, you can generate a report for the identified vulnerabilities. APTRS version 1.0 provides options to generate reports in PDF, Excel, and DOCX formats. Navigate to the report section within the project, select the desired report type and standard, and download the report directly. + + + + +As of version 1.0, the DOCX report generation feature is experimental. It may be removed or enhanced with more customization options in future versions. Once validated for full customization and consistent presentation, this feature will become permanent. + +### Report Customization + +You can customize both the PDF and DOCX reports: + +- **PDF Reports:** APTRS uses the WeasyPrint Python library to convert HTML into PDF. You can modify the HTML and CSS files used in report generation to match your requirements. +- **DOCX Reports:** APTRS leverages the `python-docxtpl` library to create DOCX files. The CKEditor WYSIWYG editor is used for entering vulnerability and project details. CKEditor’s HTML output is then converted into DOCX format using the `html2docx` library, and integrated with `docxtpl` to generate the final report. + +The HTML and DOCX report templates are available here: +- [HTML and DOCX Report Templates](https://github.com/APTRS/APTRS/tree/main/APTRS/templates) + +CSS files for HTML-to-PDF reports can be customized here: +- [CSS for PDF Reports](https://github.com/APTRS/APTRS/tree/main/APTRS/static/css) + + +#### Report Limitations +- **PDF Reports:** APTRS uses the ``WeasyPrint`` Python library to generate PDF reports. However, ``WeasyPrint`` does not support JavaScript execution, which limits the ability to include custom, interactive charts directly within the PDF. Instead, APTRS generates charts using a Python library and embeds them as static images in the PDF. This approach restricts customization of charts via HTML and CSS. +- **DOCX Reports:** APTRS generates DOCX reports using a combination of ``python-docx``, ``python-docxtpl``, and ``html2docx``. While ``python-docxtpl`` enables dynamic content insertion into documents, it does not support updating or dynamically modifying charts. As a result, charts included in DOCX reports cannot be automatically updated with dynamic values by APTRS. + + + + + + diff --git a/docs/Features/project/retest.md b/docs/Features/project/retest.md new file mode 100644 index 0000000..d91dc59 --- /dev/null +++ b/docs/Features/project/retest.md @@ -0,0 +1,12 @@ +Each project can have a retest task created and assigned to a user. Similar to a project, each retest includes a start and end date and has a designated retest owner. Retests allow you to specify the revalidation of the project’s vulnerabilities, ensuring that fixes have been applied as expected. Within a project, users can initiate a retest to start this process. + + + +Similar to project ownership, the retest owner is automatically set to the user creating the retest if they do not have admin privileges or the Assign Projects permission. Users with admin access or Assign Projects permission can select the retest owner. Once a retest task is created, it cannot be edited, though you can still delete the retest task if needed. + +### Validation + +- **Project Completion Requirement:** A retest task cannot be created if the project is not marked as completed. Retests are only applicable to projects that have been fully executed, as retests aim to validate resolved vulnerabilities. Therefore, a project must be completed before any retest can be initiated. +- **Single Active Retest Restriction:** Even if the project is completed, you cannot create a new retest task if there is an existing retest task that is not marked as completed. Only one active retest can be associated with a project at a time. + + diff --git a/docs/Features/project/scope.md b/docs/Features/project/scope.md new file mode 100644 index 0000000..e989bb5 --- /dev/null +++ b/docs/Features/project/scope.md @@ -0,0 +1,4 @@ +Each project includes scopes, allowing you to define the list of IPs, URLs, or application names that are part of the engagement. Starting from version 1.0, each project can have multiple scopes. Within the project page, you can navigate to the Scope section to manage the specific scope of the project. + + + \ No newline at end of file diff --git a/docs/Features/vulnerabilityDB/vulnerability.md b/docs/Features/vulnerabilityDB/vulnerability.md new file mode 100644 index 0000000..7010793 --- /dev/null +++ b/docs/Features/vulnerabilityDB/vulnerability.md @@ -0,0 +1,11 @@ +# Vulnerability DB (or Template) + + +The Vulnerability DB or Template feature in APTRS allows you to add and manage a database of vulnerabilities that can be reused across different projects. When adding a vulnerability to a project, you can specify all necessary details such as the title, description, solution, CVSS score, and more. + +If you encounter the same vulnerability in multiple projects, such as IDOR or SQL Injection, the Vulnerability DB allows you to save time by reusing the same information without needing to write it again for each project. This helps streamline reporting and ensures consistency across projects. + +By creating templates for common vulnerabilities, you can easily import them when adding vulnerabilities to new projects, reducing redundant work and improving efficiency. + + + \ No newline at end of file diff --git a/docs/Prerequisites.md b/docs/Prerequisites.md deleted file mode 100644 index d646ce2..0000000 --- a/docs/Prerequisites.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Prerequisites - -**Linux** - -* Install Git `sudo apt-get install git` -* Install Python 3.8+ `sudo apt-get install python3.8` -* Install the following dependencies - ```bash - sudo apt install python3-dev python3-venv python3-pip build-essential wkhtmltopdf - ``` -* If you get error while genetrating PDF report uninstall the `wkhtmltopdf` with `sudo apt remove -y wkhtmltopdf` and install it again manually using debian file or according to your system [Dowload for here](https://wkhtmltopdf.org/downloads.html). -* If you are using kali linux 64 bit install this `wkhtmltopdf` https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb -* APTRS requires `wkhtmltopdf` version 0.12.6 - -**Windows** - -* Install [Git](https://git-scm.com/download/win) -* Install [Python **3.8+**](https://www.python.org/) -* Download & Install [wkhtmltopdf](https://wkhtmltopdf.org/downloads.html) as per the [wiki instructions](https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf) -* Add the folder that contains `wkhtmltopdf` binary to environment variable PATH. - - -!!! info "Note" - Set `wkhtmltopdf` environment variable. APTRS requires `wkhtmltopdf 0.12.6` and above. - -*** \ No newline at end of file diff --git a/docs/Project.md b/docs/Project.md deleted file mode 100644 index 85860a2..0000000 --- a/docs/Project.md +++ /dev/null @@ -1,55 +0,0 @@ -# Project - -The Project is one of the main functions of the tool. It is where you will create a project for any Company/Customer. Each project will be connected with a customer company and each project will contain its vulnerability and reports. - - -## Project List - -If you acess the `http://127.0.0.1:8000/` you are see all the Project in the table. YOu can view all the details for that project like, company name, Scope URL, Project start and end date etc. You can either delete, edit or add new new from the same page. - -!!! info "Note" - Once you delete any project all the vulnerabilites/reports for that project will be deleted. - - - -## Add Project - -Once you click on the add button in the above table. You can add details like company, scope url, project name, project start date end date etc. - -!!! info "Note" - Once you create a project you will not able to edit the company for the project. - - - -## View Project - -Once you click on view project in the table. You can edit the project, view/edit/add vulnerabilities for the project and also you can generate the report - -### Edit Project - -You can click on project tab and can edit the project details. - - - -### Vulnerability - -Once you click on the vulnerability tab, you can see all the vulnerabilities for the project. You can either delete/edit or add new vulnerabilities from here. - - - -### Edit/Add Vulnerability - -When you click on the edit/add button you will be able to add details like `vulnerability title, POC, description, Recommendation, Refference link, Instances, CVSS Score` etc. - -!!! info "Note" - The vulnerability title field is an input box with drop down and search. It will list the vulnerabilities from the vulnerability database. Once you select any it will automatically replace the data like Title, description, Recommendation, Refference link etc. - -!!! info "Note" - If you want to add a totally new vulnerability and its not showing in drop down menu. You can still enter any title and it will be accepted by the app. - - - - -### Report - -Last you have option to download the PDF report. You can view the demo report from [here](https://github.com/Anof-cyber/APTRS/blob/main/Doc/Report/Web%20Application%20Penetration%20Testing%20Report%20of%20Juice%20Shop.pdf) \ No newline at end of file diff --git a/docs/Report-Template.md b/docs/Report-Template.md deleted file mode 100644 index b5cbc3e..0000000 --- a/docs/Report-Template.md +++ /dev/null @@ -1,12 +0,0 @@ -# Report Template - -The report is created using HTML to PDF method. In you want to modify the Report template you need to edit the HTML files. Yuo can see all the HTML files related to Report from [here](https://github.com/Anof-cyber/APTRS/tree/main/templates/Report). - -The application create Cover page separately and use `cove.html` for the same. You can edit it hover you want. - -Next we have `toc.xml` that is used for table of content. You can edit the same if you want. - -!!! info "Note" - The tool will use all H1 tags in the `Report.html` page to show them in Table of content. - -The `Report.html` is where all the HTML code is save to generate the report. You can have a look at it and edit accordingly. \ No newline at end of file diff --git a/docs/Running.md b/docs/Running.md deleted file mode 100644 index 7bf9bb4..0000000 --- a/docs/Running.md +++ /dev/null @@ -1,23 +0,0 @@ -# Running APTRS - -## Linux -```bash -./run.sh 127.0.0.1:8000 -``` - -*** - -## Windows - -```batch -run.bat 127.0.0.1:8000 -``` - -!!! info "Note" - The default Username and password is `admin`. - - -!!! info "Note" - APTRS will listen to `0.0.0.0:8000` if you use the run script without arguments. - -In your web browser, navigate to `http://127.0.0.1:8000/` to access APTRS. \ No newline at end of file diff --git a/docs/Setting.md b/docs/Setting.md deleted file mode 100644 index 3846070..0000000 --- a/docs/Setting.md +++ /dev/null @@ -1,22 +0,0 @@ -# Settings - -The setting option allow you are create a new user. The option allows you to create a user and will be parart of the penetration testing process. By default all the user user added will be considerd as part of the project and will be shown in the report. - -The same implice on the customer as well. All the customer add for any company will be considered as part of the project for that customer. - - -## User List - -If you acess the `http://127.0.0.1:8000/accounts/setting` you are see all the users in the table. You can either delete, edit or add new new from the same page. - - - -## Edit/Add User - -Once you click on the edit/add button in the above table. You can edit/add the User profile image, First Name, Password, Username, Company Name, Email, Number etc. - - - - - -!> As of now You cannot change the password after creating user. The users will be considered as internal user with login access it should have same company name. \ No newline at end of file diff --git a/docs/Vulnerability-Database.md b/docs/Vulnerability-Database.md deleted file mode 100644 index a9f1758..0000000 --- a/docs/Vulnerability-Database.md +++ /dev/null @@ -1,20 +0,0 @@ -# Vulnerability Database - -The vulnerability database allows you to save time while creating a report for a project. If you find some vulnerabilities again and again in different projects while creating reports you don't want to type the same description, or recommendation again and again. In that scenario, you can maintain a vulnerability database where you can add the vulnerability title, description, recommendation, reference link and CVSS Score. - -Once you create a new vulnerability for any project you can select the vulnerability from the vulnerability data and it will atomically add the description, recommendation etc for you. - - -## Vulnerability Database List - -If you acess the `http://127.0.0.1:8000/vulnerability/` you are see all the vulnerabilitiesr saved as database collection in the table. You can either delete, edit or add new new from the same page. - - - -## Edit/Add Vulnerability Database - -Once you click on the edit/add button in the above table. You can edit/add the Vulnerability Database details like Vulnerability Title, CVSS Score, Description, Recommendation and Reference Link. - - - - \ No newline at end of file diff --git a/docs/custom-report/docx/company-user.md b/docs/custom-report/docx/company-user.md new file mode 100644 index 0000000..f48d4ef --- /dev/null +++ b/docs/custom-report/docx/company-user.md @@ -0,0 +1,47 @@ +# Context Variables for Company and Users + +## 1. Internal Company Name +- **Description:** + + This variable will provide the name of the internal company (your own company) that is linked to the APTRS. It fetches the company name from the `Company` model where the `internal` field is set to `True`. + +- **Usage Example:** + + ```python + Company Who DID the Pentest: {{ mycompany }} + + ``` + + +## 2. Project Manager Users +- **Description:** + + This variable gives access to all the internal users who are part of the "Project Manager" group. You can loop through this list to display details like the name of the project managers working on the project. + +- **Usage Example:** + + ```python + Project Managers: + + {% for user in projectmanagers %} + {{ user.full_name }} {{ user.position }} {{ user.email }} + {% endfor %} + + ``` + +## 3. Customer Company Users +- **Description:** + + This variable provides access to the users who belong to the customer’s company for the project. It retrieves the list of active users associated with the project’s customer company. + +- **Usage Example:** + + ```pthon + Customer Users: + + {% for user in customeruser %} + {{ user.full_name }} {{ user.position }} {{ user.email }} + {% endfor %} + + + ``` \ No newline at end of file diff --git a/docs/custom-report/docx/docx.md b/docs/custom-report/docx/docx.md new file mode 100644 index 0000000..94349ba --- /dev/null +++ b/docs/custom-report/docx/docx.md @@ -0,0 +1,142 @@ +APTRS provides the ability to generate detailed DOCX reports using customizable templates. You can use Jinja2 template tags within your `.docx` templates to dynamically populate project and vulnerability data. This guide explains how to customize your template and use available context variables. + +--- + +## **Template Location** +The default template is located at: ``/APTRS/templates/report.docx`` + + + +You can replace this file with your custom `.docx` template while keeping the required placeholders intact. + +--- + +## **Using Template Tags** +The `.docx` template uses Jinja2 syntax for placeholders and loops. Below are some examples: + +### **Placeholders** +- **Syntax:** `{{ variable_name }}` +- **Example:** To display the project name, use: `{{ project.name }}` + + +### **Loops** +- **Syntax:** `{% for item in items %}...{% endfor %}` +- **Example:** To list all vulnerabilities: + +```python +{% for vulnerability in vulnerabilities %} + +{{ vulnerability.vulnerabilityname }} (CVSS: {{ vulnerability.cvssscore }}) {% endfor %} +``` + + +### **Conditional Statements** +- **Syntax:** `{% if condition %}...{% else %}...{% endif %}` +- **Example:** To check if a project has vulnerabilities: + +```python +{% if vulnerabilities %} +Vulnerabilities are present. +{% else %} +No vulnerabilities found. +{% endif %} +``` + + +--- + +## **Available Context Variables** + + +| Variable | Description | +|--------------------------|--------------------------------------| +| `project` | The project object for which the report is being generated. Contains all project details. | +| `owners` | User details of All Project Owners | +| `project_exception` | Project Exceptions | +| `project_description` | Project Description | +| `vulnerabilities` | Queryset of vulnerabilities for the project, ordered by CVSS score (higher to lower). | +| `mycomany` | The name of the internal (your company) company. | +| `projectmanagers` | Queryset of users in the "Project Manager" group. | +| `customeruser` | Queryset of customer users associated with the project's customer company. | +| `projectscope` | Queryset of all project scopes for the project. | +| `totalretest` | List of retest schedules and owners. | +| `totalvulnerability` | Total count of vulnerabilities for the project. | +| `Report_type` | The type of report being generated (e.g., Audit, Re-Audit). | +| `standard` | The standard or methodology being used for the report. | +| `currentdate` | Get Current Date if needed in the report | +| `page_break` | Allows you to add page break in the docx report such as page break after each vulnerability details | +| `new_line` | Allows you to add a new line if needed | + + + +## **Docx Formatting with Jinja2** + +By default, Jinja2 adds blank lines with conditions or loops, which can be problematic for Docx formatting. Unlike HTML, where empty lines have minimal impact, in Docx, this can lead to extra rows in tables or increased table width. + +APTRS uses the docxtpl library, based on Python-docx and Jinja2, for template-based rendering. To reduce blank lines, you can use Jinja2's whitespace control. + +However, this method doesn't always work flawlessly; it may inadvertently remove important elements like tables along with extra spaces. A simpler solution can involve using a single line of code. + +You can modify the code like this: + +```python + +##Instead of new line for code +{% if vulnerabilities %} +Vulnerabilities are present. +{% else %} +No vulnerabilities found. +{% endif %} + + +## you can change it to like this on a single line + +{% if vulnerabilities %} Vulnerabilities are present. {% else %} No vulnerabilities found. {% endif %} +``` + + + +## **Color and Conditions** + +Each severity level in the report is represented by different colors: low or informational is often green or light blue, while high severity is red. Status can also be color-coded, with fixed vulnerabilities in green and open ones in red or orange. + +In HTML reports, you can add severity values to the tag's class attribute and create CSS to apply the colors. + +For DOCX reports, colors cannot be applied to undefined elements, limiting customization. To assign colors based on severity—like red for critical and orange for high—include them directly in the conditional statements within your DOCX template. + + +```python +{% if severity == 'Critical' %} severity with red color. {% elif severity == 'Low' %} severity with green color. {% endif %} +``` + + + +!!! info "Note" + + + Adding Jinja2 White Space control to this will remove the color. + +What if instead of just color for the text, we want to add color for the cell in the table like below + + +
Name | +Status | +Severity | +
---|---|---|
SQL Injection | +Vulnerable | +Confirm Fixed | +
Company: {{ mycompany }}
+ + ``` + + +## 2. Project Manager Users +- **Description:** + + This variable gives access to all the internal users who are part of the "Project Manager" group. You can loop through this list to display details like the name of the project managers working on the project. + +- **Usage Example:** + + ```html +Total Vulnerabilities: {{ totalvulnerability }}
+Critical Issues: {{ ciritcal }}
+High Severity Issues: {{ high }}
+ ``` + + + + + +3. **Dynamic Content**: + - Use loops and conditionals to dynamically render data. For example: + ```html +Total Vulnerabilities: {{ totalvulnerability }}
+Critical Issues: {{ ciritcal }}
+High Severity Issues: {{ high }}
+Medium Severity Issues: {{ medium }}
+Low Severity Issues: {{ low }}
+Informational Issues: {{ info }}
+ +Total Vulnerabilities: {{ totalvulnerability }}
+ ``` + +## 2. Severity Count +- **Description:** + Shows the count of vulnerabilities that have a severity of Critical or High, Medium, Low, None. +- **Usage Example:** + You can display the severity count. + + ```html +Critical Vulnerabilities: {{ critical }}
+High Vulnerabilities: {{ high }}
+Medium Vulnerabilities: {{ medium }}
+Low Vulnerabilities: {{ low }}
+Informational Vulnerabilities: {{ info }}
+ ``` + + +## 3. Report Standard +- **Description:** + The standard or methodology being used for generating the report (e.g., OWASP, NIST). It will be in the list format, you can use below example to get in a text seperated by comma. +- **Usage Example:** + Display the methodology or standard used in the vulnerability report. + + ```html +Report Standard: {{ standard|join:", " }}
+ ``` + + +## 4. Report Type +- **Description:** + Specifies the type of report being generated. This can include types like "Audit" or "Re-Audit". +- **Usage Example:** + Show the type of the report (Audit or Re-Audit). + + ```html +Report Type: {{ Report_type }}
+ ``` + +## 5. Chart Image +- **Description:** + This variable holds the rendered data for a pie chart showing the distribution of vulnerabilities by severity. +- **Usage Example:** + Use this to display a pie chart visualizing vulnerability severity distribution. + + ```html +Company Name: {{ project.companyname.name }}
+ ``` + +3. **`project.description`** + - A detailed description of the project. + - Example usage: + ```html +Description: {{project.description|clean_html}}
+ ``` + - It uses CKeditor HTML data, using ``|clean_html`` allow to render html data securely instead of as text. + +4. **`project.projecttype`** + - Specifies the type of project. + - Example usage: + ```html +Project Type: {{ project.projecttype }}
+ ``` + +5. **`project.startdate`** + - The start date of the project. + - Example usage: + ```html +Start Date: {{ project.startdate }}
+ ``` + - You can also modify the date format + ```html +Start Date: {{project.startdate|date:"d/m/Y" }}
+ ``` + +6. **`project.enddate`** + - The end date of the project. + - Example usage: + ```html +End Date: {{ project.enddate }}
+ ``` + - You can also modify the date format + ```html +End Date: {{project.enddate|date:"d/m/Y" }}
+ ``` + +7. **`project.testingtype`** + - The type of testing performed for the project (e.g., White Box, Black Box). + - Example usage: + ```html +Testing Type: {{ project.testingtype }}
+ ``` + +8. **`project.projectexception`** + - Notes or exceptions for the project, if any. + - Example usage: + ```html +Exceptions: {{ project.projectexception|clean_html }}
+ ``` + - It uses CKeditor HTML data, using ``|clean_html`` allow to render html data securely instead of as text. + - In most cases if you don't have exceptions and in your report you only this if exception is there you are also do it with conditions. + ```html + {% if project.projectexception %} +Exceptions: {{ project.projectexception|clean_html }}
+ {% endif %} + ``` + + +9. **`project.owner`** + - A many-to-many relationship representing users associated as owners of the project. + - To display all owners: + ```html +Status: {{ project.status }}
+ ``` + + diff --git a/docs/custom-report/pdf/retest.md b/docs/custom-report/pdf/retest.md new file mode 100644 index 0000000..9847e3c --- /dev/null +++ b/docs/custom-report/pdf/retest.md @@ -0,0 +1,41 @@ +# Context Variable for Project Retests + +The `totalretest` variable gives access to the retests associated with a project. It allows you to display details of a project retest, including start and end dates, owners, and status. + +- **Usage Example:** + You can loop through `totalretest` to display the retests for a project. However, it is possible to conditionally display the retests based on the `Report_type`, e.g., showing retests only when the report type is "Re-Audit". + + ```html +Vulnerability Name: {{ vulnerability.vulnerabilityname }}
+ {% endfor %} + ``` + +2. **`vulnerability.vulnerabilityseverity`** + - The severity of the vulnerability (e.g., "High", "Medium"). + - Example usage: + ```html + {% for vulnerability in vuln %} +Severity: {{ vulnerability.vulnerabilityseverity }}
+ {% endfor %} + ``` + +3. **`vulnerability.cvssscore`** + - The CVSS score associated with the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +CVSS Score: {{ vulnerability.cvssscore }}
+ {% endfor %} + ``` + +4. **`vulnerability.cvssvector`** + - The CVSS vector associated with the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +CVSS Vector: {{ vulnerability.cvssvector }}
+ {% endfor %} + ``` + +5. **`vulnerability.status`** + - The status of the vulnerability, based on `STATUS_CHOICES` (e.g., Vulnerable, Confirm Fixed, Accepted Risk). + - Example usage: + ```html + {% for vulnerability in vuln %} +Status: {{ vulnerability.status }}
+ {% endfor %} + ``` + +6. **`vulnerability.vulnerabilitydescription`** + - A description of the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +Description: {{ vulnerability.vulnerabilitydescription|clean_html }}
+ {% endfor %} + ``` + +7. **`vulnerability.POC`** + - The proof of concept (POC) for the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +POC: {{ vulnerability.POC|clean_html }}
+ {% endfor %} + ``` + +8. **`vulnerability.vulnerabilitysolution`** + - The recommended solution for the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +Solution: {{ vulnerability.vulnerabilitysolution|clean_html }}
+ {% endfor %} + ``` + +9. **`vulnerability.vulnerabilityreferlnk`** + - A reference link related to the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +Reference Link: {{ vulnerability.vulnerabilityreferlnk|clean_html }}
+ {% endfor %} + ``` + +10. **`vulnerability.created`** + - The timestamp when the vulnerability was created. + - Example usage: + ```html + {% for vulnerability in vuln %} +Created: {{ vulnerability.created }}
+ {% endfor %} + ``` + +11. **`vulnerability.created_by`** + - The user who created the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +Created By: {{ vulnerability.created_by.username }}
+ {{ vulnerability.created_by.full_name }} + {% endfor %} + ``` + - Similar to project owner, you can use other filed as well like email, number or postion etc. + +12. **`vulnerability.last_updated_by`** + - The user who last updated the vulnerability. + - Example usage: + ```html + {% for vulnerability in vuln %} +Last Updated By: {{ vulnerability.last_updated_by.username }}
+ {% endfor %} + ``` + +### Available Variables for Vulnerableinstance Model + +1. **`instance.vulnerabilityid`** + - The `Vulnerability` object associated with the instance. + - Example usage: + ```html + {% for instance in instances %} +Vulnerability Name: {{ instance.vulnerabilityid.vulnerabilityname }}
+ {% endfor %} + ``` + +2. **`instance.project`** + - The project associated with the vulnerable instance. + - Example usage: + ```html + {% for instance in instances %} +Project: {{ instance.project.name }}
+ {% endfor %} + ``` + +3. **`instance.URL`** + - The URL of the vulnerable instance. + - Example usage: + ```html + {% for instance in instances %} +URL: {{ instance.URL }}
+ {% endfor %} + ``` + +4. **`instance.Parameter`** + - The parameter of the vulnerable instance. + - Example usage: + ```html + {% for instance in instances %} +Parameter: {{ instance.Parameter }}
+ {% endfor %} + ``` + +5. **`instance.status`** + - The status of the vulnerable instance, based on `STATUS_CHOICES` (e.g., Vulnerable, Confirm Fixed, Accepted Risk). + - Example usage: + ```html + {% for instance in instances %} +Status: {{ instance.status }}
+ {% endfor %} + ``` + +### Displaying Vulnerable Instances for a Specific Vulnerability in a Template +The instances query set or list does not associte with the vulnerability name, instances variable contain all instances for the project, In most cases we need all instances for a vulnerabiltiy. We can do that as well, you can check in the original ``vulnerabilities.html`` in the template or you can use this: + +To display the instances for a specific vulnerability within a loop for vulnerabilities, you can use the following approach: + +```html +{% for vulnerability in vuln %} + +Vulnerability Name: {{ vulnerability.vulnerabilityname }}
+ +{{ vulnerability.vulnerabilitysolution|clean_html }}
+ +{{ vulnerability.vulnerabilityreferlnk|clean_html }}
+ +POC: {{ vulnerability.POC|clean_html }}
+ +Description: {{ vulnerability.vulnerabilitydescription|clean_html }}
+ +Status: {{ vulnerability.status }}
+ +CVSS Vector: {{ vulnerability.cvssvector }}
+ +Severity: {{ vulnerability.vulnerabilityseverity }}
+ + {% for instance in instances %} + + {% if instance.vulnerabilityid.id == vulnerability.id %} +