From 55bbebc896b126c16e6d4452482deb5f03bcb7d3 Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Thu, 1 Feb 2024 15:47:33 -0500 Subject: [PATCH 1/2] Enabling the Auto Logout feature by default with configurable options --- app-config.yaml | 7 +++++++ packages/app/src/components/AppBase/AppBase.tsx | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app-config.yaml b/app-config.yaml index 55644d53a0..7df5036b17 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -15,6 +15,13 @@ app: headerColor1: ${HEADER_DARK_COLOR_1} headerColor2: ${HEADER_DARK_COLOR_2} navigationIndicatorColor: ${NAV_INDICATOR_DARK_COLOR} + auth: + autologout: + enabled: ${AUTO_LOGOUT_ENABLED} + idleTimeoutMinutes: ${AUTO_LOGOUT_IDLE_TIMEOUT_MINUTES} + promptBeforeIdleSeconds: ${AUTO_LOGOUT_PROMPT_BEFORE_IDLE_SECONDS} + useWorkerTimers: ${AUTO_LOGOUT_USE_WORKER_TIMERS} + logoutIfDisconnected: ${AUTO_LOGOUT_LOGOUT_IF_DISCONNECTED} organization: name: ${ORGANIZATION_NAME} diff --git a/packages/app/src/components/AppBase/AppBase.tsx b/packages/app/src/components/AppBase/AppBase.tsx index 6f1a0b62d3..09a2addd53 100644 --- a/packages/app/src/components/AppBase/AppBase.tsx +++ b/packages/app/src/components/AppBase/AppBase.tsx @@ -1,5 +1,9 @@ import { FlatRoutes } from '@backstage/core-app-api'; -import { AlertDisplay, OAuthRequestDialog } from '@backstage/core-components'; +import { + AlertDisplay, + AutoLogout, + OAuthRequestDialog, +} from '@backstage/core-components'; import { ApiExplorerPage } from '@backstage/plugin-api-docs'; import { CatalogEntityPage, CatalogIndexPage } from '@backstage/plugin-catalog'; import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha'; @@ -27,6 +31,7 @@ const AppBase = () => { + From d5f379622299014c97480196c9139f261c689823 Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Thu, 1 Feb 2024 15:53:04 -0500 Subject: [PATCH 2/2] Adding documentation for Auto Logout being enabled by default and configuration options --- showcase-docs/getting-started.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/showcase-docs/getting-started.md b/showcase-docs/getting-started.md index 6e6bb79f2f..0cde942cdb 100644 --- a/showcase-docs/getting-started.md +++ b/showcase-docs/getting-started.md @@ -226,3 +226,27 @@ COMING SOON ## Deploying with ArgoCD COMING SOON + +## Secure by Default + +Our goal is to make this software **Secure by Default**, which means that the default configuration settings are the most secure possible, but not necessarily the most user-friendly. Here we will document the default security settings that have been enabled, our reasoning behind these choices and how to modify the options to fit your organizations needs. + +Please keep in mind that these are the recommended default settings for this application and that modifying these settings could adversely affect your attack surface. + +> **Secure by Default**, in software, means that the default configuration settings are the most secure settings possible, which are not necessarily the most user-friendly settings. In many cases, security and user-friendliness are evaluated based on both risk analysis and usability tests. This leads to the discussion of what the most secure settings are. As a result, the precise meaning of "secure by default" remains undefined. +> +> -- [Wikipedia contributors. "Secure by default." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 13 Jan. 2024. Web. 1 Feb. 2024.](https://en.wikipedia.org/wiki/Secure_by_default) + +### Auto Logout + +The [auto logout](https://backstage.io/docs/auth/autologout/) feature is an optional (but highly recommended) added security to Backstage, designed to automatically log out users after a preconfigured duration of inactivity. This capability helps to effectively mitigate the risks associated with unauthorized access through abandoned sessions, especially in shared device scenarios.feature is designed to automatically log out users after a pre-determined duration of inactivity. + +This feature is enabled by default in the `Backstage Showcase` application and can be configured by passing the following environment variables to backstage. + +| Name | Description | Allowed Values | Default Value | +| -------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------------- | ------------- | +| AUTO_LOGOUT_ENABLED | Enable/disable the feature | true/false | true | +| AUTO_LOGOUT_IDLE_TIMEOUT_MINUTES | Idle time (in minutes) after which the user is logged out | >= 0.5 | 60 | +| AUTO_LOGOUT_PROMPT_BEFORE_IDLE_SECONDS | The time (in seconds) before the user is logged out when a prompt will appear. `0` disables the prompt | >= 0 | 10 | +| AUTO_LOGOUT_USE_WORKER_TIMERS | Enables or disables the use of Node's worker thread timers instead of main thread timers | true/false | true | +| AUTO_LOGOUT_LOGOUT_IF_DISCONNECTED | Enable/disable auto logout for disconnected users | true/false | true |