-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[entropy_src] Need support for testing health tests #22289
Comments
Related issue #20953 |
@vsukhoml , I am reworking the ENTROPY_SRC documentation to clarify some of these aspects. I'll ping you in the PR for feedback. In general, the health tests don't alter the entropy. Whether you extract the entropy in firmware override mode before or after the health tests makes no difference. |
As for testing the health tests themselves: this is the job of DV. There is a software model of the health tests in DV that gets compared to the hardware health test outputs in the scoreboard. If there are mismatches, DV fails. |
The question is how would you use DV tests to convince the evaluation lab that your firmware can rely on it. Lab will do operational testing, asking to simulate failures in health checks by feeding simulated bad entropy. They do video recording of the process in case of questions, audits. Practically I don't know how to use DV data for that. Is any lab involved on this stage to collect data confirming correct operations of health checks? If not, it will be hard to use presence of DV tests to validate module and end up in relying on firmware tests if FIPS cert is needed. So, depends on desired claims for OT. Given raw access to entropy (unchanged, unfiltered), we can have firmware workaround, so not critical, just performance implications, but then why do we have all this HW? |
cc @zi-v pls to have a look too |
FIPS 140-3 IG on page 149, Health tests states: The tester shall verify that all the vendor-identified known or suspected noise source failure modes are We need to be able to provide means for this. |
Since the analog samples can be extracted via the observe FIFO, the health test models can run offline if needed. However, I do agree that binding everything to HW has both cost and risk. Today we feel we can pass FIPS with the currently implemented health tests, but it might be that in the future FIPS/lab may decide that we need to augment with more tests. Maybe we can consider the SW bypass as the main route and maybe think of taking out some of the hardware. Also, from our experience, FIPS grade entropy is not massively needed and can be managed by keeping a buffer and generate bit chunks upon need using startup health test each time. |
We need to demonstrate to the lab that HW health checks do work. How to do this during FIPS certification of firmware? It is combination of process and technical issues. Can we prepare evidence as part of DV testing? I don't know. |
Let me try summarize:
My guess is:
cc @moidx |
Thanks for your summary @johannheyszl . Yes, I believe it's a big advantage of the open source project to easily share the RTL source code (including DV environment and DV model) such that labs can inspect and convince themselves that it is correct. If absolutely needed, we could add a mux close to the RNG input and a new register for software to inject 4-bit values there. We would harden the configuration setting and maybe if enabled prevent the ENTROPY_SRC from outputting anything to downstream consumers / CSRNG on the hardware interface. Because this is a security risk. However, we need to be 100% this is absolutely needed. Because it means additional work and we have an extremely tight schedule. Any additional work not already captured in the milestones puts this at risk. |
I agree with @zi-v in that FIPS mode entropy is not massively needed at runtime. We conflated the need to have some health checks in the hardware entropy pipeline with the definition of FIPS entropy. We now have low confidence in being able to maintain FIPS certification over time without requiring SW bypass (FW OVR) mode due to evolving certification requirements and flagged risks during integration testing. So far our experience has been with certifying software based health checks and so have no prior experience with this approach. I obtained feedback from someone more familiar with FIPS certification in hardware and their feedback was pointing towards implementing test interfaces as requested in this issue. This is because the lab may want to ensure that the hardware implementation is implemented as defined in the RTL or model. This also depends on the physical boundary definition of the FIPS module, which for us is very likely to be the IC package, as well as the targeted certification level. @vogelpi what is your intuition in terms of complexity and area? During issue triage we can provide feedback on whether or not we are able to absorb this change based on other priorities. |
Thanks for your feedback @moidx . Implementation complexity is low and area as well. It's in the order of 8 FFs and 4 2-to-1 MUXes. Compared to all the other things that were raised, this one hear is probably the most feasible one to implement (and verify). And I see that decisions have been taken to not implement the other feature requests. Under these conditions, I think we should be able to absorb this change here. |
Note to add: NIST provides docs on entropy validation of which one is a sheet listing 90B Shall Statements. Rows 76, 119, 124, 125 seem relevant, but not specifically conclusive to answer the question. |
Waiting for feedback from people with hardware FIPS experience. |
I now got feedback from someone having experience with this. It doesn't seem necessary to have an option for doing KATs of the health tests for validation testing. |
@vogelpi what is needed then to do operational testing to demonstrate working health tests? it is not called a KAT, to avoid confusion. It is a proof for the lab that tests do work. It can be done with custom firmware, but should be same implementation of tests. I'd check with the lab on what is enough. |
I don't know how it's actually done in practice. But the feedback I got is that entropy source blocks usually don't have an interface to push in known entropy before the health tests. If you can check with the lab on what is needed that would be great thanks. |
@johngt , let me try to clarify step by step. FIPS 140-3 literally says: "The tester shall verify that all the vendor-identified known or suspected noise source failure modes are detected by the continuous health tests included within the entropy source. (See SP 800-90B Section 4.3, From SP 800-90B, Section 4.3: Entropy Validation Documents part lists some templates used by the lab, specifically Entropy Assessment Report Template v1.1 which is what lab have to fill and submit to NIST. Below is the table with some related requirements.
So, I can't say from all that what would satisfy lab & NIST. They mention simulation for APT/RCT tests: But I practically don't know simulation of what specifically is needed and how to prove that implementation behavior matches simulation. Say, NIST mandates requirement 65 for developer's alternative to APT/RCT, but it also requires on-demand tests. We need to engage with the lab. |
I was asked to provide my perspective as someone who is going through a FIPS 140-3 certification currently. Please confirm my understanding of the issue:
|
|
Thx @tonyd5656 your second bullet states the question correctly IMO. |
My comments are based on my interpretation of the requirements and experience with the lab my company has used. In the end the determination of whether or not OpenTitan meets all the requirements will be made by the certification lab used and CMVP. That being said, the "testing" for a FIPS certification includes both the actually testing of the module and "testing" of the documentation. It seems to me that the FIPS IG D.K Interpretation of SP 800-90B Requirements # 14 could be satisfied by solely by documentation. However, there are test requirements for the module, specifically the requirement is the tester needs to be able to cause all the defined errors and if not provide the vendor needs to provide rationale as why the error cannot be induced. From ISO ISO/IEC 24759:
Based on my understanding there are two options if the ability to inject data into the health tests is not implemented:
Also to note, the "simulation" mentioned in the Entropy Assessment Template is with respect providing proof that Developer-Defined Alterative health tests meet the two criteria. Proof that the Developer-Defined Alterative health tests meet the criteria is only required if they replace the APT/RCT health tests. This isn't the case for OpenTitan, so this should not need to be provided. |
So, I checked with the lab and got following answer:
However, BSI entropy testing requirements are different, and should be taken into consideration if needed. |
Thanks @tonyd5656 and @vsukhoml ! |
Thanks both for your feedback @tonyd5656 and @vsukhoml , it's very much appreciated! So to conclude, we don't need add such an interface to test the health tests for SP 800-90B. And for the NIST cryptographic module validation program (assuming the error cases are also relevant for the ENTROPY_SRC and not just the crypto blocks), it should be sufficient to produce health test failures e.g. by configuring aggressive health test thresholds. I am thus suggesting to close this issue without implementing design changes. But before we do that let's also check for BSI requirements regarding this. |
As for BSI requirements - I have little experience, from what I found a lot is based on stochastic model, though there are places with hw requirements, and in P14 below I found requirement which seems to be directly related to this issue. Developer evidence for the evaluation of a physical true random number generator:
P.6 Description of the PTRNG in terms of the online test(s) of the raw random numbers.
P.14 Demonstrate how the total failure test of the entropy source together with the online test of the raw random signals protect the PTRNG from tampering.
Application Notes and Interpretation Functionality classes and evaluation methodology for true (physical) random number generators related to BSI AIS 31: P2.f) to be specified by the applicant in addition to C.1(i)-(iii) and P1.f)(iv)-(vi): As of evaluation level E2, C1.(ii.b) requires the applicant to provide proof that the statistical tests described in P2.i)(vii) have been performed and to submit the test P2.f)(xi) Proof that the tests specified in P2.i)(xii) have been performed and provision of the test results. Update of the AIS 20 / 31, Slide 14: verification that the online test and the total failure test are effective A Proposal for Functionality Classes for Random Number Generators Version 2.35 - DRAFT: |
Thanks @vsukhoml for your input. After studying this, my understanding of the BSI requirements is that:
So to summarize: also BSI doesn't seem to require such an interface. I suggest to close this issue. FYI @johannheyszl |
So, right now it is not high priority - for software path we can implement health checks in software and prove whatever required about them if health checks won't satisfy certification requirements. I'd propose to turn it into feature request for the future version. Certification requirements for entropy sources are frequently updated in recent years, and the requirement to be able to directly validate health checks is rather reasonable. |
Thanks all. The entire topic would not be a 100% show-stopper since a FW path is possible (as @vsukhoml pointed out). FIPS does not seem to require the additional data input to HC feature. BSI: thanks @vsukhoml for providing references. The first doc, which is listed on the BSI page here, also states: Summary: I think chances are high we are correct to assume, we will not need the feature at this moment in time. Thanks everybody for the help! Outcome: I think we can relabel as improvement for future releases @vogelpi @vsukhoml |
Thanks for your additional input @vsukhoml and @johannheyszl . I've now created an issue to keep track of all potential features for future releases here where I've also linked this issue. I am now closing this one as we track the item / feature in the newly created issue. |
Description
Part of FIPS certification would include an operational testing to ensure that health tests for entropy works. This is usually done by simulation fault at entropy source (e.g., all zeroes, or specific pattern simulating its fault mode).
FW Override mode currently implement happens only after health checks. One solution would be to have similar feature before health tests, so it would be possible for firmware to demonstrate that health checks work for the evaluation lab.
This feature is also useful for NIST entropy assessment, where raw data should be used to estimate raw entropy and configure health check's thresholds appropriately.
@vogelpi , @johannheyszl
The text was updated successfully, but these errors were encountered: