Skip to content

Commit

Permalink
security: misc fixes (#610)
Browse files Browse the repository at this point in the history
* fix integer conversion

* use commit hashes for GHA Actions

* remove manual codeql?

* idk what github wants
  • Loading branch information
BeryJu authored Dec 20, 2024
1 parent 73d605d commit ff551c4
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 90 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.2.2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v5
- uses: actions/setup-go@v5.2.0
with:
go-version-file: go.mod
cache: true
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- id: generate_token
uses: tibdex/github-app-token@v2
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6.1.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf
with:
version: latest
args: release --clean
Expand All @@ -41,7 +41,7 @@ jobs:
VERSION=$(./$(ls) -version)
echo "##[set-output name=version]$VERSION"
- name: Create a Sentry.io release
uses: getsentry/action-release@v1
uses: getsentry/action-release@e769183448303de84c5a06aaaddf9da7be26d6c7
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: authentik-security-inc
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.2.0
with:
go-version-file: go.mod
cache: true
Expand All @@ -40,17 +40,17 @@ jobs:
terraform: latest
allow_failure: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.2.0
with:
go-version-file: go.mod
cache: true
- uses: goauthentik/action-setup-authentik@v1.4
- uses: goauthentik/action-setup-authentik@224742cef59f3d90fdd68ec7d300f513303a1655
id: setup
with:
version: ${{ matrix.authentik_version }}
sentry_env: goauthentik-terraform-ci
- uses: hashicorp/setup-terraform@v3
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
Expand Down Expand Up @@ -81,15 +81,15 @@ jobs:
run: |
docker logs ${{ steps.setup.outputs.worker_container_id }}
- if: ${{ always() }}
uses: test-summary/action@v2
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86
with:
paths: junit.xml
show: "fail"
- if: ${{ always() }}
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
with:
token: ${{ secrets.CODECOV_TOKEN }}
- if: ${{ always() }}
uses: codecov/test-results-action@v1
uses: codecov/test-results-action@9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_google_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func resourceProviderGoogleWorkspaceCreate(ctx context.Context, d *schema.Resour
func resourceProviderGoogleWorkspaceRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down Expand Up @@ -169,7 +169,7 @@ func resourceProviderGoogleWorkspaceRead(ctx context.Context, d *schema.Resource

func resourceProviderGoogleWorkspaceUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -189,7 +189,7 @@ func resourceProviderGoogleWorkspaceUpdate(ctx context.Context, d *schema.Resour

func resourceProviderGoogleWorkspaceDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func resourceProviderLDAPCreate(ctx context.Context, d *schema.ResourceData, m i
func resourceProviderLDAPRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -139,7 +139,7 @@ func resourceProviderLDAPRead(ctx context.Context, d *schema.ResourceData, m int

func resourceProviderLDAPUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -156,7 +156,7 @@ func resourceProviderLDAPUpdate(ctx context.Context, d *schema.ResourceData, m i

func resourceProviderLDAPDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_microsoft_entra.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func resourceProviderMicrosoftEntraCreate(ctx context.Context, d *schema.Resourc
func resourceProviderMicrosoftEntraRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down Expand Up @@ -158,7 +158,7 @@ func resourceProviderMicrosoftEntraRead(ctx context.Context, d *schema.ResourceD

func resourceProviderMicrosoftEntraUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -178,7 +178,7 @@ func resourceProviderMicrosoftEntraUpdate(ctx context.Context, d *schema.Resourc

func resourceProviderMicrosoftEntraDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func resourceProviderOAuth2Create(ctx context.Context, d *schema.ResourceData, m
func resourceProviderOAuth2Read(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down Expand Up @@ -271,7 +271,7 @@ func resourceProviderOAuth2Read(ctx context.Context, d *schema.ResourceData, m i

func resourceProviderOAuth2Update(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -288,7 +288,7 @@ func resourceProviderOAuth2Update(ctx context.Context, d *schema.ResourceData, m

func resourceProviderOAuth2Delete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func resourceProviderProxyCreate(ctx context.Context, d *schema.ResourceData, m
func resourceProviderProxyRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down Expand Up @@ -247,7 +247,7 @@ func resourceProviderProxyRead(ctx context.Context, d *schema.ResourceData, m in

func resourceProviderProxyUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -264,7 +264,7 @@ func resourceProviderProxyUpdate(ctx context.Context, d *schema.ResourceData, m

func resourceProviderProxyDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_rac.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func resourceProviderRACCreate(ctx context.Context, d *schema.ResourceData, m in
func resourceProviderRACRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -128,7 +128,7 @@ func resourceProviderRACRead(ctx context.Context, d *schema.ResourceData, m inte

func resourceProviderRACUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -148,7 +148,7 @@ func resourceProviderRACUpdate(ctx context.Context, d *schema.ResourceData, m in

func resourceProviderRACDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_radius.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func resourceProviderRadiusCreate(ctx context.Context, d *schema.ResourceData, m
func resourceProviderRadiusRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -110,7 +110,7 @@ func resourceProviderRadiusRead(ctx context.Context, d *schema.ResourceData, m i

func resourceProviderRadiusUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -127,7 +127,7 @@ func resourceProviderRadiusUpdate(ctx context.Context, d *schema.ResourceData, m

func resourceProviderRadiusDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func resourceProviderSAMLCreate(ctx context.Context, d *schema.ResourceData, m i
func resourceProviderSAMLRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down Expand Up @@ -263,7 +263,7 @@ func resourceProviderSAMLRead(ctx context.Context, d *schema.ResourceData, m int

func resourceProviderSAMLUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -280,7 +280,7 @@ func resourceProviderSAMLUpdate(ctx context.Context, d *schema.ResourceData, m i

func resourceProviderSAMLDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/resource_provider_scim.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func resourceProviderSCIMCreate(ctx context.Context, d *schema.ResourceData, m i
func resourceProviderSCIMRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
var diags diag.Diagnostics
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -114,7 +114,7 @@ func resourceProviderSCIMRead(ctx context.Context, d *schema.ResourceData, m int

func resourceProviderSCIMUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -131,7 +131,7 @@ func resourceProviderSCIMUpdate(ctx context.Context, d *schema.ResourceData, m i

func resourceProviderSCIMDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
c := m.(*APIClient)
id, err := strconv.Atoi(d.Id())
id, err := strconv.ParseInt(d.Id(), 10, 32)
if err != nil {
return diag.FromErr(err)
}
Expand Down
Loading

0 comments on commit ff551c4

Please sign in to comment.