-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CTI example #151
base: master
Are you sure you want to change the base?
Add CTI example #151
Conversation
Change Main README.md
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the feedback here and fix all instance of it, and not just the ones I tagged.
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class AppConfiguration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SullivanDaly This class isn't really necessary. It's be cleaner to use @ConfigurationProperties("db") right on the Controller, and inject values into host, port and db fields in it.
So in Contoller have:
@ConfigurationProperties("db")
@RestController
public class Controller {
private String host;
private String port;
private String db;
Then in application.properties, have:
db.host=localhost
db.port=1729
db.name=CTI_SPRING
For examples, see this blog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so for this one as I am using those information in the Controller, in the SessionWrapper and in the CTI Bean.
Is it better to retrieve info from the file in those three or keep the "centralized" class passed to the constructor?
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/controllers/Controller.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/controllers/Controller.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/TypeDBSessionWrapper.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/TypeDBSessionWrapper.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/AttributedToDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/AttributedToDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/AttributedToDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/MalwareDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/SightingDAO.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these should be fixed in every class
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/model/StixCoreObject.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/model/StixCoreObject.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/model/StixCoreObject.java
Outdated
Show resolved
Hide resolved
...security/cyber_threat_intelligence/src/main/java/org/example/model/StixCoreRelationship.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/model/Sighting.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/IdentityDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/IdentityDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/IdentityDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/IdentityDAO.java
Outdated
Show resolved
Hide resolved
cybersecurity/cyber_threat_intelligence/src/main/java/org/example/db/IdentityDAO.java
Outdated
Show resolved
Hide resolved
typedb#151 (comment) Solve refactor packages
What is the goal of this PR?
Adding a CTI example using Spring Boot and GraphiQL in order to get a graphql front end as well as a REST API.
What are the changes implemented in this PR?
This project utilizes Spring Boot and GraphQL to access a TypeDB database filled with Cyber Threat Intelligence (CTI) related dataset. The application provides a GraphQL API to interact with the CTI data stored in the TypeDB database.
We can also see how easy it is to create complex queries using query composition.
We are using the DAO design pattern on which our design depends to be able to treat data and demonstrate query composition in TypeDB.