Docs

Docs

  • Getting Started
  • Features
  • Docs
  • API
  • FAQS

›Threat Intelligence

Getting Started

  • Introduction
  • Detections

Development

  • Quickstart
  • Concepts

Guides

  • First Analysis
  • Understanding analysis results
  • Select a specific Location
  • Select a specific Device
  • Configuring the Notification Service
  • Managing Custom Alert Rules
  • Create a Project
  • A closer look at the detection: Permission API
  • RTB Analysis

Threat Intelligence

  • Introduction
  • Odin
  • Endpoint
  • Authentication
  • Lookup
  • Violation Weight Map

Real-Time Blocking

  • Introduction
  • User Manual

GraphQL

  • Overview
  • Concepts
  • Forming Calls

Violation Weight Map

What is the Violation Weight Map?

The risk computation of a URL is based on the weight of each violation. The weight is a decimal number between 0 and 1. A weight of 0 completely discards the violation from the risk calculation, and a weight of 1 gives the violation the most importance.

While AdSecure provides a default violation weight map, this endpoint allows you to set your own weights and thus customize the calculus of the risk to your own needs.

Setting a custom Violation Weight Map

You need to be authenticated to use this method.

Method: POST

Path: /violation-weight-map

Body:

[
  { "login": "adware", "weight": 0 },
  { "login": "ssl-non-compliant", "weight": 0.9 }
]

cURL:

curl --request POST \
  -H "Content-Type: application/json" \
  -H 'Authorization: YOUR_API_KEY' \
  -d '[{"login":"adware","weight":0}]' \
  -v https://api.adsecure.com/threat-intelligence/v1/violation-weight-map

This method is an operation that updates your currently defined Violation Weight Map. Any value already present will be overwritten, and values that are absent will be inserted.

At any point, you may completely clear your user-defined Violation Weight Map by sending an empty array ([]) as the body instead. AdSecure will then rely on the default Violation Weight Map to compute the risk.

This method returns the standard response shape.

Fetching your Violation Weight Map

You need to be authenticated to use this method.

Method: GET

Path: /violation-weight-map

cURL:

curl --request GET \
  -H 'Authorization: YOUR_API_KEY' \
  -v https://api.adsecure.com/threat-intelligence/v1/violation-weight-map

This method returns the standard response shape.

Response shape

{
  "violationWeightMap": [
    {
      "login": "adware",
      "lastUpdatedAt": "2019-10-04T13:59:10Z",
      "weight": 0
    },
    {
      "login": "auto-click",
      "lastUpdatedAt": "",
      "weight": 0.2
    }
  ]
}

Both methods return the same response shape. It is an alphabetically sorted list of the user-defined weights for each violations, which was merged with the default violation weights.

In this example, the weight for adware was user defined as the time at which it was last updated is included. However, the weight for the auto-click violation was provided by default.

Please note that the violationWeightMap array in the example response shape has been truncated for readability. The actual array will contain an entry for each violation defined in the default violation weight map.

Default Violation Weight Map

AdSecure defines its default violation weight map as follow:

{
  "adware": 1,
  "auto-download": 1,
  "auto-sound": 0.8,
  "auto-redirect": 0.8,
  "auto-redirect-app-market": 0.8,
  "auto-vibrate": 0.8,
  "back-button-hijack": 0.8,
  "blacklist": 0.8,
  "browser-locker": 1,
  "cryptocurrency-miner": 1,
  "javascript-dialog-on-entry": 0.2,
  "javascript-dialog-on-exit": 0.2,
  "landing-page-error": 0.5,
  "malicious-url": 1,
  "malware": 1,
  "potentially-unwanted-programs": 1,
  "phishing-url": 1,
  "ransomware": 1,
  "scareware": 1,
  "ssl-non-compliant": 0.8,
  "uncommon-protocols": 0.8
}

Response status codes

Status codeMeaning
200Successful request, response payload with mentioned shape will be attached.

Troubleshooting

Status codeError messageSolution
400Bad RequestThe body of the request is not a valid JSON format.
401UnauthorizedEither the Authorization header is not sent or it has an incorrect value.
403ForbiddenAPI key doesn't have the correct permissions for the endpoint.
← LookupIntroduction →
  • What is the Violation Weight Map?
  • Setting a custom Violation Weight Map
  • Fetching your Violation Weight Map
  • Response shape
  • Default Violation Weight Map
  • Response status codes
  • Troubleshooting
Copyright © 2024 AdSecure