keylime / rust-keylime

Rust implementation of the keylime agent
https://keylime.dev
Apache License 2.0
101 stars 56 forks source link

config: Support hostnames in registrar_ip option #797

Closed ansasaki closed 5 months ago

ansasaki commented 5 months ago

This restores previous behavior where hostnames could be used to set the 'registrar_ip' configuration option.

The configuration will try to parse the input configuration string as an IP and in case of failure, try to parse the string as a hostname.

Fixes: #794

ansasaki commented 5 months ago

/packit retest-failed

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 54.54545% with 15 lines in your changes missing coverage. Please review.

Project coverage is 61.22%. Comparing base (2f7b3ad) to head (d4becf3). Report is 27 commits behind head on master.

Additional details and impacted files | [Flag](https://app.codecov.io/gh/keylime/rust-keylime/pull/797/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime) | Coverage Δ | | |---|---|---| | [e2e-testsuite](https://app.codecov.io/gh/keylime/rust-keylime/pull/797/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime) | `61.22% <54.54%> (+3.63%)` | :arrow_up: | | [upstream-unit-tests](https://app.codecov.io/gh/keylime/rust-keylime/pull/797/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime) | `61.22% <54.54%> (+10.21%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/keylime/rust-keylime/pull/797?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime) | Coverage Δ | | |---|---|---| | [keylime-agent/src/config.rs](https://app.codecov.io/gh/keylime/rust-keylime/pull/797?src=pr&el=tree&filepath=keylime-agent%2Fsrc%2Fconfig.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime#diff-a2V5bGltZS1hZ2VudC9zcmMvY29uZmlnLnJz) | `87.11% <66.66%> (-0.39%)` | :arrow_down: | | [keylime-agent/src/error.rs](https://app.codecov.io/gh/keylime/rust-keylime/pull/797?src=pr&el=tree&filepath=keylime-agent%2Fsrc%2Ferror.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime#diff-a2V5bGltZS1hZ2VudC9zcmMvZXJyb3IucnM=) | `15.07% <0.00%> (-0.18%)` | :arrow_down: | | [keylime-agent/src/registrar\_agent.rs](https://app.codecov.io/gh/keylime/rust-keylime/pull/797?src=pr&el=tree&filepath=keylime-agent%2Fsrc%2Fregistrar_agent.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime#diff-a2V5bGltZS1hZ2VudC9zcmMvcmVnaXN0cmFyX2FnZW50LnJz) | `94.54% <71.42%> (-3.57%)` | :arrow_down: | | [keylime/src/hostname\_parser.rs](https://app.codecov.io/gh/keylime/rust-keylime/pull/797?src=pr&el=tree&filepath=keylime%2Fsrc%2Fhostname_parser.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime#diff-a2V5bGltZS9zcmMvaG9zdG5hbWVfcGFyc2VyLnJz) | `50.00% <50.00%> (ø)` | | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/keylime/rust-keylime/pull/797/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keylime)
ansasaki commented 5 months ago

To address the reduction in the test coverage, the issue https://github.com/RedHat-SP-Security/keylime-tests/issues/586 was created