This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "action": "GUARDRAIL_INTERVENED", | |
| "outputs": [ | |
| { | |
| "text": "Sorry, I cannot process that request." | |
| } | |
| ], | |
| "assessments": [ | |
| { | |
| "sensitiveInformationPolicy": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| response = bedrock_runtime.apply_guardrail( | |
| guardrailIdentifier=guardrail_id, | |
| guardrailVersion='DRAFT', | |
| source='INPUT', | |
| content=[ | |
| { | |
| 'text': { | |
| 'text': 'My email is john.doe@example.com and my SSN is 123-45-6789' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python3 guardrail.py | |
| Guardrail created with ID: <GUARD_RAIL_ID> | |
| Guardrail ARN: arn:aws:bedrock:eu-central-1:<ACCOUNT_ID>:guardrail/<GUARD_RAIL_ID> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| topicPolicyConfig={ | |
| 'topicsConfig': [ | |
| { | |
| 'name': 'FinancialAdvice', | |
| 'definition': 'Investment recommendations or financial planning', | |
| 'examples': [ | |
| 'Should I buy stocks?', | |
| 'What should I invest in?' | |
| ], | |
| 'type': 'DENY' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contentPolicyConfig={ | |
| 'filtersConfig': [ | |
| { | |
| 'type': 'HATE', | |
| 'inputStrength': 'HIGH', | |
| 'outputStrength': 'HIGH' | |
| }, | |
| { | |
| 'type': 'VIOLENCE', | |
| 'inputStrength': 'HIGH', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "boot-source": { | |
| "kernel_image_path": "./vmlinux-6.1.102", | |
| "boot_args": "reboot=k panic=1 pci=off ip=169.254.0.21::169.254.0.22:255.255.255.252::eth0:off init=/src/dicedb" | |
| }, | |
| "drives": [ | |
| { | |
| "drive_id": "rootfs", | |
| "path_on_host": "/root/bin/rootfs", | |
| "is_root_device": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Input: ./extract_kubecfg_cert.sh my-cluster-name username | |
| # Output: ./my-cluster-name-ca.crt ./username.crt ./username.key | |
| # Exit on error | |
| abort(){ | |
| echo $1 && exit 1 | |
| } | |
| # Prerequistes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: the-validator | |
| namespace: img-validation | |
| labels: | |
| name: the-validator | |
| spec: | |
| ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| from flask import Flask, request, jsonify | |
| import ssl | |
| import sys | |
| from container_utils import check_image, get_allowed_list | |
| app = Flask(__name__) | |
| @app.route("/validate", methods=["POST"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443; | |
| ssl on; | |
| server_name mysite.com; | |
| proxy_ssl_server_name on; | |
| ssl_certificate /etc/nginx/certs/mysite.com.crt; |
NewerOlder