Commit Graph

17 Commits

Author SHA1 Message Date
Ryan Smith
540b0b940c threatfeed: Add honeypot log data statistics
This change adds the ability to view various statistics for honeypot log data. This includes views such as unique SSH usernames, unique HTTP paths, unique HTTP host headers, etc.

A new `/logs/{logtype}/{subtype}` route is added for rendering stats.
2025-04-07 16:40:18 -07:00
Ryan Smith
fd60dc89eb Add ability to monitor honeypot logs in realtime via WebSockets
This change adds support for WebSockets using Google's WebSocket package.

When the threat feed server is starting, a Go function is created to monitor honeypot log data via a channel. When log data is received on the channel, it is broadcast to all connected WebSocket clients.

A /live endpoint and handler is added for serving the live.html template. This page displays the log data in real time by utilizing WebSockets.

Updated the nav bar on all html pages to include the new 'Live' icon for accessing the realtime log.
2025-04-03 14:07:50 -07:00
Ryan Smith
6ba9f0acf5 Add ability to view the running configuration
This change adds a /config handler for displaying the Deceptifeed configuration. An icon is added to the nav bar for accessing the page.

- Add config.html template for displaying the Deceptifeed configuration.
- Add config.html supporting styles to style.css.
- Add /config http handler to render the config.html template.
- Add icon to nav bar for accessing /config page.
2025-03-27 13:26:52 -07:00
Ryan Smith
f72cf4ddba Use centralized stylesheet
This change removes the CSS sections from HTML templates and switches to using a single stylesheet at /css/style.css.
2025-03-19 19:55:14 -07:00
Ryan Smith
764188cf2b Require private IP when accessing log data 2025-03-18 09:40:58 -07:00
Ryan Smith
182262d474 Add ability to view honeypot logs from the threat feed server 2025-03-17 14:08:13 -07:00
Ryan Smith
1bde74187f Add nav bar and visual tweaks to management pages
- Add a horizontal navigation bar to the top of all management pages.
- Tweaks to colors and styling of management pages.
- Rename the endpoint '/threatfeed' to '/webfeed'.
- Rename the file 'htmlfeed.html' to 'webfeed.html'.
2025-03-09 10:08:05 -07:00
Ryan Smith
96b5be5758 Minor visual and structural revisions
- Remove the `/feed` endpoint, as this is already handled by `/plain`.
- Rename `/html` endpoint to `/threatfeed`.
- Add a `/docs` endpoint for displaying information on accessing the threat feed.
- Make the Deceptifeed logo smaller on HTML pages.
- Revise the layout of the initial homepage. Endpoint docs are now moved and linked to /docs.
- Remove `/html` from the list of threat feed endpoints in the docs, as it doesn't belong here (there is a link to the html threat feed on the home page).
2025-03-07 13:34:41 -08:00
Ryan Smith
99b9760830 Update threat feed server to receive full app config
This change updates the threat feed server so that the entire application config is passed in to the threat feed server. This allows the threat feed server to access its own configuration as well as the settings for each honeypot server and any other application-wide settings.
2024-12-30 10:39:01 -08:00
Ryan Smith
126577d842 Revise saveCSV routine
Refactor saveCSV to use a bufio.NewWriter and manually format CSV data rather than using the built-in CSV writer. This results in slightly better performance and memory usage when the threat feed is large (>500k entries).

Various miscellaneous changes:
- Rename `mutex` variable to `mu`.
- Lock the mutex in `loadCSV` because it accesses the iocData map.
2024-12-28 23:35:14 -08:00
Ryan Smith
b47d5278f4 Consilidate STIX endpoints to /stix
This change removes the /stix/indicators and /stix/observables endpoints and replaces them with a single /stix endpoint. The /stix endpoint returns the threat feed as STIX indicators.
2024-12-26 10:16:04 -08:00
Ryan Smith
f6a4f1ff5f Add default landing page and revise routes
This change adds a default landing page that is served when accessing the threat feed root URL. The landing page provides information about accessing the threat feed.

Move the template from handleHTML to the templates directory and embed using embed.FS.

Several changes to HTTP routes:
- Delete `/csv/ips` route and handler.
- Delete `/json/ips` route and handler.
- Rename `/stix2` route to `/stix/indicators`.
- Rename `/stix2/ips` route to `/stix/observables`.
- Change default route `/` to return 404 Not Found.
- Move plain text feed to `/feed` and `/plain` routes.
2024-11-26 08:59:29 -08:00
Ryan Smith
c952356879 Add support for serving the threat feed as a web page
- Add new route `/html` and associated handler for serving the threat feed as a web page for viewing in a browser.
- Revise sorting methods to apply a secondary sort by IP adddress when the values for the requested sort method are equal.
2024-11-21 17:48:55 -08:00
Ryan Smith
e442edf0aa Add support for serving the threat feed over TAXII 2.1
This change adds support for serving the threat feed over TAXII 2.1. The TAXII API is not yet fully implemented, but should work with most threat intelligence platforms.

Missing TAXII features:
- Mising `limit` query parameter.
- Missing `match` query parameter.
- Pagination is not supported.
- Missing `X-TAXII` headers.
- {api-root}/collections/{id}/manifest/
- {api-root}/collections/{id}/objects/{object-id}/
- {api-root}/collections/{id}/objects/{object-id}/versions/

- Add `internal\taxi\taxi.go` with struct definitions and helpers for TAXII resources.
- Move threat feed parsing functions from `handler.go` to `feed.go`.
- Add option functions for `prepareFeed` to allow sorting by last seen date and to filter by last seen date.
- Default timestamps to time.Now when initially loading feed data.
2024-11-16 21:51:43 -08:00
Ryan Smith
b7a9eaced2 Add support for serving the threat feed in STIX 2.1 format
This change adds support for serving the threat feed in a STIX 2.1 format using the `/stix2` and `/stix2/ips` routes.

- Add `handleSTIX2` function for the `/stix2` route. This returns the detailed threat feed structured as a STIX bundle containing *Indicator* objects for each IP address in the feed.
- Add `handleSTIX2Simple` handler for the `/stix2/ips` route. This returns the simplified threat feed structured as a STIX bundle with each IP address included as a STIX Cyber-observable Object (SCO).
- Add `util.go` with helper functions for creating STIX 2.1 identifiers. This includes a `newUUIDv5` function, a `newUUIDv4` function, and a `namespace` type.
2024-11-13 14:53:18 -08:00
Ryan Smith
55366a2cb3 Move ticker variable from global scope to local
This change moves the threat feed's time.Ticker to a local variable. Previously, the variable was mistakenly declared as global. The time interval for the ticker is now declared as a const.
2024-11-13 11:43:55 -08:00
Ryan Smith
8b49b6f042 Split threat feed code into separate files
- Rename database.go to data.go.
- Move data-related global vars from threatfeed.go to data.go.
- Split out functions from threatfeed.go into seperate files:
  - Move HTTP server functions to server.go.
  - Move HTTP handler functions to handler.go.
  - Move HTTP middleware functions to middleware.go.
- Rename hasMapChanged to dataChanged.
2024-11-13 11:28:36 -08:00