Skip to content

Commit

Permalink
[sec_scan][22] add authorized keys reporter (#44523)
Browse files Browse the repository at this point in the history
* [sec_scan][22] add authorized keys reporter

This PR introduces a SSH authorized keys reporter that monitors `/etc/passwd` file and all users' authorized_keys files and reports the findings back to teleport.

Part of gravitational/access-graph#637

Signed-off-by: Tiago Silva <[email protected]>

* handle comments

* handle comments

---------

Signed-off-by: Tiago Silva <[email protected]>
  • Loading branch information
tigrato committed Jul 30, 2024
1 parent 72457a8 commit afca9cb
Show file tree
Hide file tree
Showing 6 changed files with 891 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/types/accessgraph/authorized_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import (
)

const (
authorizedKeyDefaultKeyTTL = 8 * time.Hour
// AuthorizedKeyDefaultKeyTTL is the default TTL for an authorized key.
AuthorizedKeyDefaultKeyTTL = 8 * time.Hour
)

// NewAuthorizedKey creates a new SSH authorized key resource.
Expand All @@ -40,7 +41,7 @@ func NewAuthorizedKey(spec *accessgraphv1pb.AuthorizedKeySpec) (*accessgraphv1pb
Metadata: &headerv1.Metadata{
Name: name,
Expires: timestamppb.New(
time.Now().Add(authorizedKeyDefaultKeyTTL),
time.Now().Add(AuthorizedKeyDefaultKeyTTL),
),
},
Spec: spec,
Expand Down
Loading

0 comments on commit afca9cb

Please sign in to comment.