Skip to content

Logging Policy

mrblacyk edited this page Apr 24, 2020 · 2 revisions

Logging Policy

JSON structure

{
    "title": "Logging Policy #0001",
    "default": "Not configured",
    "volume": "Low",
    "description": "Description of the logging policy. Keep in min that it has to be valid JSON so any new lines have to be escaped \n",
    "eventID": [1, 4688],
    "references": ["https://duckduckgo.com/", "https://www.torproject.org/"],
    "configuration": "Again, any new lines have to escaped\n```\nsomecode\n```\n"
}

ATC Logging Policy yaml file

title: Logging Policy #0001
default: Not configured
volume: Low
description: >
  Description of the logging policy. Keep in min that it has to be valid JSON so any new lines have to be escaped

eventID:
  - 1
  - 4688
references:
    - https://duckduckgo.com/
    - https://www.torproject.org/
configuration: |
  Again, any new lines have to escaped
  ``
  somecode
  ``

Python snippet for inserting data

path_to_lp = "LP0001.yml"

with open(path_to_lp, 'r') as stream:
    lp = yaml.safe_load(stream)

r = requests.post(
    'http://127.0.0.1:8000/api/v1/atc/loggingpolicy/',
    json=lp,
    auth=('admin', 'admin')
)

Filters

There are two types of filters - exact match and contains. Here is the list of valid filters:

Contains

  • title_contains

Exact

  • title_exact
  • eventID_exact
  • volume_exact
Clone this wiki locally