diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..822d057 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + schedule: + # run CI every day even if no PRs/merges occur + - cron: '0 12 * * *' + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: make onesixtyone + - name: Test + run: | + sudo apt install -y snmpd + sudo /etc/init.d/snmpd restart + bash dotest.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 74ce7f2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -dist: trusty -sudo: required -language: c -compiler: - - clang - - gcc - -before_install: - - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- - - sudo apt-get -qq update - - sudo apt-get install -y snmpd - - sudo /etc/init.d/snmpd restart -script: - - make onesixtyone - - bash dotest.sh - -env: - global: - - secure: "abOgeVMbdhZ+jR89TO4OFmVhxP+hle56wHnP2er20YTt/BCBCJB2CfNm/+HMgxdtBdGgxYwFUBtPiun7sKecaZJlu1CA7G+1vcpHrm+TeJvBK9eiyA300ts591uc+qS0ugtSmt931kVzpN9HNeKQqgotWoFALCtmlCr28wRO//Q=" - -addons: - coverity_scan: - project: - name: "trailofbits/onesixtyone" - description: "Build submitted via Travis CI" - notification_email: dan@trailofbits.com - build_command: "make onesixtyone" - branch_pattern: coverity_scan diff --git a/README.md b/README.md index 0ebbc7c..5ce5c74 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ onesixtyone =========== -[![Build Status](https://travis-ci.org/trailofbits/onesixtyone.svg)](https://travis-ci.org/trailofbits/onesixtyone) -[![Coverity Scan Build Status](https://scan.coverity.com/projects/10906/badge.svg)](https://scan.coverity.com/projects/onesixtyone) +[![Build Status](https://img.shields.io/github/workflow/status/trailofbits/onesixtyone/CI/master)](https://github.com/trailofbits/onesixtyone/actions?query=workflow%3ACI) The SNMP protocol is a stateless, datagram oriented protocol. An SNMP scanner is a program that sends SNMP requests to multiple IP addresses, trying different community strings and waiting for a reply. Unfortunately SNMP servers don't respond to requests with invalid community strings and the underlying UDP protocol does not reliably report closed UDP ports. This means that 'no response' from the probed IP address can mean either of the following: @@ -25,7 +24,7 @@ COMPATIBLE - Software: Windows 2000 Version 5.0 (Build 2195 Uniprocessor Free) 192.168.112.64 [public] Power Macintosh, hardware type 406; MacOS 9.0; OpenTransport 2.5.2 192.168.104.254 [public] Novell NetWare 4.11 August 22, 1996 -192.168.112.83 [public] Macintosh Quadra 650, System Software 7.1 +192.168.112.83 [public] Macintosh Quadra 650, System Software 7.1 192.168.244.210 [public] RICOH Aficio 850 / RICOH Network Printer D model 192.168.240.39 [public] Cisco Systems WS-C5000 192.168.244.103 [public] HPJ3210A AdvanceStack 10BT Switching Hub Management diff --git a/dotest.sh b/dotest.sh index 9c67308..2ed4290 100755 --- a/dotest.sh +++ b/dotest.sh @@ -1,8 +1,13 @@ #!/bin/bash +pidof snmpd || { echo "snmpd not running?"; exit 1; } + result=$(./onesixtyone 127.0.0.1) + if [[ "$result" == *"public"* ]]; then echo "OK" exit 0 fi -exit 1 + +echo "FAIL" +exit 1