Skip to content

Commit c349423

Browse files
committed
docs: update tutorial to show the use of wildcard.
Signed-off-by: Demolus13 <[email protected]>
1 parent 0fd55ba commit c349423

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

docs/source/pages/tutorials/verify_with_existing_policy.rst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Run the ``malware-detection`` policy against a package URL:
2727
./run_macaron.sh verify-policy \
2828
--database output/macaron.db \
2929
--existing-policy malware-detection \
30-
--package-url "pkg:pypi/django"
30+
--package-url "pkg:pypi/django@5.0.6"
3131
3232
The result of this command should show that the policy succeeds with a zero exit code (if a policy fails to pass, Macaron returns a none-zero error code):
3333

@@ -44,6 +44,39 @@ The result of this command should show that the policy succeeds with a zero exit
4444
Verification Summary Attestation output/vsa.intoto.jsonl
4545
Decode and Inspect the Content cat output/vsa.intoto.jsonl | jq -r '.payload' | base64 -d | jq
4646
47+
Run the ``malware-detection`` policy using wildcard:
48+
49+
.. code-block:: shell
50+
51+
./run_macaron.sh analyze -purl pkg:pypi/[email protected]
52+
./run_macaron.sh analyze -purl pkg:pypi/[email protected]
53+
54+
.. note:: By default, Macaron clones the repositories and creates output files under the ``output`` directory. To understand the structure of this directory please see :ref:`Output Files Guide <output_files_guide>`.
55+
56+
.. code-block:: shell
57+
58+
./run_macaron.sh verify-policy \
59+
--database output/macaron.db \
60+
--existing-policy malware-detection \
61+
--package-url "pkg:pypi/django@*"
62+
63+
It uses the wildcard '*' to checks for components satisfying the expression "pkg:pypi/django@*".
64+
The result of this command should show that the policy succeeds with a zero exit code (if a policy fails to pass, Macaron returns a none-zero error code):
65+
66+
.. code-block:: shell
67+
68+
Components Satisfy Policy
69+
1 pkg:pypi/[email protected] check-component
70+
1 pkg:pypi/[email protected] check-component
71+
72+
Components Violate Policy None
73+
74+
Passed Policies check-component
75+
Failed Policies None
76+
Policy Report output/policy_report.json
77+
Verification Summary Attestation output/vsa.intoto.jsonl
78+
Decode and Inspect the Content cat output/vsa.intoto.jsonl | jq -r '.payload' | base64 -d | jq
79+
4780
-----------------
4881
Related tutorials
4982
-----------------

0 commit comments

Comments
 (0)