Build a new reachability model from the given inputs.
(
policy: PolicyModel,
credentials: CredentialSet,
binary_registry: BinaryRegistry,
)
| 58 | impl ReachabilityModel { |
| 59 | /// Build a new reachability model from the given inputs. |
| 60 | pub fn new( |
| 61 | policy: PolicyModel, |
| 62 | credentials: CredentialSet, |
| 63 | binary_registry: BinaryRegistry, |
| 64 | ) -> Self { |
| 65 | let solver = Solver::new(); |
| 66 | let mut model = Self { |
| 67 | policy, |
| 68 | credentials, |
| 69 | binary_registry, |
| 70 | endpoints: Vec::new(), |
| 71 | binary_paths: Vec::new(), |
| 72 | solver, |
| 73 | policy_allows: HashMap::new(), |
| 74 | l7_enforced: HashMap::new(), |
| 75 | l7_allows_write: HashMap::new(), |
| 76 | binary_bypasses_l7: HashMap::new(), |
| 77 | binary_can_write: HashMap::new(), |
| 78 | binary_can_exfil: HashMap::new(), |
| 79 | binary_can_construct_http: HashMap::new(), |
| 80 | credential_has_write: HashMap::new(), |
| 81 | credential_has_destructive: HashMap::new(), |
| 82 | filesystem_readable: HashMap::new(), |
| 83 | }; |
| 84 | model.build(); |
| 85 | model |
| 86 | } |
| 87 | |
| 88 | fn build(&mut self) { |
| 89 | self.index_endpoints(); |