CompTIA XK0-006 Practice Test 70
Question 690
During a planned automation rollout to a Linux fleet, An AI-generated deployment recipe imports an unfamiliar library without verifying its license or maintenance status, creating a release compliance risk. The operator must identify the affected mechanism before approving changes to other services. Which TWO choices form the decisive diagnosis AND targeted remediation? Select TWO.
- Run software composition/licensing review and choose an approved maintained dependency before incorporating the generated code.
- Send SIGTERM or use the service's supported graceful stop first, with time-limited escalation only if it does not exit.
- Compare pip-resolved package versions, Python interpreter version and the versioned dependency lock or requirements specification.
- Inspect exact dependency identity, version, transitive licenses, source provenance and vulnerability notices.
- Review and restrict AI-generated commands to known intended targets, test in a sandbox and apply with least privilege only after verification.
Explanation
Correct Answers
A:Run software composition/licensing review and choose an approved maintained dependency before incorporating the generated code. Generated code can introduce third-party obligations; provenance and license validation are necessary even when the code runs. Pair it with the supporting check: Inspect exact dependency identity, version, transitive licenses, source provenance and vulnerability notices.
D:Inspect exact dependency identity, version, transitive licenses, source provenance and vulnerability notices. Generated code can introduce third-party obligations; provenance and license validation are necessary even when the code runs. Pair this evidence with the targeted change: Run software composition/licensing review and choose an approved maintained dependency before incorporating the generated code.
Incorrect Answers
B:Send SIGTERM or use the service's supported graceful stop first, with time-limited escalation only if it does not exit. This choice concerns graceful process shutdown signal rather than the required diagnosis-and-change pair for ai-generated dependency licensing review. Compare the needed evidence (Inspect exact dependency identity, version, transitive licenses, source provenance and vulnerability notices.) with the repair (Run software composition/licensing review and choose an approved maintained dependency before incorporating the generated code.).
C:Compare pip-resolved package versions, Python interpreter version and the versioned dependency lock or requirements specification. This choice concerns python dependency lock reproducibility rather than the required diagnosis-and-change pair for ai-generated dependency licensing review. Compare the needed evidence (Inspect exact dependency identity, version, transitive licenses, source provenance and vulnerability notices.) with the repair (Run software composition/licensing review and choose an approved maintained dependency before incorporating the generated code.).
E:Review and restrict AI-generated commands to known intended targets, test in a sandbox and apply with least privilege only after verification. This choice concerns ai-generated shell command validation rather than the required diagnosis-and-change pair for ai-generated dependency licensing review. Compare the needed evidence (Inspect exact dependency identity, version, transitive licenses, source provenance and vulnerability notices.) with the repair (Run software composition/licensing review and choose an approved maintained dependency before incorporating the generated code.).
Question 691
During a compliance review of a production Linux endpoint, A web service is accessible from an untrusted VLAN because a NIC was placed in the wrong firewalld zone. The operator must identify the affected mechanism before approving changes to other services. How should the administrator correct the underlying configuration rather than mask the symptom?
- Insert a tightly scoped
ct state established,related accept rule ahead of the default drop while preserving explicit inbound allow policy. - Configure
pam_faillock using the distribution's supported PAM profile tool with the approved retry and unlock thresholds. - Enable appropriate Bash pipeline failure propagation and check return codes before marking backups successful.
- Attach the NIC to the correct persistent restrictive zone and allow only the approved service and source rules.
Explanation
Correct Answer
D:Attach the NIC to the correct persistent restrictive zone and allow only the approved service and source rules. This action corrects firewalld zone and interface binding without substituting an unrelated change. Firewalld evaluates interfaces/sources within zones; service rules in the wrong zone can expand access unexpectedly. Before acting, verify: Check firewall-cmd --get-active-zones, interface associations, runtime and permanent zone rules, and active listeners. Afterward confirm: Traffic from approved sources succeeds while a probe from the untrusted VLAN is denied after firewalld reload. Scenario context: During a compliance review of a production Linux endpoint, A web service is accessible from an untrusted VLAN because a NIC was placed in the wrong firewalld zone. The operator must identify the affected mechanism before approving changes to other services.
Incorrect Answers
A:Insert a tightly scoped ct state established,related accept rule ahead of the default drop while preserving explicit inbound allow policy. This is a change associated with stateful nftables established connections, not a targeted repair of firewalld zone and interface binding. The described signal instead calls for: Attach the NIC to the correct persistent restrictive zone and allow only the approved service and source rules. Scenario context: During a compliance review of a production Linux endpoint, A web service is accessible from an untrusted VLAN because a NIC was placed in the wrong firewalld zone. The operator must identify the affected mechanism before approving changes to other services.
B:Configure pam_faillock using the distribution's supported PAM profile tool with the approved retry and unlock thresholds. This is a change associated with pam failed-login lockout configuration, not a targeted repair of firewalld zone and interface binding. The described signal instead calls for: Attach the NIC to the correct persistent restrictive zone and allow only the approved service and source rules. Scenario context: During a compliance review of a production Linux endpoint, A web service is accessible from an untrusted VLAN because a NIC was placed in the wrong firewalld zone. The operator must identify the affected mechanism before approving changes to other services.
C:Enable appropriate Bash pipeline failure propagation and check return codes before marking backups successful. This is a change associated with pipeline exit status propagation, not a targeted repair of firewalld zone and interface binding. The described signal instead calls for: Attach the NIC to the correct persistent restrictive zone and allow only the approved service and source rules.
Question 692
While reproducing a service change on a separately provisioned Linux integration host, Disk free space stays low after a huge log was removed because the writing daemon still has an open descriptor to the deleted inode. The change must be repeatable and must not rely on broad permissions or bypassed safeguards. Which check most directly tests the fault described in this case?
- Inspect the application's
sys.executable, active Python environment, pip show paths and dependency requirements. - Review
find predicates for -type f, the desired -mtime or -mmin boundary, and target path depth. - Check
getent passwd for a central account, sssctl or SSSD logs, DNS SRV resolution and the SSSD domain configuration. - Compare
df -h, du, and lsof +L1 for an open deleted file held by a running process.
Explanation
Correct Answer
D:Compare df -h, du, and lsof +L1 for an open deleted file held by a running process. This checks the mechanism behind open deleted log consumes disk. An unlinked file occupies storage until its last open file descriptor is closed. Once identified, the targeted correction is: Rotate or reopen the daemon's log descriptor using its supported reload mechanism and verify the deleted inode is released. Confirm by checking: lsof +L1 no longer shows the old deleted log and df reflects recovered blocks without losing active logging. Scenario context: While reproducing a service change on a separately provisioned Linux integration host, Disk free space stays low after a huge log was removed because the writing daemon still has an open descriptor to the deleted inode. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Incorrect Answers
A:Inspect the application's sys.executable, active Python environment, pip show paths and dependency requirements. This can investigate python application isolation from os packages, but the given incident points to open deleted log consumes disk. It is not the most decisive first evidence here. The discriminating test is: Compare df -h, du, and lsof +L1 for an open deleted file held by a running process. Scenario context: While reproducing a service change on a separately provisioned Linux integration host, Disk free space stays low after a huge log was removed because the writing daemon still has an open descriptor to the deleted inode. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
B:Review find predicates for -type f, the desired -mtime or -mmin boundary, and target path depth. This can investigate find modified files without broad recursion, but the given incident points to open deleted log consumes disk. It is not the most decisive first evidence here. The discriminating test is: Compare df -h, du, and lsof +L1 for an open deleted file held by a running process. Scenario context: While reproducing a service change on a separately provisioned Linux integration host, Disk free space stays low after a huge log was removed because the writing daemon still has an open descriptor to the deleted inode. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
C:Check getent passwd for a central account, sssctl or SSSD logs, DNS SRV resolution and the SSSD domain configuration. This can investigate sssd central identity lookup, but the given incident points to open deleted log consumes disk. It is not the most decisive first evidence here. The discriminating test is: Compare df -h, du, and lsof +L1 for an open deleted file held by a running process. Scenario context: While reproducing a service change on a separately provisioned Linux integration host, Disk free space stays low after a huge log was removed because the writing daemon still has an open descriptor to the deleted inode. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Question 693
During a forensic reproduction of the fault at a secondary Linux test site, A Linux host enters emergency mode after a new noncritical network mount was added to /etc/fstab without handling remote availability. The change must be repeatable and must not rely on broad permissions or bypassed safeguards. How should the administrator correct the underlying configuration rather than mask the symptom?
- Install or rebuild a compatible signed module for the running kernel and update early-boot image if the device is required for root.
- Correct the mount configuration, adding appropriate network-dependent handling or
nofail where business rules allow, and test with mount -a. - Address the memory working-set pressure by fixing excess allocation or adjusting justified capacity/limits, without indiscriminately disabling swap.
- Restore reachable approved identity servers and correct SSSD domain/name-service integration, then clear stale cache only if justified.
Explanation
Correct Answer
B:Correct the mount configuration, adding appropriate network-dependent handling or nofail where business rules allow, and test with mount -a. This action corrects corrupted fstab mount at boot without substituting an unrelated change. A required mount that fails during boot can block normal startup; mount dependency and failure semantics should reflect criticality. Before acting, verify: Inspect boot journal and systemctl --failed for the mount unit plus fstab options and network reachability. Afterward confirm: The host boots to the intended target when the remote share is absent, while the mount can still be accessed when available. Scenario context: During a forensic reproduction of the fault at a secondary Linux test site, A Linux host enters emergency mode after a new noncritical network mount was added to /etc/fstab without handling remote availability. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Incorrect Answers
A:Install or rebuild a compatible signed module for the running kernel and update early-boot image if the device is required for root. This is a change associated with missing storage driver after kernel update, not a targeted repair of corrupted fstab mount at boot. The described signal instead calls for: Correct the mount configuration, adding appropriate network-dependent handling or nofail where business rules allow, and test with mount -a. Scenario context: During a forensic reproduction of the fault at a secondary Linux test site, A Linux host enters emergency mode after a new noncritical network mount was added to /etc/fstab without handling remote availability. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
C:Address the memory working-set pressure by fixing excess allocation or adjusting justified capacity/limits, without indiscriminately disabling swap. This is a change associated with swapping-induced application latency, not a targeted repair of corrupted fstab mount at boot. The described signal instead calls for: Correct the mount configuration, adding appropriate network-dependent handling or nofail where business rules allow, and test with mount -a. Scenario context: During a forensic reproduction of the fault at a secondary Linux test site, A Linux host enters emergency mode after a new noncritical network mount was added to /etc/fstab without handling remote availability. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
D:Restore reachable approved identity servers and correct SSSD domain/name-service integration, then clear stale cache only if justified. This is a change associated with sssd central identity lookup, not a targeted repair of corrupted fstab mount at boot. The described signal instead calls for: Correct the mount configuration, adding appropriate network-dependent handling or nofail where business rules allow, and test with mount -a. Scenario context: During a forensic reproduction of the fault at a secondary Linux test site, A Linux host enters emergency mode after a new noncritical network mount was added to /etc/fstab without handling remote availability. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Question 694
During an ordinary maintenance shift on a multi-user Linux service host, An audit must list regular files modified in the last day under a controlled tree, but a broad ls -R scan mixes directories and timestamps incorrectly. The operator must identify the affected mechanism before approving changes to other services. Which outcome provides the strongest confirmation that the intended behavior is restored?
lsof +L1 no longer shows the old deleted log and df reflects recovered blocks without losing active logging.- Password authentication for the account is blocked while the account UID and home files remain intact for retention.
- A controlled set of files at known modification times yields the expected in-scope list only.
- A test boot locates the root block device before pivoting to the real root, and no missing-controller module error remains.
Explanation
Correct Answer
C:A controlled set of files at known modification times yields the expected in-scope list only. This is direct acceptance evidence for find modified files without broad recursion rather than a generic process check. find selects file type and timestamps using explicit predicates; recursive ls output is unsuitable for precise time filtering. It validates the correction: Use a narrowly scoped find command with explicit file type and modification-time predicate, safely printing selected paths. Scenario context: During an ordinary maintenance shift on a multi-user Linux service host, An audit must list regular files modified in the last day under a controlled tree, but a broad ls -R scan mixes directories and timestamps incorrectly. The operator must identify the affected mechanism before approving changes to other services.
Incorrect Answers
A:lsof +L1 no longer shows the old deleted log and df reflects recovered blocks without losing active logging. This outcome would support open deleted log consumes disk, but does not establish that the reported find modified files without broad recursion problem is resolved. The required direct acceptance test is: A controlled set of files at known modification times yields the expected in-scope list only. Scenario context: During an ordinary maintenance shift on a multi-user Linux service host, An audit must list regular files modified in the last day under a controlled tree, but a broad ls -R scan mixes directories and timestamps incorrectly. The operator must identify the affected mechanism before approving changes to other services.
B:Password authentication for the account is blocked while the account UID and home files remain intact for retention. This outcome would support local account lock versus password expiration, but does not establish that the reported find modified files without broad recursion problem is resolved. The required direct acceptance test is: A controlled set of files at known modification times yields the expected in-scope list only. Scenario context: During an ordinary maintenance shift on a multi-user Linux service host, An audit must list regular files modified in the last day under a controlled tree, but a broad ls -R scan mixes directories and timestamps incorrectly. The operator must identify the affected mechanism before approving changes to other services.
D:A test boot locates the root block device before pivoting to the real root, and no missing-controller module error remains. This outcome would support rebuilding early-boot driver inventory, but does not establish that the reported find modified files without broad recursion problem is resolved. The required direct acceptance test is: A controlled set of files at known modification times yields the expected in-scope list only. Scenario context: During an ordinary maintenance shift on a multi-user Linux service host, An audit must list regular files modified in the last day under a controlled tree, but a broad ls -R scan mixes directories and timestamps incorrectly. The operator must identify the affected mechanism before approving changes to other services.
Question 695
During validation of an authorized change at a primary-site Linux operations cluster, An automation script redirects only standard output to a diagnostic file, so an important command failure appears only in the unattended job log. The operator must identify the affected mechanism before approving changes to other services. Which controlled change is the most appropriate next step after verifying this failure?
- Redirect both standard output and standard error explicitly using supported shell syntax, such as
>job.log 2>&1, while checking the exit status. - Set a supported end-to-end MTU for the affected host interface and overlay path while retaining appropriate PMTUD behavior.
- Parse the intended column with an appropriate
awk -F expression and exclude the header explicitly instead of matching a digit anywhere. - Set an appropriate root-login policy and key-based access controls in sshd configuration, validate syntax and reload safely.
Explanation
Correct Answer
A:Redirect both standard output and standard error explicitly using supported shell syntax, such as >job.log 2>&1, while checking the exit status. This action corrects shell redirection stderr capture without substituting an unrelated change. > redirects file descriptor 1; 2>&1 redirects stderr to stdout's current destination when ordered correctly. Before acting, verify: Review the command's exit status and test the separate stdout/stderr streams and shell redirection order. Afterward confirm: A controlled failing command writes its stderr to the expected file and the script records a nonzero status. Scenario context: During validation of an authorized change at a primary-site Linux operations cluster, An automation script redirects only standard output to a diagnostic file, so an important command failure appears only in the unattended job log. The operator must identify the affected mechanism before approving changes to other services.
Incorrect Answers
B:Set a supported end-to-end MTU for the affected host interface and overlay path while retaining appropriate PMTUD behavior. This is a change associated with network interface mtu configuration, not a targeted repair of shell redirection stderr capture. The described signal instead calls for: Redirect both standard output and standard error explicitly using supported shell syntax, such as >job.log 2>&1, while checking the exit status. Scenario context: During validation of an authorized change at a primary-site Linux operations cluster, An automation script redirects only standard output to a diagnostic file, so an important command failure appears only in the unattended job log. The operator must identify the affected mechanism before approving changes to other services.
C:Parse the intended column with an appropriate awk -F expression and exclude the header explicitly instead of matching a digit anywhere. This is a change associated with text filtering with grep and awk, not a targeted repair of shell redirection stderr capture. The described signal instead calls for: Redirect both standard output and standard error explicitly using supported shell syntax, such as >job.log 2>&1, while checking the exit status. Scenario context: During validation of an authorized change at a primary-site Linux operations cluster, An automation script redirects only standard output to a diagnostic file, so an important command failure appears only in the unattended job log. The operator must identify the affected mechanism before approving changes to other services.
D:Set an appropriate root-login policy and key-based access controls in sshd configuration, validate syntax and reload safely. This is a change associated with ssh key authorization and root login, not a targeted repair of shell redirection stderr capture. The described signal instead calls for: Redirect both standard output and standard error explicitly using supported shell syntax, such as >job.log 2>&1, while checking the exit status. Scenario context: During validation of an authorized change at a primary-site Linux operations cluster, An automation script redirects only standard output to a diagnostic file, so an important command failure appears only in the unattended job log. The operator must identify the affected mechanism before approving changes to other services.
Question 696
During validation of an authorized change at a primary-site Linux operations cluster, A debugging kernel argument disappears after reboot because an operator edited the generated GRUB configuration directly. The operator must identify the affected mechanism before approving changes to other services. Which controlled change is the most appropriate next step after verifying this failure?
- Use the matching bus inventory (
lsusb for USB) and supported driver binding to inventory and initialize the adapter. - Add the approved argument to the persistent GRUB defaults, regenerate the GRUB configuration with the distribution's supported command, and reboot in the change window.
- Rebuild the distribution's initramfs with the required storage and encrypted-root components, then verify the boot entry references it.
- Restore reachable approved identity servers and correct SSSD domain/name-service integration, then clear stale cache only if justified.
Explanation
Correct Answer
B:Add the approved argument to the persistent GRUB defaults, regenerate the GRUB configuration with the distribution's supported command, and reboot in the change window. This action corrects persistent grub kernel arguments without substituting an unrelated change. A generated grub.cfg may be overwritten during updates; GRUB defaults must feed the regeneration step. Before acting, verify: Compare the running /proc/cmdline with GRUB_CMDLINE_LINUX in /etc/default/grub and the generated boot entry. Afterward confirm: The selected boot entry and post-reboot /proc/cmdline both include the intended argument, without unrelated changes. Scenario context: During validation of an authorized change at a primary-site Linux operations cluster, A debugging kernel argument disappears after reboot because an operator edited the generated GRUB configuration directly. The operator must identify the affected mechanism before approving changes to other services.
Incorrect Answers
A:Use the matching bus inventory (lsusb for USB) and supported driver binding to inventory and initialize the adapter. This is a change associated with detecting pci versus usb hardware, not a targeted repair of persistent grub kernel arguments. The described signal instead calls for: Add the approved argument to the persistent GRUB defaults, regenerate the GRUB configuration with the distribution's supported command, and reboot in the change window. Scenario context: During validation of an authorized change at a primary-site Linux operations cluster, A debugging kernel argument disappears after reboot because an operator edited the generated GRUB configuration directly. The operator must identify the affected mechanism before approving changes to other services.
C:Rebuild the distribution's initramfs with the required storage and encrypted-root components, then verify the boot entry references it. This is a change associated with bootloader versus initramfs stages, not a targeted repair of persistent grub kernel arguments. The described signal instead calls for: Add the approved argument to the persistent GRUB defaults, regenerate the GRUB configuration with the distribution's supported command, and reboot in the change window.
D:Restore reachable approved identity servers and correct SSSD domain/name-service integration, then clear stale cache only if justified. This is a change associated with sssd central identity lookup, not a targeted repair of persistent grub kernel arguments. The described signal instead calls for: Add the approved argument to the persistent GRUB defaults, regenerate the GRUB configuration with the distribution's supported command, and reboot in the change window.
Question 697
During a production incident affecting a Linux application node, A service receives permission denied opening a file even though owner, group and mode allow access; AVC messages appear in the audit log. The operator must identify the affected mechanism before approving changes to other services. Which diagnostic provides the most decisive FIRST evidence for the stated failure?
- Inspect SSH authentication logs, effective sshd authentication settings and
faillock or the active PAM lock records. - Inspect
virsh domiflist, the libvirt network type, bridge membership, and guest addressing. - Compare
iostat -xz, process I/O rates and CPU %iowait to confirm storage stalls rather than pure CPU demand. - Correlate the AVC source/target contexts and the expected service policy using
ausearch and ls -Z.
Explanation
Correct Answer
D:Correlate the AVC source/target contexts and the expected service policy using ausearch and ls -Z. This checks the mechanism behind selinux avc denial versus unix mode. SELinux mandatory access control can deny an operation even when discretionary file modes permit it. Once identified, the targeted correction is: Correct the persistent file label or narrowly justified policy while keeping SELinux enforcing, instead of applying chmod 777. Confirm by checking: The service performs the authorized operation with the intended label and no matching AVC denial remains. Scenario context: During a production incident affecting a Linux application node, A service receives permission denied opening a file even though owner, group and mode allow access; AVC messages appear in the audit log. The operator must identify the affected mechanism before approving changes to other services.
Incorrect Answers
A:Inspect SSH authentication logs, effective sshd authentication settings and faillock or the active PAM lock records. This can investigate ssh login denied by account lock policy, but the given incident points to selinux avc denial versus unix mode. It is not the most decisive first evidence here. The discriminating test is: Correlate the AVC source/target contexts and the expected service policy using ausearch and ls -Z. Scenario context: During a production incident affecting a Linux application node, A service receives permission denied opening a file even though owner, group and mode allow access; AVC messages appear in the audit log. The operator must identify the affected mechanism before approving changes to other services.
B:Inspect virsh domiflist, the libvirt network type, bridge membership, and guest addressing. This can investigate kvm virtual networking bridge selection, but the given incident points to selinux avc denial versus unix mode. It is not the most decisive first evidence here. The discriminating test is: Correlate the AVC source/target contexts and the expected service policy using ausearch and ls -Z. Scenario context: During a production incident affecting a Linux application node, A service receives permission denied opening a file even though owner, group and mode allow access; AVC messages appear in the audit log. The operator must identify the affected mechanism before approving changes to other services.
C:Compare iostat -xz, process I/O rates and CPU %iowait to confirm storage stalls rather than pure CPU demand. This can investigate high i/o wait mistaken for cpu saturation, but the given incident points to selinux avc denial versus unix mode. It is not the most decisive first evidence here. The discriminating test is: Correlate the AVC source/target contexts and the expected service policy using ausearch and ls -Z. Scenario context: During a production incident affecting a Linux application node, A service receives permission denied opening a file even though owner, group and mode allow access; AVC messages appear in the audit log. The operator must identify the affected mechanism before approving changes to other services.
Question 698
During a security hardening rehearsal on an isolated Linux preproduction endpoint, A maintenance account creates configuration backups readable by other users because its effective umask is too permissive. The change must be repeatable and must not rely on broad permissions or bypassed safeguards. What acceptance result would show the fix actually resolves the reported failure?
- Throughput improves and lock-wait time drops without relying solely on adding CPU cores.
- The path shows the expected SELinux label and web access works with SELinux enforcing and no new AVC denial.
- New regular files default to owner-only mode as expected without retroactively altering unrelated existing files.
- A known-good signed release verifies, while a modified archive fails signature verification with the trusted key.
Explanation
Correct Answer
C:New regular files default to owner-only mode as expected without retroactively altering unrelated existing files. This is direct acceptance evidence for secure default umask for sensitive files rather than a generic process check. Umask removes permission bits from the requested creation mode; it does not modify files that were already created. It validates the correction: Set an appropriate umask such as 077 in the applicable session or service context for future sensitive outputs. Scenario context: During a security hardening rehearsal on an isolated Linux preproduction endpoint, A maintenance account creates configuration backups readable by other users because its effective umask is too permissive. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Incorrect Answers
A:Throughput improves and lock-wait time drops without relying solely on adding CPU cores. This outcome would support thread contention versus raw cpu capacity, but does not establish that the reported secure default umask for sensitive files problem is resolved. The required direct acceptance test is: New regular files default to owner-only mode as expected without retroactively altering unrelated existing files.
B:The path shows the expected SELinux label and web access works with SELinux enforcing and no new AVC denial. This outcome would support selinux persistent file context, but does not establish that the reported secure default umask for sensitive files problem is resolved. The required direct acceptance test is: New regular files default to owner-only mode as expected without retroactively altering unrelated existing files.
D:A known-good signed release verifies, while a modified archive fails signature verification with the trusted key. This outcome would support gpg artifact signature validation, but does not establish that the reported secure default umask for sensitive files problem is resolved. The required direct acceptance test is: New regular files default to owner-only mode as expected without retroactively altering unrelated existing files.
Question 699
During a repeatability test on an independently built recovery environment, A maintenance script always enters its restore branch because it tests a pathname as a nonempty string rather than checking whether the file exists. The change must be repeatable and must not rely on broad permissions or bypassed safeguards. What targeted corrective action best addresses the underlying problem?
- Resolve the conflict by combining the required changes, review the resulting diff and run configuration validation/tests before commit.
- Run the task under a dedicated least-privilege service account and grant only the necessary path permissions.
- Use a file-type test such as
[[ -f "$path" ]] before processing a required regular file and handle the absent-file path. - Use an explicit safe default expansion such as
${OPTIONAL:-fallback} for genuinely optional configuration while retaining mandatory-variable checks.
Explanation
Correct Answer
C:Use a file-type test such as [[ -f "$path" ]] before processing a required regular file and handle the absent-file path. This action corrects file existence conditional in bash without substituting an unrelated change. A nonempty pathname string is not proof of an existing regular file; -f checks filesystem state. Before acting, verify: Inspect the if condition and reproduce it with an absent file using test -f or [[ -f ... ]]. Afterward confirm: A missing test file takes the expected error branch while a regular test file is processed. Scenario context: During a repeatability test on an independently built recovery environment, A maintenance script always enters its restore branch because it tests a pathname as a nonempty string rather than checking whether the file exists. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Incorrect Answers
A:Resolve the conflict by combining the required changes, review the resulting diff and run configuration validation/tests before commit. This is a change associated with git conflict resolution without loss, not a targeted repair of file existence conditional in bash. The described signal instead calls for: Use a file-type test such as [[ -f "$path" ]] before processing a required regular file and handle the absent-file path. Scenario context: During a repeatability test on an independently built recovery environment, A maintenance script always enters its restore branch because it tests a pathname as a nonempty string rather than checking whether the file exists. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
B:Run the task under a dedicated least-privilege service account and grant only the necessary path permissions. This is a change associated with least privilege for service processes, not a targeted repair of file existence conditional in bash. The described signal instead calls for: Use a file-type test such as [[ -f "$path" ]] before processing a required regular file and handle the absent-file path. Scenario context: During a repeatability test on an independently built recovery environment, A maintenance script always enters its restore branch because it tests a pathname as a nonempty string rather than checking whether the file exists. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
D:Use an explicit safe default expansion such as ${OPTIONAL:-fallback} for genuinely optional configuration while retaining mandatory-variable checks. This is a change associated with bash parameter expansion default, not a targeted repair of file existence conditional in bash. The described signal instead calls for: Use a file-type test such as [[ -f "$path" ]] before processing a required regular file and handle the absent-file path. Scenario context: During a repeatability test on an independently built recovery environment, A maintenance script always enters its restore branch because it tests a pathname as a nonempty string rather than checking whether the file exists. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Question 700
While preparing a recovery-site Linux node for a repeatable cutover, A transfer puts application files under an unexpected extra directory because an rsync source path was copied without verifying trailing-slash behavior. The change must be repeatable and must not rely on broad permissions or bypassed safeguards. Which TWO complementary steps best identify and correct this cause? Select TWO.
- Restore the archive with appropriate privileges and ownership/permission preservation, then reconcile service users before startup.
- Lock the local password with
passwd -l username, and separately disable other authorized login methods if policy requires full account access revocation. - Use the intended rsync trailing-slash source semantics and rerun with archive attributes after reviewing the dry-run.
- Run
rsync --dry-run -av with the exact source and destination paths and inspect the previewed relative paths. - Inspect the script with shellcheck-style reasoning and demonstrate how
for and test expressions split a filename containing spaces.
Explanation
Correct Answers
C:Use the intended rsync trailing-slash source semantics and rerun with archive attributes after reviewing the dry-run. This is the targeted change needed after establishing the fault. rsync source/ dest/ copies the contents of source, while rsync source dest/ can create a source subdirectory. Pair it with the supporting check: Run rsync --dry-run -av with the exact source and destination paths and inspect the previewed relative paths. Scenario context: While preparing a recovery-site Linux node for a repeatable cutover, A transfer puts application files under an unexpected extra directory because an rsync source path was copied without verifying trailing-slash behavior. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
D:Run rsync --dry-run -av with the exact source and destination paths and inspect the previewed relative paths. This supplies the decisive diagnostic observation for the stated fault. rsync source/ dest/ copies the contents of source, while rsync source dest/ can create a source subdirectory. Pair this evidence with the targeted change: Use the intended rsync trailing-slash source semantics and rerun with archive attributes after reviewing the dry-run. Scenario context: While preparing a recovery-site Linux node for a repeatable cutover, A transfer puts application files under an unexpected extra directory because an rsync source path was copied without verifying trailing-slash behavior. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
Incorrect Answers
A:Restore the archive with appropriate privileges and ownership/permission preservation, then reconcile service users before startup. This choice concerns tar permissions preservation on restore rather than the required diagnosis-and-change pair for rsync source trailing slash semantics. Compare the needed evidence (Run rsync --dry-run -av with the exact source and destination paths and inspect the previewed relative paths.) with the repair (Use the intended rsync trailing-slash source semantics and rerun with archive attributes after reviewing the dry-run.). Scenario context: While preparing a recovery-site Linux node for a repeatable cutover, A transfer puts application files under an unexpected extra directory because an rsync source path was copied without verifying trailing-slash behavior. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
B:Lock the local password with passwd -l username, and separately disable other authorized login methods if policy requires full account access revocation. This choice concerns local account lock versus password expiration rather than the required diagnosis-and-change pair for rsync source trailing slash semantics. Compare the needed evidence (Run rsync --dry-run -av with the exact source and destination paths and inspect the previewed relative paths.) with the repair (Use the intended rsync trailing-slash source semantics and rerun with archive attributes after reviewing the dry-run.). Scenario context: While preparing a recovery-site Linux node for a repeatable cutover, A transfer puts application files under an unexpected extra directory because an rsync source path was copied without verifying trailing-slash behavior. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.
E:Inspect the script with shellcheck-style reasoning and demonstrate how for and test expressions split a filename containing spaces. This choice concerns quoting filenames in shell loops rather than the required diagnosis-and-change pair for rsync source trailing slash semantics. Compare the needed evidence (Run rsync --dry-run -av with the exact source and destination paths and inspect the previewed relative paths.) with the repair (Use the intended rsync trailing-slash source semantics and rerun with archive attributes after reviewing the dry-run.). Scenario context: While preparing a recovery-site Linux node for a repeatable cutover, A transfer puts application files under an unexpected extra directory because an rsync source path was copied without verifying trailing-slash behavior. The change must be repeatable and must not rely on broad permissions or bypassed safeguards.