Skip to content

Commit

Permalink
Continued stabilization for ASB v2 audit and remediation and the CI t…
Browse files Browse the repository at this point in the history
…est automation (#717)
  • Loading branch information
MariusNi authored Jun 12, 2024
1 parent d16fcc6 commit bf8da10
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/universalnrp-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ jobs:
sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/omi/lib/ pwsh -Command $script
ls -l
if command -v lsb_release &>/dev/null; then
[[ $(lsb_release -is) == "Ubuntu" ]] && sudo chmod 644 *testResults.xml
else
echo "lsb_release not found"
fi
stat *testResults.xml
- name: Stage OSConfig Logs
if: success() || failure()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/universalnrp-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
install-osconfig: ${{ matrix.install-osconfig }}
tag: ${{ matrix.target.tag }}

# See for more details: https://github.com/marketplace/actions/publish-test-results
report:
name: Report
needs: test
Expand Down
2 changes: 1 addition & 1 deletion src/common/asb/Asb.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ void AsbInitialize(void* log)

if (false == FileExists(g_etcFstabCopy))
{
if (false == MakeFileBackupCopy(g_etcFstab, g_etcFstabCopy, true, log))
if (false == MakeFileBackupCopy(g_etcFstab, g_etcFstabCopy, false, log))
{
OsConfigLogError(log, "AsbInitialize: failed to make a local backup copy of '%s'", g_etcFstab);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/commonutils/FileUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ int RenameFileWithOwnerAndAccess(const char* original, const char* target, void*

if (0 != GetFileAccess(target, &ownerId, &groupId, &mode, log))
{
OsConfigLogError(log, "RenameFileWithOwnerAndAccess: cannot read owner and access mode for original target file '%s', using defaults", target);
OsConfigLogInfo(log, "RenameFileWithOwnerAndAccess: cannot read owner and access mode for original target file '%s', using defaults", target);

ownerId = 0;
groupId = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/common/commonutils/SshUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ static int SaveRemediationToSshdConfig(void* log)
memset(newConfiguration, 0, newConfigurationSize);
snprintf(newConfiguration, newConfigurationSize, configurationTemplate, remediation, originalConfiguration);

if (true == SavePayloadToFile(g_sshServerConfiguration, newConfiguration, newConfigurationSize, log))
if (true == SecureSaveToFile(g_sshServerConfiguration, newConfiguration, newConfigurationSize, log))
{
OsConfigLogInfo(log, "SaveRemediationToSshdConfig: '%s' is now updated to include the following remediation values:\n---\n%s---", g_sshServerConfiguration, remediation);
status = 0;
Expand Down

0 comments on commit bf8da10

Please sign in to comment.