firewall: Add Host Firewall functionality

Controlled by BALENA_HOST_FIREWALL_MODE, the firewall can
either be 'on' or 'off'.

- In the 'off' state, all traffic is allowed.
- In the 'on' state, only traffic for the core services provided
  by Balena is allowed.

Change-type: patch
Signed-off-by: Rich Bayliss <rich@balena.io>
This commit is contained in:
Rich Bayliss
2020-06-15 17:46:33 +01:00
parent fc70b1c6f8
commit 28c5a44e71
17 changed files with 930 additions and 210 deletions

View File

@ -10,7 +10,6 @@ const mockedOptions = {
const VALID_SECRET = mockedAPI.STUBBED_VALUES.config.apiSecret;
const INVALID_SECRET = 'bad_api_secret';
const ALLOWED_INTERFACES = ['lo']; // Only need loopback since this is for testing
describe('SupervisorAPI authentication', () => {
let api: SupervisorAPI;
@ -20,11 +19,7 @@ describe('SupervisorAPI authentication', () => {
// Create test API
api = await mockedAPI.create();
// Start test API
return api.listen(
ALLOWED_INTERFACES,
mockedOptions.listenPort,
mockedOptions.timeout,
);
return api.listen(mockedOptions.listenPort, mockedOptions.timeout);
});
after(async () => {