Commit 4d53792
committed
Use build secret instead of COPY for RHSM credential script
Replace COPY of the RHSM credential script with
RUN --mount=type=secret so that credentials are never committed to an
image layer. Previously, the documented RHEL build flow would embed
plaintext RHSM_USER and RHSM_PASSWORD in the image layer history,
recoverable by anyone with pull access to the registry.
The Containerfile now mounts the script as a build secret and guards
execution with an existence check, so builds without RHSM (the default
CentOS/CI path) continue to work unchanged. The Makefile conditionally
passes --secret only when RHSM_SCRIPT is set.
Jira: OSPRH-32781
Signed-off-by: Steve Baker <sbaker@redhat.com>1 parent 134d282 commit 4d53792
3 files changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
0 commit comments