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

RHIDP-1149: Enable Auto Logout feature by default, provide configuration options and documentation #944

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
7 changes: 6 additions & 1 deletion packages/app/src/components/AppBase/AppBase.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -27,6 +31,7 @@ const AppBase = () => {
<AppProvider>
<AlertDisplay />
<OAuthRequestDialog />
<AutoLogout />
<AppRouter>
<Root>
<FlatRoutes>
Expand Down
24 changes: 24 additions & 0 deletions showcase-docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
>
> -- <cite>[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)</cite>

### 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 |
Loading