Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[DAST] OWASP ZAP – Understand about Dynamic Application Security Testing

Posted on May 8, 2023August 29, 2023 By nim No Comments on [DAST] OWASP ZAP – Understand about Dynamic Application Security Testing

Contents

Toggle
  • Dynamic Application Security Testing
  • OWASP ZAP
  • ZAP – Ignore Content-type Warning.

Dynamic Application Security Testing

DAST looks for security vulnerabilities by simulating external attacks on an application while the application is running.

DAST test is performed in a dynamic environment.
SAST scans an application’s code line by line when the application is at rest. (SonarQube)
DAST has no access to an application’s source code, it detects security vulnerabilities by attacking the application externally.

DAST can be used in production, testing usually is carried out in a QA environment.
DAST is extremely good at finding externally visible issues and vulnerabilities. This includes a number of security risks from OWASP’s top ten, such as
– cross-site scripting, ·
– injection errors like SQL injection or command injection,
– path traversal, and ·
– insecure server configuration

OWASP ZAP

OWASP ZAP (Zed Attack Proxy) is an open-source web application security scanner.
ZAP is designed specifically for testing web applications. ZAP is what is known as a “man-in-the-middle proxy.

ZAP API Scan

It is tuned for performing scans against APIs defined by OpenAPI, SOAP, or GraphQL via either a local file or a URL.
It imports the definition that you specify and then runs an Active Scan against the URLs found.
The Active Scan is tuned to APIs, so it doesn’t bother looking for things like XSSS (Cross Site Scripting).
It also includes 2 scripts that:
– Raise alerts for any HTTP Server Error response codes.
– Raise alerts for any URLs that return content types that are not usually associated with APIs

Anh em can test

chmod 777 $(pwd)/owasp
sudo docker run -t -v $(pwd)/owasp/:/zap/wrk/:rw -u zap owasp/zap2docker-weekly zap-baseline.py -t https://tiki.vn -g gen.conf -r tiki_report.html

zap-baseline.py is a script provided by the OWASP ZAP project to run a baseline scan on a target web application. A baseline scan is a quick and simple scan that checks for common security vulnerabilities without performing any actual attacks. The purpose of the baseline scan is to provide a general overview of a web application’s security posture, rather than a comprehensive assessment.

Regarding other files, the OWASP ZAP project offers multiple scripts and tools to help you perform different types of scans and generate reports. Some of these include:

  1. zap-full-scan.py: A script for running a more comprehensive, full scan on a web application. This script takes longer to run and may be more intrusive than a baseline scan.
  2. zap-api-scan.py: A script for scanning web APIs for security vulnerabilities.
  3. zap_common.py: A common library used by other ZAP Python scripts.

You can find these scripts, along with additional documentation, in the OWASP ZAP GitHub repository. The repository also contains a variety of other resources, such as plugins, extensions, and sample configurations, to help you customize and enhance your ZAP experience.

ZAP – Ignore Content-type Warning.

Lần đâu tiên bạn chạy

sudo docker run -t -v $(pwd)/owasp/:/zap/wrk/:rw -u zap owasp/zap2docker-weekly zap-baseline.py -t https://hao-fe-to-do-app.devops-training.nimtechnology.com/ -g gen.conf -r devops-training.html

sẽ bị báo lỗi như sau:

WARN-NEW: Missing Anti-clickjacking Header [10020] x 1 
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/ (200 OK)
WARN-NEW: X-Content-Type-Options Header Missing [10021] x 8 
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/ (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/robots.txt (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/static/css/main.5f361e03.chunk.css (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/manifest.json (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/logo192.png (200 OK)
WARN-NEW: Strict-Transport-Security Header Not Set [10035] x 9 
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/ (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/sitemap.xml (404 Not Found)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/robots.txt (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/static/css/main.5f361e03.chunk.css (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/manifest.json (200 OK)
WARN-NEW: Server Leaks Version Information via "Server" HTTP Response Header Field [10036] x 9 
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/ (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/sitemap.xml (404 Not Found)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/static/css/main.5f361e03.chunk.css (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/robots.txt (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/manifest.json (200 OK)
WARN-NEW: Content Security Policy (CSP) Header Not Set [10038] x 1 
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/ (200 OK)
WARN-NEW: Permissions Policy Header Not Set [10063] x 3 
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/ (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/static/js/main.5cd4fcef.chunk.js (200 OK)
        https://hao-fe-to-do-app.devops-training.nimtechnology.com/static/js/2.2bb5c0f4.chunk.js (200 OK)

tiếp theo là bạn muốn ignore các warning trên:
Bước 1 bạn để ý nó generate 1 tên là: gen.conf
Bước 2 bạn copy file đó thành file ignore.conf

bạn muốn ignore Missing Anti-clickjacking Header có ID là: [10020]

Bạn Vi ignore.conf và tìm đến line có ID là 10020, sau đó chuyển chữ WARN sang IGNORE

rồi chạy lệnh:

sudo docker run -t -v $(pwd)/owasp/:/zap/wrk/:rw -u zap owasp/zap2docker-weekly zap-baseline.py -t https://hao-fe-to-do-app.devops-training.nim.com/ -g gen.conf -c ignore.conf -r devops-training.html

NGoài ra bạn còn 1 sự lựa chọn nữa là Arachni (Dynamic Analysis)

DevSecOps

Post navigation

Previous Post: [KubeSec] Security risk analysis for Kubernetes resources
Next Post: [Kubernetes Operations and Security] CIS Benchmarking and Kube-bench – Follow the best practice security recommendations for your Kubernetes.

More Related Articles

[DevSecOps] K8s Runtime Attack Scenarios Introduction DevSecOps
[DevSecOps] What is DevSecOps DevSecOps
[DevSecOps] Remove the secrets on Git. DevSecOps
[OPA Conftest] general-purpose policy engine DevSecOps
[DevSecOps] Dependency Check Basics and Vulnerabilities CI/CD
[Vulnerability] CVE-2024-6387 – Critical vulnerability in OpenSSH DevSecOps

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025
  • [tracetcp] How to perform a tracert command using a specific port. April 3, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.