Customize terminal output
Prisma Cloud lets you create rules that block access to resources or block the deployment of non-compliant containers.
For example, you might create a rule that blocks the deployment of any image that has critical severity vulnerabilities. By default, when you try to run non-compliant image, Prisma Cloud returns a terse response:
# docker -H :9998 --tls run -ti morello/docker-whale docker: Error response from daemon: [Prisma Cloud] operation blocked by policy: (test-compliance), host has 19 compliance issues.
To help the operator better understand how to handle a blocked action, you can enhance Prisma Cloud’s default response by
- Appending a custom message to the default message. For example, you could tell operators where to go to open a ticket.
- Configuring Prisma Cloud to return an itemized list of compliance issues rather than just a summary. This way, the operator does not need to contact the security team to determine which issues are preventing deployment. They are explicitly listed in the response.
Enhanced terminal output is available for rules created under:
- Defend > Vulnerabilities > Policy
- Defend > Compliance > Policy
- Defend > Access(Docker Engine and Kubernetes access control rules).
Specifying a custom message
This procedure shows you how to create an access control rule that blocks all users from running the container_create operation. You will configure the rule to emit the following custom message when an action is blocked:
Contact firstname.lastname@example.org to get additional privileges
Although this procedure is specific to access control rules, the process for configuring custom messages for vulnerability and compliance rules is the same.
- Open Console.
- Go toDefend > Access > Docker, then clickNew Docker rule.
- In the new rule dialog, enter the following information:
- InRule name, enter a name.
- InShow, uncheckAllto deselect all actions.
- InActions, checkcontainer_create.