Git Product home page Git Product logo

hermes's Introduction

Hermes

CI Go Report Card GoDoc


Hermes is an audit trail service for OpenStack, originally designed for SAP's internal Openstack Cloud.

It is named after the Futurama character, not the Greek god.

The idea: Audit trail for OpenStack

OpenStack has an audit log through OpenStack Audit Middleware, but no way for customers to view these audit events. Hermes enables easy access to audit events on a tenant basis, relying on the ELK stack for storage. Now cloud customers can view their project level audit events through an API, or as a module in Elektra, an OpenStack Dashboard.

Use Cases

The Audit log can be used by information auditors or cloud based audit APIs to track events for a resource in a domain or project. Support teams can validate when customers communicate problems with cloud services, verify what occurred, and view additional detail about the customer issue.

Hermes enables customer access for audit relevant events that occur from OpenStack in an Open Standards CADF Format.

Dependencies

  • OpenStack
  • OpenStack Audit Middleware - To Generate audit events in a WSGI Pipeline
  • RabbitMQ - To queue audit events from Openstack
  • Logstash - To transform and route audit events
  • Elasticsearch or Opensearch - To store audit events for the API to query

Installation

To install Hermes, you can use the Helm charts available at SAPCC Helm Charts. These charts provide a simple and efficient way to deploy Hermes in a Kubernetes cluster.

In addition to the Helm charts, you can also use the following related repositories and projects to further customize and integrate Hermes into your OpenStack environment:

Related Repositories:

Related Projects:


Features

  • A managed service for Auditing in OpenStack: A service that provides a central repository for all audit events in OpenStack, making it easy to access and analyze these events for compliance, security and troubleshooting purposes.
  • OpenStack Identity v3 authentication and authorization: Allows for the use of OpenStack's built-in identity service for authenticating and authorizing users and groups to access audit events, ensuring that only authorized users have access to sensitive audit information and to comply with regulatory requirements for data access control.
  • Project and domain-level access control (scoping): Allows you to specify which events a user or group of users can view based on the project and domain they belong to, useful for multi-tenant environments where different projects and domains have different levels of access and visibility to audit events. Ensures that only authorized users have access to sensitive audit information and to comply with regulatory requirements for data access control.
  • Compatible with other cloud based audit APIs: Hermes allows for integration with other cloud-based audit APIs, which enables customers to use their existing audit tools and processes with OpenStack.
  • Exposed Prometheus metrics: Allows for monitoring and alerting of key metrics and events, enabling customers to quickly identify and troubleshoot issues with their OpenStack environment.
  • HermesCLI for querying events: A command line interface that enables customers to easily query and filter audit events, allowing them to quickly find and analyze relevant events.

Supported Services

Documentation

For users

For operators

For Audit Clients submitting events

For detailed usage, refer to the documentation provided in doc.go within the audittools package. This includes examples on how to generate audit events and publish them to a RabbitMQ server.

hermes's People

Contributors

dhague avatar edda avatar kayrus avatar kuckkuck avatar majewsky avatar notque avatar renovate-bot avatar renovate[bot] avatar supersandro2000 avatar talal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hermes's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Renovate: Update github.com/sapcc (github.com/sapcc/go-api-declarations, github.com/sapcc/go-bits)
  • Renovate: Update module github.com/gophercloud/gophercloud to v1.14.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Vulnerabilities

Renovate has not found any CVEs on osv.dev.

Detected dependencies

github-actions
.github/workflows/checks.yaml
  • actions/checkout v4
  • actions/setup-go v5
  • golang/govulncheck-action v1
  • reviewdog/action-misspell v1
.github/workflows/ci.yaml
  • actions/checkout v4
  • actions/setup-go v5
  • golangci/golangci-lint-action v6
  • actions/checkout v4
  • actions/setup-go v5
.github/workflows/codeql.yaml
  • actions/checkout v4
  • actions/setup-go v5
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
gomod
go.mod
  • go 1.22
  • github.com/databus23/goslo.policy v0.0.0-20210929125152-81bf2876dbdb@81bf2876dbdb
  • github.com/google/uuid v1.6.0
  • github.com/gophercloud/gophercloud v1.13.0
  • github.com/gorilla/mux v1.8.1
  • github.com/jinzhu/copier v0.4.0
  • github.com/olivere/elastic/v7 v7.0.32
  • github.com/pkg/errors v0.9.1
  • github.com/prometheus/client_golang v1.19.1
  • github.com/rs/cors v1.11.0
  • github.com/sapcc/go-api-declarations v1.11.3
  • github.com/sapcc/go-bits v0.0.0-20240718093810-9d9ecb2e98b2@9d9ecb2e98b2
  • github.com/spf13/viper v1.19.0
  • github.com/stretchr/testify v1.9.0

  • Check this box to trigger a request for Renovate to run again on this repository

Migrate to ES cluster and increase data retention

In order to support the growth in audit logs, we have to migrate existing Hermes ES from single instance to cluster.

In the cluster, we want to enable sharding and increase the data retention to at least 6 months better 1 year if possible (as requested by Team Core API and Services).

Add resource names into the event

As for now most of the resource types contain only ID (e.g. server id, security group id, etc), but there are no names available.

How expensive is it to resolve names on the hermes server side or does it make sense to do this on the client side?

GetEvent can fail due to mappings/tokenization

GetEvent seems to fail in a variety of ways due to the mapping used.

Need to see if there is some mapping setup that can avoid this issue. using .raw was the initially working attempt, tried using .keyword instead.

This ultimately involves UUIDs and their tokenization

Details to events API

We want to enable the events api to add additional details if requested. This is partially fleshed out and in the code base, but not functioning in practice. Need to find the bug and correct.

Implement Prom Instrumentation

Created a branch for implementing prom on metrics endpoint. Still working on it, but first pieces are together with some small reorganization.

Support Cross-Project Requests

Support specifying a target project/domain in all API operations, so that a cloud-admin view, accessing multiple projects with the same Keystone token, is possible.

Max Limit for ES Queries is limited to 10k. Can we increase?

The current max limit for ES Queries configured for Hermes and the Elasticsearch instances are 10k (the default).

Increase the number will increase memory usage in the Elasticsearch, but many projects/domains contain over 10k events.

The long term solution will be to change the API. In the short term we can attempt increasing that limit to 20k for example (or more), and validate the stability.

Implement GoMock to improve testing

Our current situation of Dummy testing does not catch most bugs, as there isn't much happening but testing if the mock returns properly.

Move over to GoMock and unit test each individual query param. Use Maia as a guide, which has already implemented GoMock.

Add Max Depth parameter for hirearchical values

Several values within the audit events are hirearchical. Ex. update/add/interface

For getting Unique attributes, there should be the option to add a max_depth parameter of "1-3" to return all unique events that contain update/

This will also require that listing events will take globs, so that if you query unique attributes for update, you can then send action=update* to return the events that match the update query.

New parameter, new unique accepting parameter, new elastic call for handling that.
New events list handling, and elastic call for the glob.

EventTime Format doesn't match spec

current - 2017-07-20T13:43:38.368933+0000
desired - 2017-07-20T13:43:38.368933+00:00

check what the value is in kibana, if it's fine in kiabana, problem is likely in json translation to type.

if it's not fine in kibana, then either it needs changed on openstack middleware side, or just replaced as the return value for the api.

Tests aren't found when running make

Tests exist, but they are not found when running make

▶ running tests…
? github.com/sapcc/hermes [no test files]

Need to correct. Ideally that will work towards automatic coverage checks working as well.

Replace Depricated olivere's golang es client

Olivere will no longer work on the golang client, to upgrade to ES 8 we need to upgrade the client.

There is also a question of moving to opensearch.

Evaluate both golang clients, and determine what includes the features we use, and makes the most sense.

Support Hierarchical Projects

When the target project/domain has child-projects, the API calls cascade to the child-projects, so that the audit-viewer of the main project does not have to traverse all the child-projects.

When called against the main project, the API act like the child-projects had been merged with the main project. That means that the /events call returns all the events of child-projects. Likewise the /attributes API returns existing unique values in not only the main but also the child projects.

Fix all Golint errors

Fix all Golint errors, a lot have built up over time. All of them need to be corrected.

Working on it.

Could not load attributes if no events

Narrow use case, but reported that if you check for the attributes for a project with no events, it returns "Could not load attributes"

May not even be a Hermes issue, may be with the dashboard.

Add search over entire event

I believe this should be possible, I will have to check, but it would add value to customers and internal stakeholders to implement a search across the entire event to do things like search within attachments.

Hermes API crashes, when attributes are requested from an empty index

2019/11/20 13:34:14 [DEBUG] OpenStack Request URL: GET https://hermes/v1/attributes/initiator_name
2019/11/20 13:34:14 [DEBUG] OpenStack Request Headers:
Accept: application/json
User-Agent: gophercloud/2.0.0
X-Auth-Token: ***
2019/11/20 13:34:15 [DEBUG] OpenStack Response Code: 502
2019/11/20 13:34:15 [DEBUG] OpenStack Response Headers:
Content-Length: 173
Content-Type: text/html
Date: Wed, 20 Nov 2019 12:34:15 GMT
Server: nginx/1.15.3
Strict-Transport-Security: max-age=15724800; includeSubDomains
2019/11/20 13:34:15 [DEBUG] Not logging because OpenStack response body isn't JSON
Error: Failed to list attributes: Expected HTTP response code [200 204 300] when accessing [GET https://hermes/v1/attributes/initiator_name], but got 502 instead
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.15.3</center>
</body>
</html>

https://gist.github.com/kayrus/d345f91280f06b1a5966c46cbf1d29cf

/cc @DRichardt

Log user token details

Considering an amount of auth methods it would be useful to log keystone token details along with the event details.
It would be useful to list an auth method, token roles, when the token was issued, when it will expire, audit IDs, etc.

Add instrumentation on audit events from store

Would be nice to have prom metrics on the total number of events, and maybe the number of different types of events.

Will need to flesh this out more, and of what would be of value.

Limit for attributes is applied before the max-depth filter

Examples:

$ hermesctl attributes action -l5
update
update/add/security-group
create
delete
create/role_assignment
$ hermesctl attributes action --max-depth 1 -l 3
update
create
$ hermesctl attributes action  --max-depth 2 -l 3
update
update/add
create
$ hermesctl attributes action --max-depth 1 -l 10
update
create
delete
read
$ hermesctl attributes action --max-depth 1
update
create
delete
read
stop
allow
disable
deny
restore
start

I assume that the limit should be applied after the max-depth filter.

Sort isn't working on all fields

Seems to work on time, but not other query params. This is likely due to tokenization and the use of .raw fields at various points. The sort fields need to consistently use the same name. Different areas add it in different ways, so standardize it, and improve.

Rate Limiting for Hermes API

Adding the new full text search feature, it will have a much higher compute/memory impact. We will need to implement rate limiting to help handle these issues in the future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.