Skip to content
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

Backend Updates #324

Merged
merged 9 commits into from
Oct 15, 2023
Merged

Backend Updates #324

merged 9 commits into from
Oct 15, 2023

Conversation

KCarretto
Copy link
Collaborator

@KCarretto KCarretto commented Oct 13, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Requires activated user context for all queries
  • Updates our version of entgo
  • Include feature 'sql/upsert` in entgo generation
  • Creates a new Host ent
  • Adds a me query to get information about the current user
  • Adds a hosts query to get information about compromised hosts
  • Refactors our entire backend to support the new Host ent, migrating Tag to it (instead of Beacon)

@KCarretto KCarretto requested a review from hulto October 13, 2023 01:49
Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"""Platform the agent is operating on."""
platform: HostPlatform!
"""Timestamp of when a task was last claimed or updated for the host."""
lastSeenAt: Time
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👌👌👌

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #324 (cc79208) into main (c22cee4) will decrease coverage by 0.18%.
The diff coverage is 56.92%.

@@            Coverage Diff             @@
##             main     #324      +/-   ##
==========================================
- Coverage   74.75%   74.57%   -0.18%     
==========================================
  Files          95       96       +1     
  Lines        6346     6380      +34     
==========================================
+ Hits         4744     4758      +14     
- Misses       1515     1535      +20     
  Partials       87       87              
Files Coverage Δ
implants/lib/tavern/src/lib.rs 87.85% <ø> (ø)
tavern/internal/graphql/ent.resolvers.go 20.00% <ø> (ø)
tavern/internal/graphql/mutation.resolvers.go 63.46% <ø> (+1.19%) ⬆️
tavern/internal/graphql/query.resolvers.go 59.01% <ø> (-3.49%) ⬇️
tavern/test_data.go 98.83% <ø> (-0.02%) ⬇️
tavern/internal/ent/schema/tag.go 52.00% <0.00%> (ø)
tavern/internal/ent/schema/beacon.go 59.67% <0.00%> (-12.95%) ⬇️
implants/lib/tavern/src/mutations.rs 67.39% <25.00%> (ø)
tavern/internal/ent/schema/host.go 70.83% <70.83%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmp5987 cmp5987 merged commit 53111f9 into main Oct 15, 2023
6 of 8 checks passed
@cmp5987 cmp5987 deleted the irsec-backend-2023 branch October 15, 2023 22:20
hulto added a commit that referenced this pull request Oct 15, 2023
* require auth for queries

* added a 'me' query

* Adding new host entity and refactoring the whole backend...

* Tests pass

* Fix agent type export

* add root level 'hosts' query

* fix(UI): Change structure of beacons to have host type

* fix(UI): Build UI for production

---------

Co-authored-by: Hulto <7121375+hulto@users.noreply.github.com>
Co-authored-by: Squidli <catie@squidli.com>
KCarretto added a commit that referenced this pull request Feb 1, 2024
 
Backend Updates (#324)

* require auth for queries

* added a 'me' query

* Adding new host entity and refactoring the whole backend...

* Tests pass

* Fix agent type export

* add root level 'hosts' query

* fix(UI): Change structure of beacons to have host type

* fix(UI): Build UI for production

---------

Co-authored-by: Hulto <7121375+hulto@users.noreply.github.com>
Co-authored-by: Squidli <catie@squidli.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants