You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "kdamichie (via GitHub)" <gi...@apache.org> on 2023/06/20 18:21:18 UTC
[GitHub] [trafficcontrol] kdamichie opened a new pull request, #7586: Migration that updates Operations Role's permissions to include DNS-S…
kdamichie opened a new pull request, #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586
<!--
Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
If this closes or relates to an existing issue, please reference it using one of the following:
Closes: #ISSUE
Related: #ISSUE
If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://apache.org/security regarding vulnerability disclosure.
-->
This is a migration changes to add an additional permission to Operations Role to include DNS-SEC:READ
<!-- **^ Add meaningful description above** --><hr/>
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this PR.
Feel free to add the name of a tool or script that is affected but not on the list.
-->
- Traffic Ops
## What is the best way to verify this PR?
<!-- Please include here ALL the steps necessary to test your PR.
If your PR has tests (and most should), provide the steps needed to run the tests.
If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
Verify that the Operations Role can read the cdns/name/{name}/dnsseckeys endpoint
## If this is a bugfix, which Traffic Control versions contained the bug?
<!-- Delete this section if the PR is not a bugfix, or if the bug is only in the master branch.
Examples:
- 5.1.2
- 5.1.3 (RC1)
-->
## PR submission checklist
- [ ] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
- [ ] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
- [x] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1618807362
> > > are you saying we should NOT run seed on upgrade?
> >
> >
> > yes. I think there was a reason we needed o do that, but I think that particular reason is no longer applicable. Hard to say, though, because I'm not totally sure the reason ever existed, let alone what it was.
>
> Regardless if the reason still applies, `admin upgrade` does still run seeds after migrations.
>
> You're right that updating `seeds.sql` can technically wait until migrations are squashed in the next release, but most DB squashing happens in `create_tables.sql`, so giving the DB squasher a manual step in `seeds.sql` is a little tedious and we might as well do it now so it doesn't get missed.
I wasn't saying it *should* wait, I was saying it *must*, otherwise we're escalating permissions. That makes it a security-related bug that operations's permissions have been upgraded.
I'll go change `admin` to not re-do seeding on upgrade so I can give the release including the change a +1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] mitchell852 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "mitchell852 (via GitHub)" <gi...@apache.org>.
mitchell852 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1608072486
> It would be fine to add it to the seed data if we didn't seed on upgrades. Still not sure why that happens.
we do run seeds.sql on upgrade, right? and everything that is already seeded is simply ignored. are you saying we should NOT run seed on upgrade? that would probably make sense as the meaning of "seed" is to initially _seed_ the database.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman merged pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "zrhoffman (via GitHub)" <gi...@apache.org>.
zrhoffman merged PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1608145353
> are you saying we should NOT run seed on upgrade?
yes. I think there was a reason we needed o do that, but I think that particular reason is no longer applicable. Hard to say, though, because I'm not totally sure the reason ever existed, let alone what it was.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] mitchell852 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "mitchell852 (via GitHub)" <gi...@apache.org>.
mitchell852 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1608076429
@kdamichie - i think you need to add it to the seeds file as well. i.e. https://github.com/apache/trafficcontrol/pull/7343
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1601627399
It would be fine to add it to the seed data if we didn't seed on upgrades. Still not sure why that happens.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "zrhoffman (via GitHub)" <gi...@apache.org>.
zrhoffman commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1611685884
> > are you saying we should NOT run seed on upgrade?
>
> yes. I think there was a reason we needed o do that, but I think that particular reason is no longer applicable. Hard to say, though, because I'm not totally sure the reason ever existed, let alone what it was.
Regardless if the reason still applies, `admin upgrade` does still run seeds after migrations.
You're right that updating `seeds.sql` can technically wait until migrations are squashed in the next release, but most DB squashing happens in `create_tables.sql`, so giving the DB squasher a manual step in `seeds.sql` is a little tedious and we might as well do it now so it doesn't get missed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] mitchell852 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "mitchell852 (via GitHub)" <gi...@apache.org>.
mitchell852 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1601368520
> From what I can tell, the only endpoint that requires `DNS-SEC:READ` is `/cdns/name/{{name}}/dnsseckeys` - and that requires an `admin` "priv level". So giving that to the "operator Role" - which has lower-than-admin "priv level" - is escalating permissions.
i agree. this seems like an endpoint that is best left to admins only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1599951571
From what I can tell, the only endpoint that requires `DNS-SEC:READ` is `/cdns/name/{{name}}/dnsseckeys` - and that requires an `admin` "priv level". So giving that to the "operator Role" - which has lower-than-admin "priv level" - is escalating permissions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] codecov[bot] commented on pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#issuecomment-1601371035
## [Codecov](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#7586](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (7a8e877) into [master](https://app.codecov.io/gh/apache/trafficcontrol/commit/2e995e734d4eeade97616cd486e000cae2038035?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (2e995e7) will **increase** coverage by `37.37%`.
> The diff coverage is `75.86%`.
```diff
@@ Coverage Diff @@
## master #7586 +/- ##
=============================================
+ Coverage 27.74% 65.11% +37.37%
Complexity 98 98
=============================================
Files 686 200 -486
Lines 78128 8076 -70052
Branches 90 885 +795
=============================================
- Hits 21675 5259 -16416
+ Misses 54396 2637 -51759
+ Partials 2057 180 -1877
```
| Flag | Coverage Δ | |
|---|---|---|
| golib_unit | `?` | |
| grove_unit | `?` | |
| t3c_unit | `?` | |
| traffic_monitor_unit | `?` | |
| traffic_ops_unit | `?` | |
| traffic_portal_v2 | `74.97% <50.00%> (?)` | |
| traffic_stats_unit | `?` | |
| unit_tests | `74.97% <50.00%> (+50.56%)` | :arrow_up: |
| v3 | `?` | |
| v4 | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [cache-config/t3c-generate/cfgfile/wrappers.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1nZW5lcmF0ZS9jZmdmaWxlL3dyYXBwZXJzLmdv) | `49.57% <ø> (+0.12%)` | :arrow_up: |
| [cache-config/t3c-generate/config/config.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1nZW5lcmF0ZS9jb25maWcvY29uZmlnLmdv) | `0.89% <ø> (ø)` | |
| [...al/src/app/api/testing/delivery-service.service.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvYXBpL3Rlc3RpbmcvZGVsaXZlcnktc2VydmljZS5zZXJ2aWNlLnRz) | `63.00% <ø> (ø)` | |
| [...affic-portal/src/app/api/testing/server.service.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvYXBpL3Rlc3Rpbmcvc2VydmVyLnNlcnZpY2UudHM=) | `41.25% <0.00%> (ø)` | |
| [.../core/deliveryservice/ds-card/ds-card.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9kZWxpdmVyeXNlcnZpY2UvZHMtY2FyZC9kcy1jYXJkLmNvbXBvbmVudC50cw==) | `82.25% <ø> (ø)` | |
| [.../profiles/profile-table/profile-table.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9wcm9maWxlcy9wcm9maWxlLXRhYmxlL3Byb2ZpbGUtdGFibGUuY29tcG9uZW50LnRz) | `82.50% <ø> (ø)` | |
| [...ore/servers/capabilities/capabilities.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9zZXJ2ZXJzL2NhcGFiaWxpdGllcy9jYXBhYmlsaXRpZXMuY29tcG9uZW50LnRz) | `100.00% <ø> (ø)` | |
| [...servers/server-details/server-details.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9zZXJ2ZXJzL3NlcnZlci1kZXRhaWxzL3NlcnZlci1kZXRhaWxzLmNvbXBvbmVudC50cw==) | `62.32% <ø> (ø)` | |
| [...tatuses/status-details/status-details.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9zdGF0dXNlcy9zdGF0dXMtZGV0YWlscy9zdGF0dXMtZGV0YWlscy5jb21wb25lbnQudHM=) | `57.14% <0.00%> (ø)` | |
| [...l/src/app/shared/interceptor/alerts.interceptor.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvc2hhcmVkL2ludGVyY2VwdG9yL2FsZXJ0cy5pbnRlcmNlcHRvci50cw==) | `12.50% <0.00%> (ø)` | |
| ... and [7 more](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
... and [685 files with indirect coverage changes](https://app.codecov.io/gh/apache/trafficcontrol/pull/7586/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7586: Migration that updates Operations Role's permissions to include DNS-S…
Posted by "zrhoffman (via GitHub)" <gi...@apache.org>.
zrhoffman commented on code in PR #7586:
URL: https://github.com/apache/trafficcontrol/pull/7586#discussion_r1245376002
##########
traffic_ops/app/db/migrations/2023062011541800_operations_role_add_perm.down.sql:
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+WITH role_id_query AS (
+ SELECT id FROM public.role WHERE name = 'operations'
+)
+DELETE FROM public.role_capability
+WHERE role_id IN (
+ SELECT id FROM role_id_query
+)
+ AND cap_name = 'DNS-SEC:READ'
+ AND EXISTS (
+ SELECT 1 FROM role_id_query
+ );
Review Comment:
Nit:
```sql
AND EXISTS (
SELECT FROM role_id_query
);
```
##########
traffic_ops/app/db/migrations/2023062011541800_operations_role_add_perm.up.sql:
##########
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+WITH role_id_query AS (
+ SELECT id FROM public.role WHERE name = 'operations'
+)
+INSERT INTO public.role_capability ("role_id", cap_name)
+SELECT id, 'DNS-SEC:READ'
+FROM role_id_query
+WHERE EXISTS (SELECT 1 FROM role_id_query);
Review Comment:
Nit:
```sql
WHERE EXISTS (SELECT FROM role_id_query);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org