command
Version:
v0.0.0-...-004ddcb
Opens a new window with list of versions in this module.
Published: Nov 13, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
calculator-go
An application that calculates the confidence score for a given piece of data
Summary of Data Confidence scoring algorithm
-
Establish the total weighting of all factors
-
Defined by policy where AnnotationType = value from 1-5
Example: "tpm"=2
-
If no policy or factor not found in policy, default weight will always be 1
-
For this working example, assume the following annotation types and weights
tpm=2
tls=1
pki=1
-
Resulting total weights for the above where all annotations are present == 4
-
Establish which annotations are satisfied
-
Divide satisfied weight score by total weight score
- 3 / 4 = .75 (%75 confidence)
Steps to Run OPA as server in docker container
-
Execute the following command inside the root directory of the project to build docker image from Dockerfile
docker build -t opa-server scripts/policies
-
Execute the following command to opa-server
container
docker run --publish 8181:8181 opa-server
Steps to fetch the weights from OPA
-
Create input.json
with the following content
{"input":{"class":"production"}}
-
To execute a curl request using input.json
curl localhost:8181/v1/data/dcf_scoring -d @input.json -H 'Content-Type: application/json' | jq
-
The response should be similar to
{
"result": {
"weights": [
{
"pki": 2,
"tls": 2,
"tpm": 1
}
]
}
}
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.