Skip to content

Commit

Permalink
[sec_scan][22] add authorized keys reporter
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tigrato committed Jul 23, 2024
1 parent ecfa26a commit c1f306c
Show file tree
Hide file tree
Showing 6 changed files with 886 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 c1f306c

Please sign in to comment.