-
Notifications
You must be signed in to change notification settings - Fork 22
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 like-service (PHP) for liking/unliking posts #63
Conversation
d3725f0
to
530d845
Compare
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.
Didn't have a look at everything yet, but I left some feedback already that is actionable.
src/microblog-service/src/main/java/org/dynatrace/microblog/dto/Post.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.
Tried it out locally again, works like a charm, including the exploit toolkit 👍
LGTM!
exploit-toolkit/exploits/sql-injection/SQLI-LIKE-SERVICE-REMOVE-LIKE.md
Outdated
Show resolved
Hide resolved
0b6b3a5
to
dc32b1e
Compare
Pls rebase on |
…exploitable through frontend
dc32b1e
to
fb332cc
Compare
@W3D3 I rebased; you should be able to merge it now 🚀 |
The new
like-service
uses Laravel, a PHP framework, in a version that is vulnerable to a certain kind of SQL Injection (see Snyk entry) and that is recognized as a Third Party Vulnerability.Posts on the frontend now have a like symbol in the bottom right corner, which you can use to like or unlike the post. The Laravel vulnerability allows you to remove another user's like (described in more detail in exploit-toolkit/exploits/sql-injection/SQLI-LIKE-SERVICE-REMOVE-LIKE.md).
The
microblog-service
had to be updated to send a post ID when you request posts in order to allow the frontend and like-service to uniquely identify posts.The user-simulator, malicious-load-generator, and exploit-toolkit were also updated.
Some updates had to be made to the way Jaeger is used. Whereas most services communicate with Jaeger via a
jaeger-agent
, the PHP OpenTelemetry extension can only communicate with thejaeger-collector
. However, to get thejaeger-collector
to accept OpenTelemetry traces, a config file (chart/jaeger-otlp-values.yaml
) needs to be passed when installing jaeger, as described in docs/TRACING.md.Most of the new files in
src/like-service
were auto-generated as part of a template. Some of the main files of interest are:routes/web.php
: Route definitionsapp/Http/Controllers/LikeController.php
: Handling of the routesconfig/database.php
: Database credentialsapp/Console/Commands/CreateDatabase.php
: Database creationdatabase/migrations/2023_07_13_073935_create_like_table.php
: Table creation (yes, the name has to contain a timestamp)public/index.php
: Initialization code for tracing (OpenTelemetry/Jaeger)app/Http/Controllers/JaegerPropagator.php
: Special "propagator" code that is needed for PHP OpenTelemetry to interface with Jaeger