Skip to content

Commit

Permalink
moved log upload to debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
raianand committed Apr 16, 2024
1 parent f8f1fd5 commit d9be9d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 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.
22 changes: 13 additions & 9 deletions dist/index.js

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

22 changes: 13 additions & 9 deletions src/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,27 @@ function resultToRow(result) {
}

async function generateSummary() {
const isDebugMode = process.env.DEBUG === 'true' ? 'true' : 'false'
const outputFile = core.getState('outputFile')
const homeDir = core.getState('homeDir')
const boltUser = core.getState('boltUser')

const egressRulesYAML = YAML.stringify(egressRules)

// Upload auditd log file to artifacts
const artifactClient = new DefaultArtifactClient()
const artifactName = 'bolt-auditd-log'
const files = ['/var/log/audit/audit.log']

const { id, size } = await artifactClient.uploadArtifact(
artifactName,
files,
'/var/log/audit'
)
core.info(`Created bolt auditd log artifact with id: ${id} (bytes: ${size}`)
if (isDebugMode === 'true') {
// Upload auditd log file to artifacts
const artifactName = 'bolt-auditd-log'
const files = ['/var/log/audit/audit.log']

const { id, size } = await artifactClient.uploadArtifact(
artifactName,
files,
'/var/log/audit'
)
core.info(`Created bolt auditd log artifact with id: ${id} (bytes: ${size}`)
}

await exec(
`${homeDir}/auparse -format=json -i -out audit.json -in /var/log/audit/audit.log `
Expand Down

0 comments on commit d9be9d4

Please sign in to comment.