Skip to content

Commit

Permalink
Copyright bump (GoogleCloudPlatform#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
sruffilli authored Jan 1, 2022
1 parent 52bcf06 commit ee25965
Show file tree
Hide file tree
Showing 676 changed files with 1,529 additions and 1,511 deletions.
4 changes: 2 additions & 2 deletions .ci/cloudbuild.lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,7 +50,7 @@ steps:
"factories/firewall-vpc-rules",
"foundations",
"modules",
"networking"
"networking",
]

substitutions:
Expand Down
2 changes: 1 addition & 1 deletion .ci/cloudbuild.test.environments.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .ci/cloudbuild.test.examples.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .ci/cloudbuild.test.modules.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/daily-tag.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,7 +18,7 @@ name: |
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
- cron: "0 2 * * *"

permissions:
contents: write
Expand All @@ -44,4 +43,3 @@ jobs:
else
echo "No changes in last 24 hours"
fi
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Tests'
name: "Tests"
on:
schedule:
- cron: '45 2 * * *'
- cron: "45 2 * * *"
pull_request:
branches:
- master
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/asset-inventory-feed-remediation/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-fine-grained-iam/backend.tf.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-fine-grained-iam/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-fine-grained-iam/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-fine-grained-iam/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-fine-grained-iam/versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,4 +40,4 @@ module "cloud-dns" {

teams = var.teams
dns_domain = var.dns_domain
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,4 +22,4 @@ output "host_project_id" {
output "shared_vpc_self_link" {
description = "Shared VPC Self link"
value = module.shared-vpc.self_link
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,4 +71,4 @@ module "project-service-2" {
attach = true
host_project = module.project-host.project_id
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,4 +62,4 @@ variable "dns_domain" {
variable "teams" {
description = "List of teams that require their own Cloud DNS instance"
default = ["appteam1", "appteam2"]
}
}
2 changes: 1 addition & 1 deletion cloud-operations/dns-shared-vpc/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-shared-vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-shared-vpc/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/dns-shared-vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
70 changes: 35 additions & 35 deletions cloud-operations/iam-delegated-role-grants/audit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,50 +28,50 @@


def get_role_permissions(role):
if role.startswith("roles/"):
endpoint = iam_service.roles()
elif role.startswith("projects/"):
endpoint = iam_service.projects().roles()
elif role.startswith("organizations/"):
endpoint = iam_service.organizations().roles()
else:
raise Exception(f"Invalid role {role}")
if role.startswith("roles/"):
endpoint = iam_service.roles()
elif role.startswith("projects/"):
endpoint = iam_service.projects().roles()
elif role.startswith("organizations/"):
endpoint = iam_service.organizations().roles()
else:
raise Exception(f"Invalid role {role}")

response = endpoint.get(name=role).execute()
permissions = response.get("includedPermissions")
return permissions
response = endpoint.get(name=role).execute()
permissions = response.get("includedPermissions")
return permissions


@click.command()
@click.argument("file", type=click.File("r"))
def main(file):
"""Verify that the set of GCP roles in FILE does not include the
permission setIamPolicy at project, folder or organization level
"""Verify that the set of GCP roles in FILE does not include the
permission setIamPolicy at project, folder or organization level
This program authenticates against GCP using default application
credentials to query project and organization level roles.
This program authenticates against GCP using default application
credentials to query project and organization level roles.
"""
clean_roles = [x.rstrip(" \n") for x in file]
roles = (x for x in clean_roles if x)
"""
clean_roles = [x.rstrip(" \n") for x in file]
roles = (x for x in clean_roles if x)

allok = True
for role in roles:
try:
permissions = set(get_role_permissions(role))
except Error as e:
print(f"WARNING: can't read {role}: {e}")
allok = False
else:
matched_sensitive_permissions = SENSITIVE_PERMISSIONS & permissions
if matched_sensitive_permissions:
print(f"WARNING: {role} contains {matched_sensitive_permissions}")
allok = False
else:
print(f"{role} ok")
allok = True
for role in roles:
try:
permissions = set(get_role_permissions(role))
except Error as e:
print(f"WARNING: can't read {role}: {e}")
allok = False
else:
matched_sensitive_permissions = SENSITIVE_PERMISSIONS & permissions
if matched_sensitive_permissions:
print(f"WARNING: {role} contains {matched_sensitive_permissions}")
allok = False
else:
print(f"{role} ok")

exit(0 if allok else 1)
exit(0 if allok else 1)


if __name__ == "__main__":
main()
main()
2 changes: 1 addition & 1 deletion cloud-operations/iam-delegated-role-grants/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/iam-delegated-role-grants/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/iam-delegated-role-grants/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/iam-delegated-role-grants/versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cloud-operations/onprem-sa-key-management/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit ee25965

Please sign in to comment.