(&mut self)
| 187 | } |
| 188 | |
| 189 | fn encode_binary_capabilities(&mut self) { |
| 190 | for bpath in &self.binary_paths.clone() { |
| 191 | let cap = self.binary_registry.get_or_unknown(bpath); |
| 192 | |
| 193 | let bypass_var = Bool::new_const(format!("binary_bypasses_l7_{bpath}")); |
| 194 | if cap.bypasses_l7() { |
| 195 | self.solver.assert(&bypass_var); |
| 196 | } else { |
| 197 | self.solver.assert(&!bypass_var.clone()); |
| 198 | } |
| 199 | self.binary_bypasses_l7.insert(bpath.clone(), bypass_var); |
| 200 | |
| 201 | let write_var = Bool::new_const(format!("binary_can_write_{bpath}")); |
| 202 | if cap.can_write() { |
| 203 | self.solver.assert(&write_var); |
| 204 | } else { |
| 205 | self.solver.assert(&!write_var.clone()); |
| 206 | } |
| 207 | self.binary_can_write.insert(bpath.clone(), write_var); |
| 208 | |
| 209 | let exfil_var = Bool::new_const(format!("binary_can_exfil_{bpath}")); |
| 210 | if cap.can_exfiltrate { |
| 211 | self.solver.assert(&exfil_var); |
| 212 | } else { |
| 213 | self.solver.assert(&!exfil_var.clone()); |
| 214 | } |
| 215 | self.binary_can_exfil.insert(bpath.clone(), exfil_var); |
| 216 | |
| 217 | let http_var = Bool::new_const(format!("binary_can_construct_http_{bpath}")); |
| 218 | if cap.can_construct_http { |
| 219 | self.solver.assert(&http_var); |
| 220 | } else { |
| 221 | self.solver.assert(&!http_var.clone()); |
| 222 | } |
| 223 | self.binary_can_construct_http |
| 224 | .insert(bpath.clone(), http_var); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | fn encode_credentials(&mut self) { |
| 229 | let hosts: HashSet<String> = self.endpoints.iter().map(|e| e.host.clone()).collect(); |
no test coverage detected