• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Cisco Umbrella

Enterprise network security

  • Contact Sales
  • Login
    • Umbrella Login
    • Cloudlock Login
  • Why Us
    • Why Cisco Umbrella
      • Why Try Umbrella
      • Why DNS Security
      • Why Umbrella SASE
      • Our Customers
      • Customer Stories
      • Why Cisco Secure
    • Fast Reliable Cloud
      • Global Cloud Architecture
      • Cloud Network Status
      • Global Cloud Network Activity
    • Unmatched Intelligence
      • A New Approach to Cybersecurity
      • Interactive Intelligence
      • Cyber Attack Prevention
      • Umbrella and Cisco Talos Threat Intelligence
    • Extensive Integrations
      • IT Security Integrations
      • Hardware Integrations
      • Meraki Integration
      • Cisco Umbrella and SecureX
  • Products
    • Cisco Umbrella Products
      • Cisco Umbrella Cloud Security Service
      • Recursive DNS Services
      • Cisco Umbrella SIG
      • Umbrella Investigate
      • What’s New
    • Product Packages
      • Cisco Umbrella Package Comparison
      • – DNS Security Essentials Package
      • – DNS Security Advantage Package
      • – SIG Essentials Package
      • – SIG Advantage Package
      • Umbrella Support Packages
    • Functionality
      • DNS-Layer Security
      • Secure Web Gateway
      • Cloud Access Security Broker (CASB)
      • Cloud Data Loss Prevention (DLP)
      • Cloud-Delivered Firewall
      • Cloud Malware Protection
      • Remote Browser Isolation (RBI)
    • Man on a laptop with headphones on. He is attending a Cisco Umbrella Live Demo
  • Solutions
    • SASE & SSE Solutions
      • Cisco Umbrella SASE
      • Secure Access Service Edge (SASE)
      • What is SASE
      • What is Security Service Edge (SSE)
    • Functionality Solutions
      • Web Content Filtering
      • Secure Direct Internet Access
      • Shadow IT Discovery & App Blocking
      • Fast Incident Response
      • Unified Threat Management
      • Protect Mobile Users
      • Securing Remote and Roaming Users
    • Network Solutions
      • Guest Wi-Fi Security
      • SD-WAN Security
      • Off-Network Endpoint Security
    • Industry Solutions
      • Government and Public Sector Cybersecurity
      • Financial Services Security
      • Cybersecurity for Manufacturing
      • Higher Education Security
      • K-12 Schools Security
      • Healthcare, Retail and Hospitality Security
      • Enterprise Cloud Security
      • Small Business Cybersecurity
  • Resources
    • Content Library
      • Top Resources
      • Cybersecurity Webinars
      • Events
      • Research Reports
      • Case Studies
      • Videos
      • Datasheets
      • eBooks
      • Solution Briefs
    • International Documents
      • Deutsch/German
      • Español/Spanish
      • Français/French
      • Italiano/Italian
      • 日本語/Japanese
    • Security Definitions
      • What is Secure Access Service Edge (SASE)
      • What is Security Service Edge (SSE)
      • What is a Cloud Access Security Broker (CASB)
      • Cyber Threat Categories and Definitions
    • For Customers
      • Support
      • Customer Success Webinars
      • Cisco Umbrella Studio
  • Trends & Threats
    • Market Trends
      • Hybrid Workforce
      • Rise of Remote Workers
      • Secure Internet Gateway (SIG)
    • Security Threats
      • How to Stop Phishing Attacks
      • Malware Detection and Protection
      • Ransomware is on the Rise
      • Cryptomining Malware Protection
      • Cybersecurity Threat Landscape
      • Global Cyber Threat Intelligence
    •  
    • Woman connecting confidently to any device anywhere
  • Partners
    • Channel Partners
      • Partner Program
      • Become a Partner
    • Service Providers
      • Secure Connectivity
      • Managed Security for MSSPs
      • Managed IT for MSPs
    •  
    • Person looking down at laptop. They are connecting and working securely
  • Blog
    • News & Product Posts
      • Latest Posts
      • Products & Services
      • Customer Focus
      • Feature Spotlight
    • Cybersecurity Posts
      • Security
      • Threats
      • Cybersecurity Threat Spotlight
      • Research
    •  
    • Register for a webinar - with illustration of connecting securely to the cloud
  • Contact Us
  • Umbrella Login
  • Cloudlock Login
  • Free Trial
Products & Services

Generating Iptables Rules With TrafficCop

Author avatar of Chris DorrosChris Dorros
Updated — October 15, 2020 • 3 minute read
View blog >

Today the OpenDNS engineering team is releasing Traffic Cop, a simple, open source tool to uncover to where your host is communicating, and help you write iptables rules. In a nutshell, it does three things:

  • Configures and enables logging of all inbound and outbound connection attempts (by default it looks for TCP SYN packets).
  • Generates a report showing the IPs and services of the peers the host is communicating with.
  • Generates iptables rules for each connection type.

Motivation

Let’s start with a quick example:
You have a fresh host for your new project and want to “lock it down.” You know it needs to talk to your database server and a few backend services, and that it will need inbound access from admins over SSH, plus web access for your clients. Writing the rules is not very easy either, but there are a few good tools out there for helping with that. You finalize your ruleset and put them in place. Everything works good for a few days, until your users can’t login because you forgot to enable access to your NTP (time) server, and the auth components need to stay in sync with time!
This is just one simple example, but the big picture is that in today’s fast-paced development world, where we’re building widgets using libraries built on top of other libraries, we don’t always know what our dependency chains looks like. This can make allow lists for security difficult, and sometimes a bit scary, as we want to do the right thing but not break anything.

How TrafficCop Helps

Let’s redo our example. This time we configure Traffic cop to log all connections on our server in a development/test environment (you probably don’t want to experiment in production). We let it run for a few days to get a good sense of the traffic. At the end of the learning phase, we’ve captured a rough baseline for the host. We review the rules it generated, select the ones that make sense, tweak the IP ranges as we see fit, and put them in place.
Note that we’re not just talking about inbound firewall rules here. We’re putting outbound rules in place too. This is traditionally an uncommon practice on host-based firewalls, as outbound traffic is typically more painful to classify and understand per application, but we’re using live data to drive the configuration, therefore we can take advantage of outbound traffic filtering. A blanket allowance of outbound traffic is one of the big drivers for malware to be primarily outbound focused (connecting back to “the mothership”), rather than attempting to communicate with the target inbound.

Demo Time!

We spin up a fresh EC2 instance, in a public subnet, using the default security groups (allows port 22 inbound from anywhere and all outbound).

SSH into the instance:

$ ./tcop enable
$ curl google.com (to show outbound log)

(waited about 5 minutes)

$ ./tcop report

Screen Shot 2015-08-31 at 3.39.27 PM
Screen Shot 2015-08-31 at 3.40.02 PM
That first inbound IP is us logging into the instance. The others are not! Notice that within just a few minutes we’re already getting IPs from around the world hitting our SSH port.

Great, How do I get Started?

Head over to the GitHub page for instructions on setting it up and generating reports. Contributions definitely welcome! Feel free to fork & feature requests! Hope you find it useful.

Suggested Blogs

  • Embrace SASE With Cisco February 28, 2023 3 minute read
  • Cisco Umbrella + Cisco Duo Are Better Together February 14, 2023 7 minute read
  • Cisco Enhances Cloud DLP With Unified Management and More December 8, 2022 3 minute read

Share this blog

FacebookTweetLinkedIn

Follow Us

  • Twitter
  • Facebook
  • LinkedIn
  • YouTube

Footer Sections

What we make

  • Cloud Security Service
  • DNS-Layer Network Security
  • Secure Web Gateway
  • Security Packages

Who we are

  • Global Cloud Architecture
  • Cloud Network Status
  • Cloud Network Activity
  • OpenDNS is now Umbrella
  • Cisco Umbrella Blog

Learn more

  • Webinars
  • Careers
  • Support
  • Cisco Umbrella Live Demo
  • Contact Sales
Umbrella by Cisco
208.67.222.222+208.67.220.220
2620:119:35::35+2620:119:53::53
Sign up for a Free Trial
  • Cisco Online Privacy Statement
  • Terms of Service
  • Sitemap

© 2023 Cisco Umbrella