apis are critical to security people - first · 2019-03-05 · -libraries-operating systems-remote...

28
APIs are critical to security people what I learned trying to discover useful APIs

Upload: others

Post on 25-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

APIs are critical to security

peoplewhat I learned trying to discover useful APIs

Page 2: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Motivation for that talk

- Working on Incident Response on a daily base

- Wide variety of tools in use

- Very important data is processed by Security people

- Developing / contribute some open source tools

Page 3: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Agenda

- What is an API?

- Why do IR teams need APIs?

- Requirements to an API?

- How I approached it?

- The Good

- The Bad

- The Ugly

- What can you do?

Page 4: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources
Page 5: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Types of APIs

- Libraries - Operating systems - Remote APIs

- Web APIs

Page 6: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Why do Security people need APIs

- Cyber requires different sources of information to ...

- Not one tool to rule them all

- Different destinations to prevent badness

- (Interact with Systems / devices)

Page 7: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Logs

Sandbox Sandbox Sandbox

Ticket

System

Virustotal Domaintools etc

Page 8: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Logs

Sandbox Sandbox Sandbox

Ticket

System

Virustotal Domaintools etc

API collection / metadata

Page 9: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

What is a good API?

Page 10: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Availability of API / interfaces

Page 11: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Documentation

Page 12: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Versioned API

Nothing bugs more than an API endpoint

change that breaks scripts / workflows

Page 13: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Sample data so people can play

Page 14: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Reference implementation

Page 15: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

RESTful

Makes it easier for everyone involved

Page 16: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

scalable

- API needs to grow

- give feedback of implemented rate limiting

Page 17: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Security built in

- encryption

- logging

- authentication

Page 18: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Pyramide of API

Sample Data

Versions

Documentation

Availability of an API

Page 19: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

How I approached it

- Wrote down every tool I used during a day

- Answered following questions- Am I the only one using the tool / database?

- Does the tool has an API?

- Where is the API documentation?

Page 20: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

The Good

- Virustotal

- Cuckoo

- New Misp API

Page 21: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

The Bad (with reasons)

- MISP (old Api)- API documented, but not 100 % accurate

- manual effort to keep it updated

- no samples for every endpoint available

- Timesketch- Api.py available

- No documentation

- No examples

- But: python api wrapper

Page 22: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

The Ugly

- Proxy provider had a public facing site

- Used an public facing API

- was discovered and documented

- was used among security people

- silently very hard rate limiting

Page 23: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

https://github.com/deralexxx/security-apis

Page 24: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

What can you do?

- make it a hard requirement for - every commercial security tool you

buy

- every security tool you develop

inhouse

- every security tool you contribute to

- contribute to the github

repository- tools you developed

- tools you use

- other tools

- Open issues for tools you use

with the vendor / developer

Page 25: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Q&A

Page 26: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Description

More and more Security tools are introduced in the cyber eco system which

increases the complexity dramatically. To combat that - there are basically

two ways to scale:

a) go for a “one tool to rule them all” approach

b) make use of APIs and connect them

For the option b the first step is to collect all tools that are available and discover

if and what APIs these tools have. During a period of several months, I did

that and open sources that list to github

(https://github.com/deralexxx/security-apis).

Weaponized with that list, it is easier for security folks to do an inventory of their

capabilities as well as requirements for future security tools to

Page 27: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

Requirements to an API

- documented- (available for everyone)

- Examples- sample files so it is not mandatory to install tool xyz to write an integration

- sample implementations to interact with the API

- security built in- encryption

- access control

- logging what was accessed

- ...

Page 28: APIs are critical to security people - FIRST · 2019-03-05 · -Libraries-Operating systems-Remote APIs-Web APIs. Why do Security people need APIs-Cyber requires different sources

TODO

API memes