|
import streamlit as st |
|
import openai |
|
|
|
|
|
|
|
|
|
st.title('AEO Example Generator') |
|
|
|
about = ''' Adversary Engagement Ontology (AEO) is a candidate ontology to the Unified Cyber Ontology (UCO), a community effort for the ontological standardization of cyber domain concepts and objects under a unifying framework, and is part of the Cyber Domain Ontology (CDO). Community efforts and development has always been manual labor intensive in regards to ontology changes, ontology example generation for adopters, documentation generation. Large Language Models (LLMs) have been shown to be capable of automating many tasks or aiding in human expert decision-making. We demonstrate how foundational LLMs such as ChatGPT and GPT4 can assist in ontology example generation, ontology development, and overall be used in automation tooling for structured but tedious tasks. |
|
This space can be used to create an example of how to setup the AEO instance. It uses the power of OpenAI's ChatGPT. |
|
The generator currently uses strictly prewritten rules of AEO, discussion on an automation process is still early . |
|
he generator currently is bounded by prompt size limits. |
|
|
|
There are some known work arounds but none are functionally implemented yet. |
|
|
|
Official GitHub: https://github.com/UNHSAILLab/Adversary-Engagement-Ontology |
|
''' |
|
st.markdown(about) |
|
|
|
openai_key = st.text_input("Enter your OpenAI key", type="password") |
|
openai.api_key = openai_key |
|
|
|
|
|
|
|
|
|
from aeo_ex_generator.aeo_example_generator import ExampleGenerator |
|
ex = ExampleGenerator() |
|
|
|
|
|
|
|
|
|
st.subheader("Prompts Examples") |
|
with st.expander("Example-1"): |
|
st.write(""" |
|
Use one engagement:Narrative |
|
Use one engagement:Storyline |
|
Use the following people: |
|
Bob Smith is a defender role |
|
Mary Jane is an adversary role |
|
Use three planned events: |
|
Planned Event one - Bob Smith deploys a honeyobject enviroment and a honeytoken file containing fake user credentials called "user-creds.dmp". The objective is to direct and elicit. He also deploys a honeypot with the objective to detect and trap. |
|
Planned Event two - The honeypot beacons to the dataTarget called CanaryTokenAlert, the performer is the honeypot, the object is the CanaryTokenAlert. |
|
Planned Event three - CanaryTokenAlert dataSource alerts Bob Smith that the second honeypot was accessed. The performer is the CanaryTokenAlert, the object is Bob Smith |
|
""") |
|
with st.expander("Example-2"): |
|
st.write(""" |
|
Use one engagement:Narrative |
|
Use one engagement:Storyline |
|
Use the following people: |
|
John White is a defender role |
|
Use three planned events: |
|
Planned Event one - John White deploys a breadcrumbtrail consisting of four breadcrumbs. The objective is to direct. He also deploys a honeypot with the objective to trap. |
|
Planned Event two - The honeypot beacons to the dataTarget called CommandControlCenter, the performer is the honeypot, the object is the CommandControlCenter. |
|
Planned Event three - CommandControlCenter dataSource alerts John White that the honeypot was accessed. The performer is the CommandControlCenter, the object is John White |
|
""") |
|
|
|
|
|
st.subheader("Write a prompt to generate the example.") |
|
user_input = st.text_area("Enter your description here ", "", height=200) |
|
|
|
|
|
|
|
if user_input: |
|
e = ex.prompt(user_input) |
|
result = [i for i in e['@graph']] |
|
|
|
st.subheader('Prefix namespaces mentioned in the example:') |
|
st.text_area("", e['@context'], height=200) |
|
|
|
st.subheader('Full example:') |
|
try: |
|
st.json(result) |
|
except: |
|
st.text_area("", result, height=400) |
|
|
|
|
|
|