-
Notifications
You must be signed in to change notification settings - Fork 1
fix(COD-6066): hide the Lacework credentials from the running commands #251
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,22 +60,7 @@ export function getOptionalEnvVariable(name: string, defaultValue: string) { | |
| } | ||
|
|
||
| export async function callLaceworkCli(...args: string[]) { | ||
| const accountName = getRequiredEnvVariable('LW_ACCOUNT_NAME') | ||
| const apiKey = getRequiredEnvVariable('LW_API_KEY') | ||
| const apiSecret = getRequiredEnvVariable('LW_API_SECRET') | ||
| const expandedArgs = [ | ||
| '--noninteractive', | ||
| '--account', | ||
| accountName, | ||
| '--api_key', | ||
| apiKey, | ||
| '--api_secret', | ||
| apiSecret, | ||
| 'sca', | ||
| ...args, | ||
| ] | ||
| info('Calling lacework ' + expandedArgs.join(' ')) | ||
| await callCommand('lacework', ...expandedArgs) | ||
| await callCommand('lacework', '--noninteractive', 'sca', ...args) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how come the credentials no longer need passing?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because they are passed as environment. Before the changes, the workflow was setting the environment environment variables but not using them as such as it was overriding them with the |
||
| } | ||
|
|
||
| export function getOrDefault(name: string, defaultValue: string) { | ||
|
|
@@ -93,7 +78,7 @@ export function generateUILink() { | |
|
|
||
| if (targetBranch !== defaultBranch) return '' | ||
|
|
||
| let lwAccountName = process.env.LW_ACCOUNT_NAME | ||
| let lwAccountName = process.env.LW_ACCOUNT | ||
| lwAccountName = lwAccountName?.replace(/\.lacework\.net$/, '') | ||
|
|
||
| let url = | ||
|
|
@@ -102,8 +87,8 @@ export function generateUILink() { | |
| `github.com%2F${context.repo.owner}%2F${context.repo.repo}` + | ||
| `/${defaultBranch}` | ||
|
|
||
| if (process.env.LW_SUBACCOUNT_NAME) { | ||
| url += '?accountName=' + process.env.LW_SUBACCOUNT_NAME | ||
| if (process.env.LW_SUBACCOUNT) { | ||
| url += '?accountName=' + process.env.LW_SUBACCOUNT | ||
| } | ||
|
|
||
| return url | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for backward compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and it seems to work now. I am testing this on WebGoat.