Skip to content

Commit

Permalink
Add log messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
NullHypothesis committed Nov 14, 2024
1 parent a7ffa49 commit d29f9a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/system/system_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (

func SetResolver(resolver string) (err error) {
defer errs.Wrap(&err, "failed to set DNS resolver")
log.Printf("Setting DNS resolver to %s.", resolver)

// A Nitro Enclave's /etc/resolv.conf is a symlink to
// /run/resolvconf/resolv.conf. As of 2022-11-21, the /run/ directory
Expand All @@ -41,6 +42,7 @@ func SetResolver(resolver string) (err error) {

func SeedRandomness() (err error) {
defer errs.Wrap(&err, "failed to seed entropy pool")
log.Println("Seeding system entropy pool.")

s, err := nsm.OpenDefaultSession()
if err != nil {
Expand Down Expand Up @@ -91,6 +93,7 @@ func SeedRandomness() (err error) {
// SetupLo sets up the loopback interface.
func SetupLo() (err error) {
defer errs.Wrap(&err, "failed to configure loopback interface")
log.Println("Setting up loopback interface.")

link, err := tenus.NewLinkFrom("lo")
if err != nil {
Expand All @@ -110,6 +113,7 @@ func SetupLo() (err error) {
// RNG. This was suggested in:
// https://blog.trailofbits.com/2024/09/24/notes-on-aws-nitro-enclaves-attack-surface/
func HasSecureRNG() bool {
log.Println("Checking if system uses desired RNG.")
haveRNG, err := os.ReadFile(pathToRNG)
if err != nil {
log.Printf("Error reading %s: %v", pathToRNG, err)
Expand All @@ -123,6 +127,7 @@ func HasSecureRNG() bool {
// includes important security updates. This was suggested in:
// https://blog.trailofbits.com/2024/09/24/notes-on-aws-nitro-enclaves-attack-surface/
func HasSecureKernelVersion() bool {
log.Println("Checking if system has desired kernel version.")
var uname syscall.Utsname
if err := syscall.Uname(&uname); err != nil {
log.Printf("Error calling uname system call: %v", err)
Expand Down

0 comments on commit d29f9a6

Please sign in to comment.