Skip to content

Commit

Permalink
added bolt cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
raianand committed Apr 15, 2024
1 parent b536a51 commit 072649d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ async function run() {
await exec(`sudo chown ${boltUser}:${boltUser} /home/${boltUser}/mitmdump`)
await exec(`sudo cp bolt/intercept.py /home/${boltUser}/`)
await exec(`sudo chown ${boltUser}:${boltUser} /home/${boltUser}/intercept.py`)
const cwd = process.cwd()
core.info(`Current working directory: ${cwd}`)
core.saveState('boltCWD', cwd)
core.endGroup('download-executable')

benchmark('download-executable')
Expand Down
5 changes: 3 additions & 2 deletions src/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ async function generateSummary() {
const homeDir = core.getState('homeDir')
const boltUser = core.getState('boltUser')
const boltPID = core.getState('boltPID')
const boltCWD = core.getState('boltCWD')
const githubRunnerPID = core.getState('githubRunnerPID')

const egressRulesYAML = YAML.stringify(egressRules)
Expand All @@ -96,9 +97,9 @@ async function generateSummary() {
)
core.info(`Created bolt auditd log artifact with id: ${id} (bytes: ${size}`)

await exec(`chmod +x bolt/auparse`)
await exec(`chmod +x ${boltCWD}/bolt/auparse`)
await exec(
`./bolt/auparse -format=json -i -out bolt/audit.json /var/log/audit/audit.log `
`${boltCWD}/bolt/auparse -format=json -i -out bolt/audit.json /var/log/audit/audit.log `
)

await artifactClient.uploadArtifact('bolt-audit-json', ['audit.json'], 'bolt')
Expand Down

0 comments on commit 072649d

Please sign in to comment.