22
33This project supports flexible branding through backend environment variables. The system uses ** default** branding and allows you to override specific elements as needed.
44
5- ## Quick Start
6-
7- ### Using Predefined Profiles
8-
9- ** Default branding:**
10- ``` bash
11- # Default profile - no additional flags needed
12- ./mvnw quarkus:dev
13- ```
14-
15- ** Custom organization branding:**
16- ``` bash
17- # Example using a custom profile (e.g., myorg)
18- ./mvnw quarkus:dev -Dquarkus.profile=myorg
19- ```
20-
21- ### Using Environment Variables (Alternative)
22- ``` bash
23- # Start development server (branding controlled by backend environment variables)
24- npm start
25- ```
26-
27- ### Production Build
28- ``` bash
29- # Build for production (branding controlled by backend environment variables)
30- npm run build
31- ```
32-
33- ## How It Works
34-
35- 1 . ** Backend Configuration** : Java backend reads ` BRANDING_XXX ` environment variables
36- 2 . ** Runtime Injection** : Branding configuration is passed to the React app through ` appData `
37- 3 . ** Component Usage** : React components read branding configuration from the app context
38- 4 . ** Default-First** : All defaults are set to standard values, specific brands override as needed
39-
40- ## Available Environment Variables
41-
42- Configure branding by setting these environment variables for the Java backend:
43-
44- ``` bash
45- # Brand identity
46- BRANDING_DISPLAY_NAME=Your Brand Name # Used for conditional logic and remediation title
47-
48- # Explore section
49- BRANDING_EXPLORE_URL=https://your-url.com # URL for "Take me there" button
50- BRANDING_EXPLORE_TITLE=Your Explore Title # Title for explore section
51- BRANDING_EXPLORE_DESCRIPTION=Your description text # Description text
52- ```
53-
54- ## Branding Logic
55-
56- The system uses ` displayName ` for all branding decisions:
57-
58- - ** Custom organization branding** : Uses the provided ` displayName ` (e.g., "MyOrg" shows "MyOrg Remediations")
59- - ** Default branding** : Used when no custom branding is configured
60-
61- ## Icon System
62-
63- The system uses a CSS-based icon override approach:
64-
65- - ** Default icon** : Built-in Trustify logo (PNG)
66- - ** Custom icons** : Organizations can override the default icon using CSS in their private projects
67-
68- ## Examples
69-
70- ### Method 1: Using Predefined Profile
71-
72- ** Default branding:**
73- ``` bash
74- # Default behavior (no profile needed)
75- ./mvnw quarkus:dev
76- ```
77-
78- ** Custom organization branding:**
79- ``` bash
80- # Example using a custom profile
81- ./mvnw quarkus:dev -Dquarkus.profile=myorg
82- ```
83-
84- ** Production builds with profiles:**
85- ``` bash
86- # Default production build
87- ./mvnw clean package
88-
89- # Custom organization production build
90- ./mvnw clean package -Dquarkus.profile=myorg
91- ```
92-
93- ### Method 2: Using Environment Variables
94-
95- ** Default Configuration (no environment variables needed):**
96- ``` bash
97- # No environment variables needed - uses default Trustify branding
98- ./mvnw quarkus:dev
99- ```
100-
101- ** Custom Organization Configuration:**
102- ``` bash
103- export BRANDING_DISPLAY_NAME=" MyOrg"
104- export BRANDING_EXPLORE_URL=" https://example.com/security-tools"
105- export BRANDING_EXPLORE_TITLE=" Learn about MyOrg Security"
106- export BRANDING_EXPLORE_DESCRIPTION=" Explore our comprehensive security analysis tools and vulnerability management platform."
107-
108- ./mvnw quarkus:dev
109- ```
110-
111- ## Backend Integration
112-
113- The branding configuration is handled using Quarkus ` @ConfigMapping ` :
114-
115- ** BrandingConfig.java:**
116- ``` java
117- @ConfigMapping (prefix = " branding" )
118- public interface BrandingConfig {
119- String displayName ();
120- String exploreUrl ();
121- String exploreTitle ();
122- String exploreDescription ();
123- }
124- ```
125-
126- ** ReportTemplate.java:**
127- ``` java
128- @Inject Optional<BrandingConfig > brandingConfig;
129-
130- // Only include branding config if it's present
131- brandingConfig. ifPresent(config - > params. put(" brandingConfig" , getBrandingConfigMap(config)));
132- ```
133-
134- The configuration is then passed to the frontend via the ` appData ` object in the Freemarker template.
135-
1365## Profile Configuration
1376
1387The branding profiles are defined in ` src/main/resources/application.properties ` :
@@ -143,15 +12,19 @@ branding.display.name=Trustify
14312branding.explore.url =https://guac.sh/trustify/
14413branding.explore.title =Learn more about Trustify
14514branding.explore.description =The Trustify project is a collection of software components that enables you to store and retrieve Software Bill of Materials (SBOMs), and advisory documents.
15+ branding.image.recommendation =
14616
14717# Example: Custom organization branding profile
14818%myorg.branding.display.name =MyOrg
14919%myorg.branding.explore.url =https://example.com/security-tools
15020%myorg.branding.explore.title =Learn about MyOrg Security
15121%myorg.branding.explore.description =Explore our comprehensive security analysis tools and vulnerability management platform.
22+ %myorg.branding.image.recommendation =Custom container image recommendations for enhanced security.
15223```
15324
154- ## Creating Custom Branding Profiles
25+ ## Examples
26+
27+ ### Method 1: Using Predefined Profile
15528
15629To create a new branding profile for your organization:
15730
@@ -162,6 +35,7 @@ To create a new branding profile for your organization:
16235 %myorg.branding.explore.url =https://your-org.com/security
16336 %myorg.branding.explore.title =Learn about Your Org Security
16437 %myorg.branding.explore.description =Your custom description here.
38+ %myorg.branding.image.recommendation =Your custom container image recommendation text.
16539 ```
16640
167412 . ** Use the profile** when running the application:
@@ -171,6 +45,19 @@ To create a new branding profile for your organization:
17145
172463 . ** Override icons in private projects** using CSS to provide custom organization icons
17347
48+ ### Method 2: Using Environment Variables
49+
50+ ** Custom Organization Configuration:**
51+ ``` bash
52+ export BRANDING_DISPLAY_NAME=" MyOrg"
53+ export BRANDING_EXPLORE_URL=" https://example.com/security-tools"
54+ export BRANDING_EXPLORE_TITLE=" Learn about MyOrg Security"
55+ export BRANDING_EXPLORE_DESCRIPTION=" Explore our comprehensive security analysis tools and vulnerability management platform."
56+ export BRANDING_IMAGE_RECOMMENDATION=" Custom container image recommendations for enhanced security."
57+
58+ ./mvnw quarkus:dev
59+ ```
60+
17461Environment variables will override profile settings if both are provided.
17562
17663## Custom Icon Implementation
@@ -202,6 +89,7 @@ Add to `/src/main/resources/application.properties`:
20289%myorg.branding.explore.url =https://myorg.com/security
20390%myorg.branding.explore.title =Learn about MyOrg Security
20491%myorg.branding.explore.description =Explore our comprehensive security analysis tools and vulnerability management platform.
92+ %myorg.branding.image.recommendation =Custom container image recommendations for enhanced security.
20593```
20694
20795** Step 4: Build with your changes**
0 commit comments