Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add crypto explanation for the stream gateway #123

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions explanation/cryptography/crypto_stream_gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(exp-security-crypto-stream-gateway)=
# Anbox Stream Gateway

Anbox Streaming Gateway is using cryptographic technology for:

* TLS transport encryption
* Mutual TLS based authentication
* Token based authentication

## TLS transport encryption

All network endpoints exposed by the Anbox Stream Gateway are secured with TLS using an 4096 bit RSA key. The Anbox Stream Gateway strictly enforces TLS 1.3 or later and does not provide backward compatibility with older TLS versions.

## Mutual TLS based authentication

To exchange messages with the Anbox Stream Agent through the [NATS](https://nats.io/) message queue, the Anbox Stream Gateway uses a CA certificate signed by a 4096 bit RSA key to ensure trust with the NATS server.

## Token based authentication

Users can generate API tokens to authenticate with the HTTP API provided by the Anbox Stream Gateway. For the API tokens, a scope-limited [Macaroon](http://theory.stanford.edu/~ataly/Papers/macaroons.pdf) is used. The token is signed with a [HMAC](https://www.okta.com/identity-101/hmac/) using SHA-256 (HS256) and a 64 byte secret key. The [`macaroon.New`](https://pkg.go.dev/gopkg.in/[email protected]#New) method is used internally to generate the [JWT](https://jwt.io/) token.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The macaroon.New method is used internally to generate the JWT token.

I wonder if this is necessary to include as this leaks internal implementation detail which might not be suitable for the nature of our product ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine. We reference the package we use already and drawing a conclusion to what method is used from it is straightforward.


## Packages used

* [Go standard library](https://pkg.go.dev/std)
* [`gopkg.in/macaroon.v2`](gopkg.in/macaroon.v2)
1 change: 1 addition & 0 deletions explanation/cryptography/landing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ This information is currently available for the following components:

crypto_ams
crypto_stream_agent
crypto_stream_gateway
crypto_dashboard
```
Loading