Whitespots Wiki
Login
  • Home
  • πŸ”¦Auditor
    • πŸ“₯Deployment
      • Installation
      • Update
    • 🎯Features
      • πŸš€Run Audit
        • AppSec Portal cooperation
        • Direct use of Auditor
      • βš™οΈSettings
        • AppSec Portal cooperation
        • Direct use of the Auditor
          • Cleaner
          • Docker Credentials
          • Workers
          • Personalization
        • Jobs
          • Technical Jobs
          • Scanner Jobs
          • Job configuration
    • πŸ—’οΈRelease notes
    • 🩼Maintenance
  • πŸ–₯️AppSec Portal
    • πŸ“₯Deployment
      • License obtaining
      • Installation
      • Get started with the AppSec Portal
        • Π‘onfiguration options
      • Update
      • Accessing the AppSec Portal API Endpoints
      • Database transfer guide
      • FAQ: typical errors in deployment process
    • βš™οΈPost install Configuration
    • 🎯Features
      • 🎣Auto Validator
        • Rule creation
        • Rules view
      • Deduplicator
        • βš™οΈBasic deduplicator rules
        • βš™οΈAdvance Deduplicator rules
      • πŸ”¦Vulnerability discovery
        • βœ”οΈAudits
        • βš™οΈAuditor settings
          • Auditor config
          • Sequences
            • Sequences creating
            • Sequences setting
        • πŸ”ŽRun audit
          • Run Audit Manually
          • Scheduled Audit Run
      • 🎯Recommendations
      • Security Metrics
        • Severity Statistics Dashboard
        • WRT (Weighted Risk Trend)
        • How to work with WRT (for team leads)
        • Metrics settings
          • SLA
        • CVSS
          • CVSS Rule
      • Custom Reports
      • πŸ“ˆActive tasks
      • 🧺Asset management
        • How to import repositories from version control
        • Default product
        • Adding a product asset
        • Asset Transfer Between Products
      • πŸ•·οΈFindings view
        • All findings view
        • Grouped findings as a result of
        • Grouping of findings into groups
        • Available bulk actions
        • Viewing specific findings
        • Usable filters and easy sorting
      • πŸ“ŠJira
        • Jira integration configuration
        • Setting up Jira webhook
      • πŸ‘ΎMove from DefectDojo
      • πŸ”¬Scanners
        • πŸ”ŒImporting reports from scanners to AppSec Portal
          • πŸ–οΈManual Import using Report File
          • Importing reports via Terminal using a Report File
          • Importing reports via Lambda Function using a Report File
        • Scanner description
          • Code Scanners
            • Bandit
            • Brakeman
            • Checkov
            • CodeQL
            • ESLint
            • Gemnasium
            • Gosec
            • Hadolint
            • KICS
            • PHPCodeSniffer
            • Retire.js
            • Semgrep
            • SpotBugs
            • Terrascan
          • Secret Scanners
            • Gitleaks
            • Trufflehog3
          • Image and code dependency Scanners
            • Trivy
            • Trivy vulners.com plugin
            • Snyk
          • Web Scanners
            • Arachni Scan
            • Acunetix
            • Burp Enterprise Scan
            • OWASP Zap
          • Infrastructure Scanners
            • AWS Security Hub Scan
              • Importing reports via AWS Lambda Function within AWS Security Hub
            • Prowler
            • Subfinder
            • Nessus
            • Nuclei
          • Mobile Security Scanners
            • MobSFScan
          • Other Scanners
            • Dependency-Track
            • Whitespots Portal
      • πŸ“¦Working with products
        • Product Creation
        • Product options
        • Finding groups
        • Risk assessment
        • Product Asset
    • πŸ› οΈGeneral Portal settings
      • Version Control Integration
      • Profile
      • Managing user roles and access control
        • User management
        • Creating and editing roles
      • SSO settings
        • GitLab SSO
        • Microsoft SSO
        • Okta SSO
      • Scanner settings
        • Auto Closer
        • Group findings by
        • Custom Jira description
        • Custom severity mapping
        • Auditor Job Config
      • Notification settings
        • Integration
        • Criteria & Schedule
        • Status change notification
        • Manage notification schedule
      • Repository Link Configs
      • CWE list
      • Tag screen
    • πŸ—’οΈRelease notes
  • To be described
    • Documentation backlog
Powered by GitBook
On this page

Was this helpful?

  1. AppSec Portal
  2. Features
  3. Scanners
  4. Importing reports from scanners to AppSec Portal

Importing reports via Lambda Function using a Report File

To send scanning data to Appsec Portal

You have the capability to import reports into the AppsecPortal using the provided function below.

import json
import urllib.request
import urllib3


def import_report(<>):
    
    appsec_portal_api_token = "Token " + <
    
    while True:
        try:
            url = 'https://<>/api/v1/scan/import/'
            body = {
                "file": ("<>.json", json.dumps(<>)),
                "product_name": "<>",
                "product_type": "<>",
                "scanner_name": "<>",
                "branch": "", 
                "repository": "<>",
                "docker_image": "<>", 
                "domain": "<>", 
                "host": "<>"
            }
            data, header = urllib3.encode_multipart_formdata(body)
            r = urllib.request.Request(url, data=data)
            r.add_header('Authorization', appsec_portal_api_token)
            r.add_header('Content-Type', header)
            response = urllib.request.urlopen(r)
            print(response.getcode())
        except Exception as e:
            raise e
        break
    return {
        'statusCode': 200,
        'body': json.dumps('Event successfully imported')
    }

Replace the following parameters:

  • <event> with the name of your file containing report

  • <portal address> with the address of your Appsec Portal

  • <product name> with the name of your product

  • <product_type> with the name of your product type

  • <branch> (optional) with the the name of the branch in the source code repository (if applicable) This parameter is particularly useful when you want to associate the scan results with a specific branch in your repository. If not provided, the scan will be associated with the default branch

  • <repository>If your product is code in a repository enter the address of your repository in a specific format, for example: git@gitlab.com:whitespots-public/appsec-portal.git

  • <docker_image> If your product is image enter the address of the registry where your product is located, for example: registry.gitlab.com/whitespots-public/appsec-portal/back/auto_validator:latest

  • <domain> If your product is web enter the domain name of your product, for example: whitespots.io

  • <host> If your product is web enter the IP address of your product, for example: 0.0.0.0

Congratulations!πŸŽ‰ Your function is now ready to send reports to Appsec Portal

PreviousImporting reports via Terminal using a Report FileNextScanner description

Last updated 11 months ago

Was this helpful?

<appsec portal api key> with the key of your

<scanner name> with the

Asset information, if an is used

πŸ–₯️
🎯
πŸ”¬
πŸ”Œ
name of your scanner
auditor
authorization token